summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-01-04 02:33:26 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-01-04 02:33:26 +0300
commitee8381f7c5d9646688c5b9295ac7078b42415ba2 (patch)
tree59822561b0b62b5591605b76b753fbc0bafe8408
parent1d508814caba0db6618800291f1581cf30dfb34c (diff)
relay_mqtt_bot: fix
-rwxr-xr-xsrc/relay_mqtt_bot.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/relay_mqtt_bot.py b/src/relay_mqtt_bot.py
index 6fc981b..33b7e06 100755
--- a/src/relay_mqtt_bot.py
+++ b/src/relay_mqtt_bot.py
@@ -48,7 +48,7 @@ def on_mqtt_message(home_id, message: MQTTPayload):
kwargs = dict(rssi=message.rssi, enabled=message.flags.state)
if isinstance(message, InitialStatPayload):
kwargs['fw_version'] = message.fw_version
- if home_id not in relay_states[home_id]:
+ if home_id not in relay_states:
relay_states[home_id] = MQTTRelayState()
relay_states[home_id].update(**kwargs)