diff --git a/custom_components/ids_hyyp/__init__.py b/custom_components/ids_hyyp/__init__.py index 7eae508..f5f8e42 100644 --- a/custom_components/ids_hyyp/__init__.py +++ b/custom_components/ids_hyyp/__init__.py @@ -3,10 +3,11 @@ import logging +from pyhyypapi import HyypClient + from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_TIMEOUT, CONF_TOKEN, Platform from homeassistant.core import HomeAssistant -from pyhyypapi import HyypClient from .const import ( ATTR_ARM_CODE, @@ -53,7 +54,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: entry.async_on_unload(entry.add_update_listener(_async_update_listener)) - hass.config_entries.async_setup_platforms(entry, PLATFORMS) + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) return True diff --git a/custom_components/ids_hyyp/alarm_control_panel.py b/custom_components/ids_hyyp/alarm_control_panel.py index e408ce3..8586369 100644 --- a/custom_components/ids_hyyp/alarm_control_panel.py +++ b/custom_components/ids_hyyp/alarm_control_panel.py @@ -1,7 +1,7 @@ """Support for IDS Hyyp alarms.""" from __future__ import annotations -from typing import Any +from pyhyypapi.exceptions import HTTPError, HyypApiError from homeassistant.components.alarm_control_panel import ( AlarmControlPanelEntity, @@ -18,7 +18,6 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType -from pyhyypapi.exceptions import HTTPError, HyypApiError from .const import ATTR_ARM_CODE, DATA_COORDINATOR, DOMAIN from .coordinator import HyypDataUpdateCoordinator @@ -91,7 +90,7 @@ def state(self) -> StateType: return STATE_ALARM_DISARMED - async def async_alarm_disarm(self, code: Any = None) -> None: + async def async_alarm_disarm(self, code: str | None = None) -> None: """Send disarm command.""" _code = code if not bool(self._arm_code) else self._arm_code @@ -113,7 +112,7 @@ async def async_alarm_disarm(self, code: Any = None) -> None: else: raise HTTPError(f"Cannot disarm alarm: {update_ok}") - async def async_alarm_arm_away(self, code: Any = None) -> None: + async def async_alarm_arm_away(self, code: str | None = None) -> None: """Send arm away command.""" _code = code if not bool(self._arm_code) else self._arm_code @@ -135,7 +134,7 @@ async def async_alarm_arm_away(self, code: Any = None) -> None: else: raise HTTPError(f"Cannot arm alarm, check for violated zones. {update_ok}") - async def async_alarm_arm_home(self, code: Any = None) -> None: + async def async_alarm_arm_home(self, code: str | None = None) -> None: """Send arm home command.""" _code = code if not bool(self._arm_code) else self._arm_code @@ -160,7 +159,7 @@ async def async_alarm_arm_home(self, code: Any = None) -> None: f"Cannot arm home alarm, check for violated zones. {update_ok}" ) - async def async_alarm_trigger(self, code: Any = None) -> None: + async def async_alarm_trigger(self, code: str | None = None) -> None: """Send alarm trigger.""" _code = code if not bool(self._arm_code) else self._arm_code diff --git a/custom_components/ids_hyyp/config_flow.py b/custom_components/ids_hyyp/config_flow.py index 094e113..4db8eef 100644 --- a/custom_components/ids_hyyp/config_flow.py +++ b/custom_components/ids_hyyp/config_flow.py @@ -4,15 +4,15 @@ import logging from typing import Any +from pyhyypapi.client import HyypClient +from pyhyypapi.constants import DEFAULT_TIMEOUT +from pyhyypapi.exceptions import HTTPError, HyypApiError, InvalidURL import voluptuous as vol from homeassistant.config_entries import ConfigEntry, ConfigFlow, OptionsFlow from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, CONF_TIMEOUT, CONF_TOKEN from homeassistant.core import callback from homeassistant.data_entry_flow import FlowResult -from pyhyypapi.client import HyypClient -from pyhyypapi.constants import DEFAULT_TIMEOUT -from pyhyypapi.exceptions import HTTPError, HyypApiError, InvalidURL from .const import ( ATTR_ARM_CODE, diff --git a/custom_components/ids_hyyp/const.py b/custom_components/ids_hyyp/const.py index ea080c3..0525a4b 100644 --- a/custom_components/ids_hyyp/const.py +++ b/custom_components/ids_hyyp/const.py @@ -1,4 +1,4 @@ -"""Constants for the ezviz integration.""" +"""Constants for the ids_hyyp integration.""" DOMAIN = "ids_hyyp" MANUFACTURER = "IDS" diff --git a/custom_components/ids_hyyp/coordinator.py b/custom_components/ids_hyyp/coordinator.py index 393563c..7601078 100644 --- a/custom_components/ids_hyyp/coordinator.py +++ b/custom_components/ids_hyyp/coordinator.py @@ -4,11 +4,11 @@ from typing import Any from async_timeout import timeout +from pyhyypapi.client import HyypClient +from pyhyypapi.exceptions import HTTPError, HyypApiError, InvalidURL from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed -from pyhyypapi.client import HyypClient -from pyhyypapi.exceptions import HTTPError, HyypApiError, InvalidURL from .const import DOMAIN diff --git a/custom_components/ids_hyyp/manifest.json b/custom_components/ids_hyyp/manifest.json index fbc795c..b37eba4 100644 --- a/custom_components/ids_hyyp/manifest.json +++ b/custom_components/ids_hyyp/manifest.json @@ -1,10 +1,10 @@ { "domain": "ids_hyyp", "name": "IDS Hyyp(Beta)", - "version": "0.0.0.7", + "version": "0.0.0.8", "documentation": "https://www.home-assistant.io/integrations/idshyyp", "codeowners": ["@RenierM26"], - "requirements": ["pyhyypapi==0.0.0.5"], + "requirements": ["pyhyypapi==0.0.0.6"], "config_flow": true, "iot_class": "cloud_polling" } diff --git a/custom_components/ids_hyyp/switch.py b/custom_components/ids_hyyp/switch.py index 1a38044..6dcbe16 100644 --- a/custom_components/ids_hyyp/switch.py +++ b/custom_components/ids_hyyp/switch.py @@ -3,6 +3,7 @@ from typing import Any +from pyhyypapi.exceptions import HTTPError, HyypApiError import voluptuous as vol from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity @@ -10,7 +11,6 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_platform from homeassistant.helpers.entity_platform import AddEntitiesCallback -from pyhyypapi.exceptions import HTTPError, HyypApiError from .const import ATTR_BYPASS_CODE, DATA_COORDINATOR, DOMAIN, SERVICE_BYPASS_ZONE from .coordinator import HyypDataUpdateCoordinator