Merge branch 'master' of ch1p.io:homekit
This commit is contained in:
commit
9462194734
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user