Skip to content

Commit

Permalink
fix: Fix missing null check for device_topic_suffix config read in ne…
Browse files Browse the repository at this point in the history
…xt, fixes #155, #159
  • Loading branch information
unverbraucht committed Oct 23, 2023
1 parent 3e1d47a commit d013a96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions rtl_433_mqtt_autodiscovery/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"mqtt_password": "",
"mqtt_retain": false,
"rtl_topic": "rtl_433/+/events",
"device_topic_suffix": "",
"discovery_prefix": "homeassistant",
"discovery_interval": 600,
"force_update": false,
Expand All @@ -28,6 +29,7 @@
"mqtt_password": "str?",
"mqtt_retain": "bool",
"rtl_topic": "str",
"device_topic_suffix": "str?",
"discovery_prefix": "str",
"discovery_interval": "int",
"force_update": "bool",
Expand Down
4 changes: 2 additions & 2 deletions rtl_433_mqtt_autodiscovery/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ else
OTHER_ARGS="${OTHER_ARGS} --force_update"
fi
# This is an optional parameter and we don't want to overwrite the defaults
DEVICE_TOPIC_SUFFIX=$(bashio::config "device_topic_suffix")
if [ ! -z $DEVICE_TOPIC_SUFFIX ]; then
if bashio::config.has_value "device_topic_suffix"; then
DEVICE_TOPIC_SUFFIX=$(bashio::config "device_topic_suffix")
OTHER_ARGS="${OTHER_ARGS} -T ${DEVICE_TOPIC_SUFFIX}"
fi

Expand Down

0 comments on commit d013a96

Please sign in to comment.