Merge branch 'master' of ch1p.io:homekit

This commit is contained in:
Evgeny Zinoviev 2023-04-26 21:10:18 +03:00
commit 9462194734
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)