Skip to content

Commit

Permalink
Updated SCHEMA readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Sep 10, 2023
1 parent 4eb9575 commit 755b576
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/src/components/JsonConfigComponent/SCHEMA.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# ioBroker JSON Config
**Note: attributes or controls marked with "!", are not yet implemented.**
Admin (from version 6) supports JSON configuration for adapters.
It is possible to define the configuration in JSON file and then use it in Admin.

Example of `jsonConfig.json` file with multiple tabs can be found here: https://github.com/ioBroker/ioBroker.admin/blob/master/admin/jsonConfig.json5
and example with just one panel here: https://github.com/ioBroker/ioBroker.dwd/blob/master/admin/jsonConfig.json

You can define the settings in JSON or in JSON5 format. JSON5 is more human-readable and supports comments.

Additionally, to the JSON file, you must define in the `io-package.json` in `common` part:
```json
...
"adminUI": {
"config": "json"
}
...
```
to say that the adapter supports JSON configuration.

All labels, texts, help texts can be multi-language or just strings.

Expand Down Expand Up @@ -249,7 +265,7 @@ Possible types:
- `simple` - show simple CRON settings

- `fileSelector` (only Admin6)
- `pattern` - File extension pattern. Allowed `**/*.ext` to show all files from sub-folders too, `*.ext` to show from root folder or `folderName/*.ext` to show all files in sub-folder `folderName`. Default `**/*.*`.
- `pattern` - File extension pattern. Allowed `**/*.ext` to show all files from subfolders too, `*.ext` to show from root folder or `folderName/*.ext` to show all files in sub-folder `folderName`. Default `**/*.*`.
- `fileTypes` - [optional] type of files: `audio`, `image`, `text`
- `objectID` - Object ID of type `meta`. You can use special placeholder `%INSTANCE%`: like `myAdapter.%INSTANCE%.files`
- `upload` - path, where the uploaded files will be stored. Like `folderName`. If not defined, no upload field will be shown. To upload in the root, set this field to `/`.
Expand Down Expand Up @@ -391,6 +407,8 @@ adapter.on('message', obj => {
- `uuid` - Show iobroker UUID
- `port` - Special input for ports. It checks automatically if port is used by other instances and shows a warning

**Note: attributes or controls marked with "!", are not yet implemented.**

## Common attributes of controls
All types could have:
- `sm` - width in 1/12 of screen on small screen
Expand Down Expand Up @@ -674,7 +692,7 @@ The following variables are available in JS function in custom settings:
onChange={(newData, isChanged) => {}}
onError={error => error can be true/false or text}
/>
````
```

## Schema
Schema is [here](https://github.com/ioBroker/adapter-react-v5/tree/master/schemas)

0 comments on commit 755b576

Please sign in to comment.