Skip to content

Commit 5012060

Browse files
authored
Merge pull request #64 from roflcoopter/fix_report_labels
fix error when mqtt is not configured
2 parents 88c71d3 + 5e7f7db commit 5012060

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ def report_labels(
249249
for label in labels_removed:
250250
mqtt_devices[label].publish(False)
251251

252-
for label, count in counter.items():
253-
if reported_label_count.get(label, 0) != count:
254-
attributes = {}
255-
attributes["count"] = count
256-
mqtt_devices[label].publish(True, attributes)
257-
reported_label_count[label] = count
252+
for label, count in counter.items():
253+
if reported_label_count.get(label, 0) != count:
254+
attributes = {}
255+
attributes["count"] = count
256+
mqtt_devices[label].publish(True, attributes)
257+
reported_label_count[label] = count
258258

259259
return labels, reported_label_count
260260

0 commit comments

Comments
 (0)