mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-12 09:34:28 +05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51f3eb3b19 | ||
|
|
1716651497 |
@@ -50,8 +50,7 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
|
|||||||
super().__init__(mega.updater)
|
super().__init__(mega.updater)
|
||||||
|
|
||||||
self.http_cmd = http_cmd
|
self.http_cmd = http_cmd
|
||||||
if self.http_cmd == 'ds2413':
|
|
||||||
self.mega.ds2413_ports |= {self.port}
|
|
||||||
self._state: State = None
|
self._state: State = None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
@@ -66,6 +65,8 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
|
|||||||
self._customize: dict = None
|
self._customize: dict = None
|
||||||
self.index = index
|
self.index = index
|
||||||
self.addr = addr
|
self.addr = addr
|
||||||
|
if self.http_cmd == 'ds2413':
|
||||||
|
self.mega.ds2413_ports |= {self.port}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def customize(self):
|
def customize(self):
|
||||||
|
|||||||
@@ -198,14 +198,13 @@ class MegaD:
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
for x in self.ds2413_ports:
|
for x in self.ds2413_ports:
|
||||||
if x.http_cmd == 'ds2413':
|
self.lg.debug(f'poll ds2413 for %s', x)
|
||||||
self.lg.debug(f'poll ds2413 for %s', x)
|
await self.get_port(
|
||||||
await self.get_port(
|
port=x,
|
||||||
port=x,
|
force_http=True,
|
||||||
force_http=True,
|
http_cmd='list',
|
||||||
http_cmd='list',
|
conv=False
|
||||||
conv=False
|
)
|
||||||
)
|
|
||||||
|
|
||||||
async def poll(self):
|
async def poll(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user