mirror of
https://github.com/Andre0512/hon.git
synced 2026-07-04 09:42:44 +02:00
Remove deprecated typing and fix thread safety issue
This commit is contained in:
@@ -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,
|
||||
@@ -125,7 +124,7 @@ class HonFanEntity(HonEntity, FanEntity):
|
||||
)
|
||||
self._attr_percentage = self.percentage
|
||||
if update:
|
||||
self.async_write_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user