Compare commits

...

2 Commits

Author SHA1 Message Date
Andrey
c4205c7ddc fix sw-link 2021-01-25 17:23:33 +03:00
Andrey
6164966d0b fix scanning 2021-01-25 17:21:55 +03:00

View File

@@ -360,7 +360,7 @@ class MegaD:
return pty, m
async def scan_ports(self, nports=37):
for x in range(1, nports+1):
for x in range(0, nports+1):
ret = await self.scan_port(x)
if ret:
yield [x, *ret]
@@ -371,7 +371,7 @@ class MegaD:
async for port, pty, m in self.scan_ports(nports):
if pty == "0":
ret['binary_sensor'][port].append({})
elif pty == "1" and m in ['0', '1']:
elif pty == "1" and m in ['0', '1', '3']:
ret['light'][port].append({'dimmer': m == '1'})
elif pty == '3':
try: