mqtt receivers: call parent on_message function for debugging purposes

This commit is contained in:
Evgeny Zinoviev 2023-04-26 14:30:28 +03:00
parent 2f5191bb6f
commit 9e3be40a44
2 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class MQTTReceiver(MQTTBase):
client.subscribe('hk/#', qos=1)
def on_message(self, client: mqtt.Client, userdata, msg):
super().on_message(client, userdata, msg)
try:
match = re.match(r'(?:home|hk)/(\d+)/(status|gen)', msg.topic)
if not match:

View File

@ -27,6 +27,7 @@ class MQTTServer(MQTTBase):
client.subscribe('hk/#', qos=1)
def on_message(self, client: mqtt.Client, userdata, msg):
super().on_message(client, userdata, msg)
try:
variants = '|'.join([s.name.lower() for s in TemperatureSensorLocation])
match = re.match(rf'hk/(\d+)/si7021/({variants})', msg.topic)