From c068024abe3b63fd995cce1a7ba2b84c19872e86 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 21 Nov 2022 08:18:37 +0100 Subject: [PATCH] Allow `None` return for notify `get_service` (#82444) --- homeassistant/components/notify/legacy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/notify/legacy.py b/homeassistant/components/notify/legacy.py index 0172fbc98d0..35c1bbe65bf 100644 --- a/homeassistant/components/notify/legacy.py +++ b/homeassistant/components/notify/legacy.py @@ -41,7 +41,7 @@ class LegacyNotifyPlatform(Protocol): hass: HomeAssistant, config: ConfigType, discovery_info: DiscoveryInfoType | None = ..., - ) -> BaseNotificationService: + ) -> BaseNotificationService | None: """Set up notification service.""" def get_service( @@ -49,7 +49,7 @@ class LegacyNotifyPlatform(Protocol): hass: HomeAssistant, config: ConfigType, discovery_info: DiscoveryInfoType | None = ..., - ) -> BaseNotificationService: + ) -> BaseNotificationService | None: """Set up notification service.""" @@ -82,7 +82,7 @@ def async_setup_legacy( full_name = f"{DOMAIN}.{integration_name}" LOGGER.info("Setting up %s", full_name) with async_start_setup(hass, [full_name]): - notify_service = None + notify_service: BaseNotificationService | None = None try: if hasattr(platform, "async_get_service"): notify_service = await platform.async_get_service(