rtlamr fix for missing msg type id

This commit is contained in:
Bogdan Vlaicu
2020-05-07 17:47:30 -04:00
parent c6bc47e7f1
commit 949ffa25d3
3 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -33,15 +33,15 @@ The `mqtt_password` option defines the password for the MQTT server
### Option: `msg_type`
The `msg_type` option defines the comma-separated list of message types to receive all, scm, scm+, idm, netidm, r900 and r900bcd
The `msg_type` option defines the comma-separated list of message types to be processed: all, scm, scm+, idm, netidm, r900 and r900bcd
Default value: all
If a value is not provided, all message types will be processed
### Option: `meter_ids`
The `meter_ids` option defines the comma-separated list of meter ids to be processed
If missing or empty, all found meters will be processed
If a value is not provided, all found meters will be processed
## MQTT Data
+3 -4
View File
@@ -1,6 +1,6 @@
{
"name": "RTLAMR to MQTT Bridge",
"version": "0.1.12",
"version": "0.1.13",
"slug": "rtlamr",
"description": "RF to MQTT Bridge based on RTL_SDR/RTL_433 for RTL2832U based DVB-T USB tuners",
"url": "https://github.com/bvlaicu/home-assistant-addons/tree/master/rtlamr",
@@ -25,15 +25,14 @@
{
"mqtt_host": "hassio.local",
"mqtt_user": "",
"mqtt_password": "",
"msg_type": "all"
"mqtt_password": ""
},
"schema":
{
"mqtt_host": "str",
"mqtt_user": "str",
"mqtt_password": "str",
"msg_type": "str",
"msg_type": "str?",
"meter_ids":"str?"
}
}
+4 -1
View File
@@ -11,7 +11,7 @@ CONFIG_PATH=/data/options.json
MQTT_HOST="$(jq --raw-output '.mqtt_host' $CONFIG_PATH)"
MQTT_USER="$(jq --raw-output '.mqtt_user' $CONFIG_PATH)"
MQTT_PASS="$(jq --raw-output '.mqtt_password' $CONFIG_PATH)"
MSG_TYPE="$(jq --raw-output '.msg_type' $CONFIG_PATH)"
MSG_TYPE="$(jq --raw-output '.msg_type // empty' $CONFIG_PATH)"
METER_IDS="$(jq --raw-output '.meter_ids // empty' $CONFIG_PATH)"
@@ -37,6 +37,9 @@ LASTVAL="0"
#tail -f /dev/null
if [ -z ${MSG_TYPE+x} ] || [${MSG_TYPE} = ""]; then
MSG_TYPE="all"
fi
if [ -z ${METER_IDS+x} ] || [${METER_IDS} = ""]; then
ID_FILTER_OPTION=""