ConfigType and async_setup/setup type hint improvements (#54739)
This commit is contained in:
parent
dcb2a211e5
commit
939fde0a50
63 changed files with 114 additions and 71 deletions
|
@ -1,8 +1,6 @@
|
|||
"""The NEW_NAME integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -13,6 +11,7 @@ from homeassistant.helpers import (
|
|||
config_entry_oauth2_flow,
|
||||
config_validation as cv,
|
||||
)
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from . import api, config_flow
|
||||
from .const import DOMAIN, OAUTH2_AUTHORIZE, OAUTH2_TOKEN
|
||||
|
@ -34,7 +33,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
PLATFORMS = ["light"]
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool:
|
||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the NEW_NAME component."""
|
||||
hass.data[DOMAIN] = {}
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
"""The NEW_NAME integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({vol.Optional(DOMAIN): {}}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool:
|
||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the NEW_NAME integration."""
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue