mqtt receivers: call parent on_message function for debugging purposes
This commit is contained in:
parent
2f5191bb6f
commit
9e3be40a44
@ -20,6 +20,7 @@ class MQTTReceiver(MQTTBase):
|
|||||||
client.subscribe('hk/#', qos=1)
|
client.subscribe('hk/#', qos=1)
|
||||||
|
|
||||||
def on_message(self, client: mqtt.Client, userdata, msg):
|
def on_message(self, client: mqtt.Client, userdata, msg):
|
||||||
|
super().on_message(client, userdata, msg)
|
||||||
try:
|
try:
|
||||||
match = re.match(r'(?:home|hk)/(\d+)/(status|gen)', msg.topic)
|
match = re.match(r'(?:home|hk)/(\d+)/(status|gen)', msg.topic)
|
||||||
if not match:
|
if not match:
|
||||||
|
@ -27,6 +27,7 @@ class MQTTServer(MQTTBase):
|
|||||||
client.subscribe('hk/#', qos=1)
|
client.subscribe('hk/#', qos=1)
|
||||||
|
|
||||||
def on_message(self, client: mqtt.Client, userdata, msg):
|
def on_message(self, client: mqtt.Client, userdata, msg):
|
||||||
|
super().on_message(client, userdata, msg)
|
||||||
try:
|
try:
|
||||||
variants = '|'.join([s.name.lower() for s in TemperatureSensorLocation])
|
variants = '|'.join([s.name.lower() for s in TemperatureSensorLocation])
|
||||||
match = re.match(rf'hk/(\d+)/si7021/({variants})', msg.topic)
|
match = re.match(rf'hk/(\d+)/si7021/({variants})', msg.topic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user