mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add missing type annotations to ReCollect Waste (#52600)
This commit is contained in:
parent
f44a13970a
commit
aa022d4c52
@ -58,7 +58,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
return True
|
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."""
|
"""Handle an options update."""
|
||||||
await hass.config_entries.async_reload(entry.entry_id)
|
await hass.config_entries.async_reload(entry.entry_id)
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
"""Config flow for ReCollect Waste integration."""
|
"""Config flow for ReCollect Waste integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from aiorecollect.client import Client
|
from aiorecollect.client import Client
|
||||||
from aiorecollect.errors import RecollectError
|
from aiorecollect.errors import RecollectError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -8,6 +10,7 @@ import voluptuous as vol
|
|||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_FRIENDLY_NAME
|
from homeassistant.const import CONF_FRIENDLY_NAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
from homeassistant.helpers import aiohttp_client
|
from homeassistant.helpers import aiohttp_client
|
||||||
|
|
||||||
from .const import CONF_PLACE_ID, CONF_SERVICE_ID, DOMAIN, LOGGER
|
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."""
|
"""Define the config flow to handle options."""
|
||||||
return RecollectWasteOptionsFlowHandler(config_entry)
|
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."""
|
"""Handle configuration via YAML import."""
|
||||||
return await self.async_step_user(import_config)
|
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."""
|
"""Handle configuration via the UI."""
|
||||||
if user_input is None:
|
if user_input is None:
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
@ -77,7 +84,9 @@ class RecollectWasteOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self._entry = entry
|
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."""
|
"""Manage the options."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
return self.async_create_entry(title="", data=user_input)
|
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.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
DataUpdateCoordinator,
|
DataUpdateCoordinator,
|
||||||
@ -55,10 +56,10 @@ def async_get_pickup_type_names(
|
|||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: dict,
|
config: ConfigType,
|
||||||
async_add_entities: AddEntitiesCallback,
|
async_add_entities: AddEntitiesCallback,
|
||||||
discovery_info: dict = None,
|
discovery_info: DiscoveryInfoType | None = None,
|
||||||
):
|
) -> None:
|
||||||
"""Import Recollect Waste configuration from YAML."""
|
"""Import Recollect Waste configuration from YAML."""
|
||||||
LOGGER.warning(
|
LOGGER.warning(
|
||||||
"Loading ReCollect Waste via platform setup is deprecated; "
|
"Loading ReCollect Waste via platform setup is deprecated; "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user