Compare commits

...

3 Commits

Author SHA1 Message Date
Andrey
6c50b81bff remove scl 2021-03-04 16:22:33 +03:00
Andrey
c810693ba5 remove scl 2021-03-04 16:21:59 +03:00
Andrey
1fd321d4c1 fix errors 2021-03-04 15:01:00 +03:00
4 changed files with 7 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ async def validate_input(hass: core.HomeAssistant, data):
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for mega."""
VERSION = 19
VERSION = 20
CONNECTION_CLASS = config_entries.CONN_CLASS_ASSUMED
async def async_step_user(self, user_input=None):

View File

@@ -592,6 +592,9 @@ class MegaD:
self.lg.debug(f'scan results: %s', (req, parsed))
ret['i2c'][port].extend(parsed)
i2c_sensors.extend(req)
elif cfg.pty == '4' and cfg.m == '2':
# scl исключаем из сканирования
continue
elif cfg.pty in ('3', '2', '4'):
http_cmd = 'get'
if cfg.d == '5' and cfg.pty == '3':

View File

@@ -109,8 +109,9 @@ class MegaI2C(MegaPushEntity):
def device_class(self):
return self._device_class
@property
def state(self):
self.lg.debug(f'get % all states: %', self._params, self.mega.values)
# self.lg.debug(f'get % all states: %', self._params, self.mega.values)
return self.mega.values.get(self._params)
@property

View File

@@ -57,7 +57,7 @@ class PriorityLock(asyncio.Lock):
locked and returns True.
"""
if (not self._locked and (self._waiters is None or
all(w.cancelled() for _, w in self._waiters))):
all(w.cancelled() for _, _, w in self._waiters))):
self._locked = True
return True