Skip to content

Commit

Permalink
Merge pull request #64 from roflcoopter/fix_report_labels
Browse files Browse the repository at this point in the history
fix error when mqtt is not configured
  • Loading branch information
roflcoopter authored Oct 19, 2020
2 parents 88c71d3 + 5e7f7db commit 5012060
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ def report_labels(
for label in labels_removed:
mqtt_devices[label].publish(False)

for label, count in counter.items():
if reported_label_count.get(label, 0) != count:
attributes = {}
attributes["count"] = count
mqtt_devices[label].publish(True, attributes)
reported_label_count[label] = count
for label, count in counter.items():
if reported_label_count.get(label, 0) != count:
attributes = {}
attributes["count"] = count
mqtt_devices[label].publish(True, attributes)
reported_label_count[label] = count

return labels, reported_label_count

Expand Down

0 comments on commit 5012060

Please sign in to comment.