Skip to content

Commit

Permalink
Support multiple files for groups and devices options
Browse files Browse the repository at this point in the history
  • Loading branch information
rstein committed Dec 1, 2020
1 parent 3b41211 commit 8f03267
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions zigbee2mqtt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- `force_disable_retain`
- `frontend`
- `host`
- `devices` and `groups` options now accept a comma-separated string of files

## 1.16.1
- Updated Zigbee2mqtt to version [`1.16.1`](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.16.1)
Expand Down
1 change: 1 addition & 0 deletions zigbee2mqtt/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ See the [zigbee2mqtt configuration docs](https://www.zigbee2mqtt.io/information/
- Depending on your configuration, the MQTT server config may need to include the port, typically `1883` or `8883` for SSL communications. For example, `mqtt://core-mosquitto:1883` for Home Assistant's Mosquitto add-on.
- To find out which serial ports you have exposed go to **Supervisor → System → Host system → ⋮ → Hardware**
- Please see this add-on's [documentation on GitHub](https://github.com/danielwelch/hassio-zigbee2mqtt#socat) for further add-on-specific information (using Socat, how to add support for new devices etc.).
- The 'devices' and 'groups' configuration options accept arrays of files since Zigbee2MQTT v1.16.2. In order to maintain backwards compatibility of configurations, the same functionality is achieved in this addon by the use of comma-separated strings.

# Additional Configuration Options
- `network_key_string`
Expand Down
2 changes: 2 additions & 0 deletions zigbee2mqtt/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

# Parse config
cat "$CONFIG_PATH" | jq 'del(.data_path, .zigbee_shepherd_debug, .zigbee_shepherd_devices, .socat)' \
| jq 'if .devices then .devices = (.devices | split(",")|map(gsub("\\s+";"";"g"))) else . end' \
| jq 'if .groups then .groups = (.groups | split(",")|map(gsub("\\s+";"";"g"))) else . end' \
| jq 'if .advanced.ext_pan_id_string then .advanced.ext_pan_id = (.advanced.ext_pan_id_string | (split(",")|map(tonumber))) | del(.advanced.ext_pan_id_string) else . end' \
| jq 'if .advanced.network_key_string then .advanced.network_key = (.advanced.network_key_string | (split(",")|map(tonumber))) | del(.advanced.network_key_string) else . end' \
| jq 'if .device_options_string then .device_options = (.device_options_string|fromjson) | del(.device_options_string) else . end' \
Expand Down

0 comments on commit 8f03267

Please sign in to comment.