mirror of
https://github.com/Andre0512/hon.git
synced 2025-08-03 23:31:15 +00:00
Merge pull request #1 from IoTLabs-pl/Fix-HA-deprecated-alias-warning
Fix HA deprecated alias warning
This commit is contained in:
commit
0d3033faf5
|
@ -3,10 +3,10 @@ from pathlib import Path
|
|||
from typing import Any
|
||||
|
||||
import voluptuous as vol # type: ignore[import-untyped]
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
||||
from homeassistant.helpers import config_validation as cv, aiohttp_client
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from pyhon import Hon
|
||||
|
||||
|
@ -27,7 +27,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
session = aiohttp_client.async_get_clientsession(hass)
|
||||
if (config_dir := hass.config.config_dir) is None:
|
||||
raise ValueError("Missing Config Dir")
|
||||
|
@ -60,7 +60,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:
|
||||
refresh_token = hass.data[DOMAIN][entry.unique_id]["hon"].api.auth.refresh_token
|
||||
|
||||
hass.config_entries.async_update_entry(
|
||||
|
|
|
@ -7,9 +7,8 @@ from homeassistant.components.binary_sensor import (
|
|||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from .const import DOMAIN
|
||||
from .entity import HonEntity
|
||||
|
@ -317,7 +316,7 @@ BINARY_SENSORS["WD"] = unique_entities(BINARY_SENSORS["WM"], BINARY_SENSORS["TD"
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
|
||||
|
|
|
@ -4,9 +4,9 @@ from pathlib import Path
|
|||
from homeassistant.components import persistent_notification
|
||||
from homeassistant.components.button import ButtonEntityDescription, ButtonEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.appliance import HonAppliance
|
||||
|
||||
from .const import DOMAIN
|
||||
|
@ -56,7 +56,7 @@ BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = {
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities: list[HonButtonType] = []
|
||||
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
|
||||
|
@ -88,7 +88,7 @@ class HonButtonEntity(HonEntity, ButtonEntity):
|
|||
|
||||
class HonDeviceInfo(HonEntity, ButtonEntity):
|
||||
def __init__(
|
||||
self, hass: HomeAssistantType, entry: ConfigEntry, device: HonAppliance
|
||||
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
|
||||
) -> None:
|
||||
super().__init__(hass, entry, device)
|
||||
|
||||
|
@ -108,7 +108,7 @@ class HonDeviceInfo(HonEntity, ButtonEntity):
|
|||
|
||||
class HonDataArchive(HonEntity, ButtonEntity):
|
||||
def __init__(
|
||||
self, hass: HomeAssistantType, entry: ConfigEntry, device: HonAppliance
|
||||
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
|
||||
) -> None:
|
||||
super().__init__(hass, entry, device)
|
||||
|
||||
|
|
|
@ -19,9 +19,8 @@ from homeassistant.const import (
|
|||
ATTR_TEMPERATURE,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.appliance import HonAppliance
|
||||
from pyhon.parameter.range import HonParameterRange
|
||||
|
||||
|
@ -104,7 +103,7 @@ CLIMATES: dict[
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
entity: HonClimateEntity | HonACClimateEntity
|
||||
|
@ -130,7 +129,7 @@ class HonACClimateEntity(HonEntity, ClimateEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: HonACClimateEntityDescription,
|
||||
|
@ -299,7 +298,7 @@ class HonClimateEntity(HonEntity, ClimateEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: HonClimateEntityDescription,
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from typing import Optional, Any
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.helpers.update_coordinator import (
|
||||
CoordinatorEntity,
|
||||
)
|
||||
|
@ -20,7 +19,7 @@ class HonEntity(CoordinatorEntity[DataUpdateCoordinator[dict[str, Any]]]):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: Optional[HonEntityDescription] = None,
|
||||
|
|
|
@ -8,9 +8,8 @@ from homeassistant.components.fan import (
|
|||
FanEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.util.percentage import (
|
||||
percentage_to_ranged_value,
|
||||
ranged_value_to_percentage,
|
||||
|
@ -36,7 +35,7 @@ FANS: dict[str, tuple[FanEntityDescription, ...]] = {
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
|
||||
|
@ -56,7 +55,7 @@ class HonFanEntity(HonEntity, FanEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: FanEntityDescription,
|
||||
|
|
|
@ -8,9 +8,8 @@ from homeassistant.components.light import (
|
|||
ATTR_BRIGHTNESS,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.appliance import HonAppliance
|
||||
from pyhon.parameter.range import HonParameterRange
|
||||
|
||||
|
@ -53,7 +52,7 @@ LIGHTS: dict[str, tuple[LightEntityDescription, ...]] = {
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
|
||||
|
@ -73,7 +72,7 @@ class HonLightEntity(HonEntity, LightEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: LightEntityDescription,
|
||||
|
|
|
@ -3,9 +3,8 @@ from typing import Any
|
|||
|
||||
from homeassistant.components.lock import LockEntity, LockEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.parameter.base import HonParameter
|
||||
from pyhon.parameter.range import HonParameterRange
|
||||
|
||||
|
@ -26,7 +25,7 @@ LOCKS: dict[str, tuple[LockEntityDescription, ...]] = {
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"iot_class": "cloud_push",
|
||||
"issue_tracker": "https://github.com/Andre0512/hon/issues",
|
||||
"requirements": [
|
||||
"pyhOn==0.17.4"
|
||||
"pyhOn @ git+https://github.com/IoTLabs-pl/pyhOn@v0.17.5"
|
||||
],
|
||||
"version": "0.14.0-beta.7"
|
||||
"version": "0.14.0-beta.8"
|
||||
}
|
||||
|
|
|
@ -8,10 +8,9 @@ from homeassistant.components.number import (
|
|||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import UnitOfTime, UnitOfTemperature
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.appliance import HonAppliance
|
||||
from pyhon.parameter.range import HonParameterRange
|
||||
|
||||
|
@ -207,7 +206,7 @@ NUMBERS["WD"] = unique_entities(NUMBERS["WM"], NUMBERS["TD"])
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
entity: HonNumberEntity | HonConfigNumberEntity
|
||||
|
@ -230,7 +229,7 @@ class HonNumberEntity(HonEntity, NumberEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: HonNumberEntityDescription,
|
||||
|
@ -285,7 +284,7 @@ class HonConfigNumberEntity(HonEntity, NumberEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistantType,
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
device: HonAppliance,
|
||||
description: HonConfigNumberEntityDescription,
|
||||
|
|
|
@ -6,10 +6,9 @@ from dataclasses import dataclass
|
|||
from homeassistant.components.select import SelectEntity, SelectEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import UnitOfTemperature, UnitOfTime, REVOLUTIONS_PER_MINUTE
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from . import const
|
||||
from .const import DOMAIN
|
||||
|
@ -211,7 +210,7 @@ SELECTS["WD"] = unique_entities(SELECTS["WM"], SELECTS["TD"])
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
entity: HonSelectEntity | HonConfigSelectEntity
|
||||
|
|
|
@ -21,10 +21,9 @@ from homeassistant.const import (
|
|||
UnitOfTime,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from . import const
|
||||
from .const import DOMAIN
|
||||
|
@ -808,7 +807,7 @@ SENSORS["WD"] = unique_entities(SENSORS["WM"], SENSORS["TD"])
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
entity: HonSensorEntity | HonConfigSensorEntity
|
||||
|
|
|
@ -5,10 +5,9 @@ from typing import Any
|
|||
|
||||
from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from pyhon.parameter.base import HonParameter
|
||||
from pyhon.parameter.range import HonParameterRange
|
||||
|
||||
|
@ -403,7 +402,7 @@ SWITCHES["WD"] = unique_entities(SWITCHES["WD"], SWITCHES["TD"])
|
|||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
entities = []
|
||||
entity: HonConfigSwitchEntity | HonControlSwitchEntity | HonSwitchEntity
|
||||
|
|
|
@ -1 +1 @@
|
|||
pyhOn==0.17.3
|
||||
pyhOn @ git+https://github.com/IoTLabs-pl/pyhOn@v0.17.5
|
||||
|
|
Loading…
Reference in a new issue