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
+3 -3
View File
@@ -6,8 +6,8 @@ import voluptuous as vol # type: ignore[import-untyped]
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 homeassistant.core import HomeAssistant
from pyhon import Hon
from .const import DOMAIN, PLATFORMS, MOBILE_ID, CONF_REFRESH_TOKEN
@@ -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(