diff --git a/custom_components/mega/__init__.py b/custom_components/mega/__init__.py index d4d14e5..06afa0b 100644 --- a/custom_components/mega/__init__.py +++ b/custom_components/mega/__init__.py @@ -160,7 +160,7 @@ async def async_remove_entry(hass, entry) -> None: if hub is None: return _LOGGER.debug(f'remove {id}') - _hubs.pop(entry.entry_id) + _hubs.pop(id, None) task: asyncio.Task = _POLL_TASKS.pop(id, None) if task is not None: task.cancel() diff --git a/custom_components/mega/hub.py b/custom_components/mega/hub.py index fe9c468..ed80441 100644 --- a/custom_components/mega/hub.py +++ b/custom_components/mega/hub.py @@ -209,9 +209,9 @@ class MegaD: raise NoPort() if ':' in ret: ret = PATT_SPLIT.split(ret) - ret = dict([ + ret = {'value': dict([ x.split(':') for x in ret if x.count(':') == 1 - ]) + ])} elif 'ON' in ret: ret = {'value': 'ON'} elif 'OFF' in ret: