From b6d803bcedc65e7c6b1ccd7e47a85505964fa903 Mon Sep 17 00:00:00 2001 From: Yevhenii Vaskivskyi Date: Tue, 21 May 2024 20:33:51 +0200 Subject: [PATCH] 0.32.0 (#831) * Add raw data check before processing it as dict (#829) * Add `reboot_aimesh` button (#830) * Bump asusrouter to `1.10.0` * Bump version to `0.32.0` --- custom_components/asusrouter/bridge.py | 2 ++ custom_components/asusrouter/const.py | 10 +++++++++- custom_components/asusrouter/manifest.json | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/custom_components/asusrouter/bridge.py b/custom_components/asusrouter/bridge.py index 8e07c89..0b95522 100644 --- a/custom_components/asusrouter/bridge.py +++ b/custom_components/asusrouter/bridge.py @@ -270,6 +270,8 @@ async def _get_data( try: raw = await self.api.async_get_data(datatype, force=force) + if raw is None: + raw = {} if process is not None: return process(raw) return self._process_data(raw) diff --git a/custom_components/asusrouter/const.py b/custom_components/asusrouter/const.py index f7064a4..a4f4da9 100644 --- a/custom_components/asusrouter/const.py +++ b/custom_components/asusrouter/const.py @@ -987,11 +987,19 @@ ), ] STATIC_BUTTONS_OPTIONAL: list[ARButtonDescription] = [ + ARButtonDescription( + key="reboot_aimesh", + name="Reboot AiMesh", + icon=ICON_RESTART, + state=AsusSystem.AIMESH_REBOOT, + device_class=ButtonDeviceClass.RESTART, + entity_registry_enabled_default=True, + ), ARButtonDescription( key="rebuild_aimesh", name="Rebuild AiMesh", icon=ICON_DEVICES, - state=AsusSystem.REBUILD_AIMESH, + state=AsusSystem.AIMESH_REBUILD, device_class=ButtonDeviceClass.RESTART, entity_registry_enabled_default=True, ), diff --git a/custom_components/asusrouter/manifest.json b/custom_components/asusrouter/manifest.json index e1666f4..c2f9775 100644 --- a/custom_components/asusrouter/manifest.json +++ b/custom_components/asusrouter/manifest.json @@ -8,6 +8,6 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/Vaskivskyi/ha-asusrouter/issues", "loggers": ["asusrouter"], - "requirements": ["asusrouter==1.9.0"], - "version": "0.31.0" + "requirements": ["asusrouter==1.10.0"], + "version": "0.32.0" }