Skip to content

Commit

Permalink
Loosen the usb_reset condition so that usb_reset has to be truthy.
Browse files Browse the repository at this point in the history
With the homeassistant add-on, it's currently impossible to turn this
feature off.

  - The default value of usb_reset is "005:002"
  - Setting usb_reset explicitly to null via `usb_reset:` ends up
getting overridden with the default value
  - Setting usb_reset to the empty string doesn't disable the feature,
until now
  • Loading branch information
JeffFaer committed Apr 7, 2022
1 parent aa123fb commit 7228124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rtlamr2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def sliding_mean(series):

# Main loop
while True:
if usb_reset is not None:
if usb_reset:
reset_usb_device(usb_reset)

mqtt_sender.publish(topic=availability_topic, payload='online', retain=True)
Expand Down

0 comments on commit 7228124

Please sign in to comment.