mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add basic type hints to zwave_me (#69322)
This commit is contained in:
parent
e5c1cc35e1
commit
ad98bedd4a
@ -17,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
ZWAVE_ME_PLATFORMS = [platform.value for platform in ZWaveMePlatform]
|
ZWAVE_ME_PLATFORMS = [platform.value for platform in ZWaveMePlatform]
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, entry):
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up Z-Wave-Me from a config entry."""
|
"""Set up Z-Wave-Me from a config entry."""
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
controller = hass.data[DOMAIN][entry.entry_id] = ZWaveMeController(hass, entry)
|
controller = hass.data[DOMAIN][entry.entry_id] = ZWaveMeController(hass, entry)
|
||||||
@ -27,7 +27,7 @@ async def async_setup_entry(hass, entry):
|
|||||||
raise ConfigEntryNotReady()
|
raise ConfigEntryNotReady()
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass, entry):
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
|
|
||||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.button import ButtonEntity
|
from homeassistant.components.button import ButtonEntity
|
||||||
from homeassistant.core import callback
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ZWaveMeEntity
|
from . import ZWaveMeEntity
|
||||||
from .const import DOMAIN, ZWaveMePlatform
|
from .const import DOMAIN, ZWaveMePlatform
|
||||||
@ -11,7 +13,11 @@ from .const import DOMAIN, ZWaveMePlatform
|
|||||||
DEVICE_NAME = ZWaveMePlatform.BUTTON
|
DEVICE_NAME = ZWaveMePlatform.BUTTON
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the number platform."""
|
"""Set up the number platform."""
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -10,8 +10,10 @@ from homeassistant.components.cover import (
|
|||||||
SUPPORT_SET_POSITION,
|
SUPPORT_SET_POSITION,
|
||||||
CoverEntity,
|
CoverEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ZWaveMeEntity
|
from . import ZWaveMeEntity
|
||||||
from .const import DOMAIN, ZWaveMePlatform
|
from .const import DOMAIN, ZWaveMePlatform
|
||||||
@ -19,7 +21,11 @@ from .const import DOMAIN, ZWaveMePlatform
|
|||||||
DEVICE_NAME = ZWaveMePlatform.COVER
|
DEVICE_NAME = ZWaveMePlatform.COVER
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the cover platform."""
|
"""Set up the cover platform."""
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
"""Representation of a switchMultilevel."""
|
"""Representation of a switchMultilevel."""
|
||||||
from homeassistant.components.number import NumberEntity
|
from homeassistant.components.number import NumberEntity
|
||||||
from homeassistant.core import callback
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ZWaveMeEntity
|
from . import ZWaveMeEntity
|
||||||
from .const import DOMAIN, ZWaveMePlatform
|
from .const import DOMAIN, ZWaveMePlatform
|
||||||
@ -9,7 +11,11 @@ from .const import DOMAIN, ZWaveMePlatform
|
|||||||
DEVICE_NAME = ZWaveMePlatform.NUMBER
|
DEVICE_NAME = ZWaveMePlatform.NUMBER
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the number platform."""
|
"""Set up the number platform."""
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.siren import SirenEntity
|
from homeassistant.components.siren import SirenEntity
|
||||||
from homeassistant.core import callback
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ZWaveMeEntity
|
from . import ZWaveMeEntity
|
||||||
from .const import DOMAIN, ZWaveMePlatform
|
from .const import DOMAIN, ZWaveMePlatform
|
||||||
@ -11,7 +13,11 @@ from .const import DOMAIN, ZWaveMePlatform
|
|||||||
DEVICE_NAME = ZWaveMePlatform.SIREN
|
DEVICE_NAME = ZWaveMePlatform.SIREN
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the siren platform."""
|
"""Set up the siren platform."""
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -7,8 +7,10 @@ from homeassistant.components.switch import (
|
|||||||
SwitchEntity,
|
SwitchEntity,
|
||||||
SwitchEntityDescription,
|
SwitchEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import ZWaveMeEntity
|
from . import ZWaveMeEntity
|
||||||
from .const import DOMAIN, ZWaveMePlatform
|
from .const import DOMAIN, ZWaveMePlatform
|
||||||
@ -24,7 +26,11 @@ SWITCH_MAP: dict[str, SwitchEntityDescription] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the switch platform."""
|
"""Set up the switch platform."""
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user