mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 17:14:28 +05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fd321d4c1 | ||
|
|
6732e1b7a2 |
@@ -530,9 +530,11 @@ class MegaD:
|
||||
:return:
|
||||
"""
|
||||
_params = tuple(params.items())
|
||||
return {
|
||||
ret = {
|
||||
_params: await self.request(**params)
|
||||
}
|
||||
self.lg.debug('i2c response: %s', ret)
|
||||
return ret
|
||||
|
||||
async def get_config(self, nports=37):
|
||||
ret = defaultdict(lambda: defaultdict(list))
|
||||
|
||||
@@ -109,8 +109,10 @@ class MegaI2C(MegaPushEntity):
|
||||
def device_class(self):
|
||||
return self._device_class
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.mega.values[self._params]
|
||||
# self.lg.debug(f'get % all states: %', self._params, self.mega.values)
|
||||
return self.mega.values.get(self._params)
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user