fix errors

This commit is contained in:
Andrey
2021-02-28 14:49:38 +03:00
parent c48a3632d2
commit a0bd8acac0
3 changed files with 31 additions and 17 deletions

View File

@@ -109,7 +109,7 @@ class MegaView(HomeAssistantView):
hub.lg.warning(f'can not find extender for int port {port}')
return Response(status=200)
for e, v in data.items():
if e.startswith('ext') in data:
if e.startswith('ext'):
idx = e[3:]
pt = f'{pt_orig}e{idx}'
data['pt_orig'] = pt_orig
@@ -118,6 +118,8 @@ class MegaView(HomeAssistantView):
hub.values[pt] = data
for cb in self.callbacks[hub.id][pt]:
cb(data)
if pt in hub.ext_act:
await hub.request(cmd=hub.ext_act[pt])
else:
hub.values[port] = data
for cb in self.callbacks[hub.id][port]: