Drop use of HomeAssistantType in elmax (#63105)

* Drop HomeAssistantType in elmax

* Update common.py

* Update switch.py

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-02 09:19:42 +01:00 committed by GitHub
parent e3de81cd02
commit a2b611d9d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -5,7 +5,7 @@ from datetime import timedelta
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.core import HomeAssistant
from .common import ElmaxCoordinator
from .const import (
@ -21,7 +21,7 @@ from .const import (
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up elmax-cloud from a config entry."""
# Create the API client object and attempt a login, so that we immediately know
# if there is something wrong with user credentials
@ -47,7 +47,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
return True
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, ELMAX_PLATFORMS)
if unload_ok:

View file

@ -17,8 +17,8 @@ from elmax_api.model.actuator import Actuator
from elmax_api.model.endpoint import DeviceEndpoint
from elmax_api.model.panel import PanelEntry, PanelStatus
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, HomeAssistantError
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
@ -35,7 +35,7 @@ class ElmaxCoordinator(DataUpdateCoordinator[PanelStatus]):
def __init__(
self,
hass: HomeAssistantType,
hass: HomeAssistant,
logger: Logger,
username: str,
password: str,

View file

@ -8,8 +8,8 @@ from elmax_api.model.panel import PanelStatus
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import HomeAssistantType
from . import ElmaxCoordinator
from .common import ElmaxEntity
@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None: