diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-12-25 03:07:34 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-12-25 03:07:34 +0300 |
commit | 7bc380d970a94833bd18503940e739066d101ef8 (patch) | |
tree | 482df2e0ef65d52fcb710dcee33ddbe44d6609c1 | |
parent | ef350a3592a1955a0fe66420fde108fd30bc24a5 (diff) |
sensors_mqtt_receiver: fix subscribe() topic
-rwxr-xr-x | src/sensors_mqtt_receiver.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sensors_mqtt_receiver.py b/src/sensors_mqtt_receiver.py index 99b6af2..ead28db 100755 --- a/src/sensors_mqtt_receiver.py +++ b/src/sensors_mqtt_receiver.py @@ -24,12 +24,12 @@ class MQTTServer(MQTTBase): def on_connect(self, client: mqtt.Client, userdata, flags, rc): super().on_connect(client, userdata, flags, rc) self._logger.info("subscribing to home/#") - client.subscribe('home/#', qos=1) + client.subscribe('hk/#', qos=1) def on_message(self, client: mqtt.Client, userdata, msg): try: variants = '|'.join([s.name.lower() for s in TemperatureSensorLocation]) - match = re.match(rf'(?:home|hk)/(\d+)/si7021/({variants})', msg.topic) + match = re.match(rf'hk/(\d+)/si7021/({variants})', msg.topic) if not match: return |