Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow None return for notify get_service #82444

Merged
merged 1 commit into from Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions homeassistant/components/notify/legacy.py
Expand Up @@ -41,15 +41,15 @@ async def async_get_service(
hass: HomeAssistant,
config: ConfigType,
discovery_info: DiscoveryInfoType | None = ...,
) -> BaseNotificationService:
) -> BaseNotificationService | None:
"""Set up notification service."""

def get_service(
self,
hass: HomeAssistant,
config: ConfigType,
discovery_info: DiscoveryInfoType | None = ...,
) -> BaseNotificationService:
) -> BaseNotificationService | None:
"""Set up notification service."""


Expand Down Expand Up @@ -82,7 +82,7 @@ async def async_setup_platform(
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(
Expand Down