Skip to content

Commit

Permalink
Isort, bump api, async forward entry setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
RenierM26 committed Aug 11, 2022
1 parent 3ed2e0c commit ee9e00c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
5 changes: 3 additions & 2 deletions custom_components/ids_hyyp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
11 changes: 5 additions & 6 deletions custom_components/ids_hyyp/alarm_control_panel.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions custom_components/ids_hyyp/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ids_hyyp/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Constants for the ezviz integration."""
"""Constants for the ids_hyyp integration."""

DOMAIN = "ids_hyyp"
MANUFACTURER = "IDS"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ids_hyyp/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions custom_components/ids_hyyp/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion custom_components/ids_hyyp/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

from typing import Any

from pyhyypapi.exceptions import HTTPError, HyypApiError
import voluptuous as vol

from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
from homeassistant.config_entries import ConfigEntry
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
Expand Down

0 comments on commit ee9e00c

Please sign in to comment.