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:
parent
e3de81cd02
commit
a2b611d9d9
3 changed files with 7 additions and 7 deletions
|
@ -5,7 +5,7 @@ from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .common import ElmaxCoordinator
|
from .common import ElmaxCoordinator
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -21,7 +21,7 @@ from .const import (
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_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."""
|
"""Set up elmax-cloud from a config entry."""
|
||||||
# Create the API client object and attempt a login, so that we immediately know
|
# Create the API client object and attempt a login, so that we immediately know
|
||||||
# if there is something wrong with user credentials
|
# if there is something wrong with user credentials
|
||||||
|
@ -47,7 +47,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
|
||||||
return True
|
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 a config entry."""
|
||||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, ELMAX_PLATFORMS)
|
unload_ok = await hass.config_entries.async_unload_platforms(entry, ELMAX_PLATFORMS)
|
||||||
if unload_ok:
|
if unload_ok:
|
||||||
|
|
|
@ -17,8 +17,8 @@ from elmax_api.model.actuator import Actuator
|
||||||
from elmax_api.model.endpoint import DeviceEndpoint
|
from elmax_api.model.endpoint import DeviceEndpoint
|
||||||
from elmax_api.model.panel import PanelEntry, PanelStatus
|
from elmax_api.model.panel import PanelEntry, PanelStatus
|
||||||
|
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, HomeAssistantError
|
from homeassistant.exceptions import ConfigEntryAuthFailed, HomeAssistantError
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
DataUpdateCoordinator,
|
DataUpdateCoordinator,
|
||||||
|
@ -35,7 +35,7 @@ class ElmaxCoordinator(DataUpdateCoordinator[PanelStatus]):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
hass: HomeAssistantType,
|
hass: HomeAssistant,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
username: str,
|
username: str,
|
||||||
password: str,
|
password: str,
|
||||||
|
|
|
@ -8,8 +8,8 @@ from elmax_api.model.panel import PanelStatus
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
|
||||||
|
|
||||||
from . import ElmaxCoordinator
|
from . import ElmaxCoordinator
|
||||||
from .common import ElmaxEntity
|
from .common import ElmaxEntity
|
||||||
|
@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistantType,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: AddEntitiesCallback,
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue