mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Adjust notify type hints in mysensors (#77647)
This commit is contained in:
parent
8dda2389c8
commit
6f8b032a6e
@ -1,11 +1,12 @@
|
|||||||
"""MySensors notification service."""
|
"""MySensors notification service."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any, cast
|
||||||
|
|
||||||
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
|
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from .. import mysensors
|
from .. import mysensors
|
||||||
from .const import DevId, DiscoveryInfo
|
from .const import DevId, DiscoveryInfo
|
||||||
@ -13,15 +14,18 @@ from .const import DevId, DiscoveryInfo
|
|||||||
|
|
||||||
async def async_get_service(
|
async def async_get_service(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: dict[str, Any],
|
config: ConfigType,
|
||||||
discovery_info: DiscoveryInfo | None = None,
|
discovery_info: DiscoveryInfoType | None = None,
|
||||||
) -> BaseNotificationService | None:
|
) -> BaseNotificationService | None:
|
||||||
"""Get the MySensors notification service."""
|
"""Get the MySensors notification service."""
|
||||||
if not discovery_info:
|
if not discovery_info:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
new_devices = mysensors.setup_mysensors_platform(
|
new_devices = mysensors.setup_mysensors_platform(
|
||||||
hass, Platform.NOTIFY, discovery_info, MySensorsNotificationDevice
|
hass,
|
||||||
|
Platform.NOTIFY,
|
||||||
|
cast(DiscoveryInfo, discovery_info),
|
||||||
|
MySensorsNotificationDevice,
|
||||||
)
|
)
|
||||||
if not new_devices:
|
if not new_devices:
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user