mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 17:14:28 +05:00
fix mqtt sensor
This commit is contained in:
@@ -160,7 +160,7 @@ async def async_remove_entry(hass, entry) -> None:
|
|||||||
if hub is None:
|
if hub is None:
|
||||||
return
|
return
|
||||||
_LOGGER.debug(f'remove {id}')
|
_LOGGER.debug(f'remove {id}')
|
||||||
_hubs.pop(entry.entry_id)
|
_hubs.pop(id, None)
|
||||||
task: asyncio.Task = _POLL_TASKS.pop(id, None)
|
task: asyncio.Task = _POLL_TASKS.pop(id, None)
|
||||||
if task is not None:
|
if task is not None:
|
||||||
task.cancel()
|
task.cancel()
|
||||||
|
|||||||
@@ -209,9 +209,9 @@ class MegaD:
|
|||||||
raise NoPort()
|
raise NoPort()
|
||||||
if ':' in ret:
|
if ':' in ret:
|
||||||
ret = PATT_SPLIT.split(ret)
|
ret = PATT_SPLIT.split(ret)
|
||||||
ret = dict([
|
ret = {'value': dict([
|
||||||
x.split(':') for x in ret if x.count(':') == 1
|
x.split(':') for x in ret if x.count(':') == 1
|
||||||
])
|
])}
|
||||||
elif 'ON' in ret:
|
elif 'ON' in ret:
|
||||||
ret = {'value': 'ON'}
|
ret = {'value': 'ON'}
|
||||||
elif 'OFF' in ret:
|
elif 'OFF' in ret:
|
||||||
|
|||||||
Reference in New Issue
Block a user