mirror of
https://github.com/Andre0512/hon.git
synced 2026-07-04 08:22:44 +02:00
Remove deprecated typing and fix thread safety issue
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user