From fd4f6282b055bb24b569f2559378dfc862b5430e Mon Sep 17 00:00:00 2001 From: lymanepp <4195527+lymanepp@users.noreply.github.com> Date: Sun, 19 May 2024 20:28:42 -0400 Subject: [PATCH] Replace deprecated types (#101) --- custom_components/virtual/binary_sensor.py | 4 ++-- custom_components/virtual/cover.py | 4 ++-- custom_components/virtual/device_tracker.py | 4 ++-- custom_components/virtual/fan.py | 4 ++-- custom_components/virtual/light.py | 4 ++-- custom_components/virtual/lock.py | 6 +++--- custom_components/virtual/sensor.py | 4 ++-- custom_components/virtual/switch.py | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/custom_components/virtual/binary_sensor.py b/custom_components/virtual/binary_sensor.py index 64cd441..8efc585 100644 --- a/custom_components/virtual/binary_sensor.py +++ b/custom_components/virtual/binary_sensor.py @@ -14,8 +14,8 @@ ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ENTITY_ID, ATTR_DEVICE_CLASS, STATE_ON +from homeassistant.core import HomeAssistant from homeassistant.helpers.config_validation import PLATFORM_SCHEMA -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_from_domain, get_entity_configs from .const import * @@ -44,7 +44,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/cover.py b/custom_components/virtual/cover.py index ef42412..99f1c78 100644 --- a/custom_components/virtual/cover.py +++ b/custom_components/virtual/cover.py @@ -19,8 +19,8 @@ STATE_CLOSED, ) from homeassistant.config_entries import ConfigEntry +from homeassistant.core import HomeAssistant from homeassistant.helpers.config_validation import PLATFORM_SCHEMA -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_configs from .const import * @@ -42,7 +42,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/device_tracker.py b/custom_components/virtual/device_tracker.py index 2df9a16..8a81c29 100644 --- a/custom_components/virtual/device_tracker.py +++ b/custom_components/virtual/device_tracker.py @@ -15,8 +15,8 @@ ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ENTITY_ID +from homeassistant.core import HomeAssistant from homeassistant.helpers.config_validation import PLATFORM_SCHEMA -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_from_domain, get_entity_configs from .const import * @@ -43,7 +43,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/fan.py b/custom_components/virtual/fan.py index 8498f05..9850ea2 100644 --- a/custom_components/virtual/fan.py +++ b/custom_components/virtual/fan.py @@ -21,8 +21,8 @@ FanEntityFeature, ) from homeassistant.config_entries import ConfigEntry +from homeassistant.core import HomeAssistant from homeassistant.helpers.config_validation import (PLATFORM_SCHEMA) -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_configs from .const import * @@ -56,7 +56,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/light.py b/custom_components/virtual/light.py index 0056e0a..5a92fa7 100644 --- a/custom_components/virtual/light.py +++ b/custom_components/virtual/light.py @@ -27,8 +27,8 @@ ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import STATE_ON +from homeassistant.core import HomeAssistant from homeassistant.helpers.config_validation import PLATFORM_SCHEMA -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_configs from .const import * @@ -84,7 +84,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/lock.py b/custom_components/virtual/lock.py index 0696b8a..c07b54a 100644 --- a/custom_components/virtual/lock.py +++ b/custom_components/virtual/lock.py @@ -17,10 +17,10 @@ LockEntity, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.helpers.config_validation import PLATFORM_SCHEMA from homeassistant.const import STATE_LOCKED +from homeassistant.core import HomeAssistant +from homeassistant.helpers.config_validation import PLATFORM_SCHEMA from homeassistant.helpers.event import track_point_in_time -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_configs from .const import * @@ -49,7 +49,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/sensor.py b/custom_components/virtual/sensor.py index a23f8ab..56c4c29 100644 --- a/custom_components/virtual/sensor.py +++ b/custom_components/virtual/sensor.py @@ -34,8 +34,8 @@ UnitOfPressure, UnitOfVolume, ) +from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import Entity -from homeassistant.helpers.typing import HomeAssistantType from . import get_entity_from_domain, get_entity_configs from .const import * @@ -94,7 +94,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: diff --git a/custom_components/virtual/switch.py b/custom_components/virtual/switch.py index 7ef6f5f..a323a25 100644 --- a/custom_components/virtual/switch.py +++ b/custom_components/virtual/switch.py @@ -19,7 +19,7 @@ ATTR_DEVICE_CLASS, STATE_ON, ) -from homeassistant.helpers.typing import HomeAssistantType +from homeassistant.core import HomeAssistant from . import get_entity_configs from .const import * @@ -41,7 +41,7 @@ async def async_setup_entry( - hass: HomeAssistantType, + hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable[[list], None], ) -> None: