mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Allow None
return for notify get_service
(#82444)
This commit is contained in:
parent
d2000f0c7a
commit
c068024abe
@ -41,7 +41,7 @@ class LegacyNotifyPlatform(Protocol):
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: ConfigType,
|
config: ConfigType,
|
||||||
discovery_info: DiscoveryInfoType | None = ...,
|
discovery_info: DiscoveryInfoType | None = ...,
|
||||||
) -> BaseNotificationService:
|
) -> BaseNotificationService | None:
|
||||||
"""Set up notification service."""
|
"""Set up notification service."""
|
||||||
|
|
||||||
def get_service(
|
def get_service(
|
||||||
@ -49,7 +49,7 @@ class LegacyNotifyPlatform(Protocol):
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: ConfigType,
|
config: ConfigType,
|
||||||
discovery_info: DiscoveryInfoType | None = ...,
|
discovery_info: DiscoveryInfoType | None = ...,
|
||||||
) -> BaseNotificationService:
|
) -> BaseNotificationService | None:
|
||||||
"""Set up notification service."""
|
"""Set up notification service."""
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ def async_setup_legacy(
|
|||||||
full_name = f"{DOMAIN}.{integration_name}"
|
full_name = f"{DOMAIN}.{integration_name}"
|
||||||
LOGGER.info("Setting up %s", full_name)
|
LOGGER.info("Setting up %s", full_name)
|
||||||
with async_start_setup(hass, [full_name]):
|
with async_start_setup(hass, [full_name]):
|
||||||
notify_service = None
|
notify_service: BaseNotificationService | None = None
|
||||||
try:
|
try:
|
||||||
if hasattr(platform, "async_get_service"):
|
if hasattr(platform, "async_get_service"):
|
||||||
notify_service = await platform.async_get_service(
|
notify_service = await platform.async_get_service(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user