Add missing type annotations to ReCollect Waste (#52600)
This commit is contained in:
parent
f44a13970a
commit
aa022d4c52
3 changed files with 17 additions and 7 deletions
|
@ -58,7 +58,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
async def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
async def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Handle an options update."""
|
||||
await hass.config_entries.async_reload(entry.entry_id)
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
"""Config flow for ReCollect Waste integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from aiorecollect.client import Client
|
||||
from aiorecollect.errors import RecollectError
|
||||
import voluptuous as vol
|
||||
|
@ -8,6 +10,7 @@ import voluptuous as vol
|
|||
from homeassistant import config_entries
|
||||
from homeassistant.const import CONF_FRIENDLY_NAME
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.data_entry_flow import FlowResult
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
|
||||
from .const import CONF_PLACE_ID, CONF_SERVICE_ID, DOMAIN, LOGGER
|
||||
|
@ -30,11 +33,15 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
"""Define the config flow to handle options."""
|
||||
return RecollectWasteOptionsFlowHandler(config_entry)
|
||||
|
||||
async def async_step_import(self, import_config: dict = None) -> dict:
|
||||
async def async_step_import(
|
||||
self, import_config: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
"""Handle configuration via YAML import."""
|
||||
return await self.async_step_user(import_config)
|
||||
|
||||
async def async_step_user(self, user_input: dict = None) -> dict:
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
"""Handle configuration via the UI."""
|
||||
if user_input is None:
|
||||
return self.async_show_form(
|
||||
|
@ -77,7 +84,9 @@ class RecollectWasteOptionsFlowHandler(config_entries.OptionsFlow):
|
|||
"""Initialize."""
|
||||
self._entry = entry
|
||||
|
||||
async def async_step_init(self, user_input: dict | None = None):
|
||||
async def async_step_init(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> FlowResult:
|
||||
"""Manage the options."""
|
||||
if user_input is not None:
|
||||
return self.async_create_entry(title="", data=user_input)
|
||||
|
|
|
@ -15,6 +15,7 @@ from homeassistant.const import (
|
|||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.helpers.update_coordinator import (
|
||||
CoordinatorEntity,
|
||||
DataUpdateCoordinator,
|
||||
|
@ -55,10 +56,10 @@ def async_get_pickup_type_names(
|
|||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: dict,
|
||||
config: ConfigType,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
discovery_info: dict = None,
|
||||
):
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Import Recollect Waste configuration from YAML."""
|
||||
LOGGER.warning(
|
||||
"Loading ReCollect Waste via platform setup is deprecated; "
|
||||
|
|
Loading…
Add table
Reference in a new issue