Remove deprecated typing and fix thread safety issue

This commit is contained in:
Niek Schoemaker
2024-12-29 21:03:40 +01:00
parent 70eb6c0111
commit 6ffb7a4901
12 changed files with 53 additions and 56 deletions
+4 -5
View File
@@ -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
@@ -271,7 +270,7 @@ class HonConfigSelectEntity(HonEntity, SelectEntity):
self._attr_options = self.options
self._attr_current_option = self.current_option
if update:
self.async_write_ha_state()
self.schedule_update_ha_state()
@property
def available(self) -> bool:
@@ -334,4 +333,4 @@ class HonSelectEntity(HonEntity, SelectEntity):
self._attr_options = self.options
self._attr_current_option = self.current_option
if update:
self.async_write_ha_state()
self.schedule_update_ha_state()