Compare commits

...

2 Commits

Author SHA1 Message Date
Andrey
768d46d952 hotfix 2021-01-14 22:48:07 +03:00
Andrey
359c6b99b7 hotfix 2021-01-14 22:27:07 +03:00
3 changed files with 6 additions and 6 deletions

View File

@@ -72,6 +72,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
asyncio.create_task(scan()) asyncio.create_task(scan())
class MegaBinarySensor(BinarySensorEntity, BaseMegaEntity): class MegaBinarySensor(BinarySensorEntity, BaseMegaEntity):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@@ -268,8 +268,7 @@ class MegaD:
return pty, m return pty, m
async def scan_ports(self,): async def scan_ports(self,):
async with self.lck: for x in range(38):
for x in range(38): ret = await self.scan_port(x)
ret = await self.scan_port(x) if ret:
if ret: yield [x, *ret]
yield [x, *ret]

View File

@@ -95,7 +95,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
if values is None: if values is None:
continue continue
if isinstance(values, str) and TEMP_PATT.search(values): if isinstance(values, str) and TEMP_PATT.search(values):
values = {TEMP: values} values = {TEMP: values}
elif not isinstance(values, dict): elif not isinstance(values, dict):
values = {None: values} values = {None: values}
for key in values: for key in values: