From 7bc380d970a94833bd18503940e739066d101ef8 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 25 Dec 2022 03:07:34 +0300 Subject: sensors_mqtt_receiver: fix subscribe() topic --- src/sensors_mqtt_receiver.py | 4 ++-- 1 file 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 -- cgit v1.2.3