Add hints to get_service in integrations (1/2) (#86692)

This commit is contained in:
epenet 2023-01-26 16:56:57 +01:00 committed by GitHub
parent 0d579f6ac3
commit 2bef69c6a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 143 additions and 17 deletions

View file

@ -1,4 +1,6 @@
"""Support for iOS push notifications."""
from __future__ import annotations
from http import HTTPStatus
import logging
@ -12,6 +14,8 @@ from homeassistant.components.notify import (
ATTR_TITLE_DEFAULT,
BaseNotificationService,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
import homeassistant.util.dt as dt_util
from .. import ios
@ -43,7 +47,11 @@ def log_rate_limits(hass, target, resp, level=20):
)
def get_service(hass, config, discovery_info=None):
def get_service(
hass: HomeAssistant,
config: ConfigType,
discovery_info: DiscoveryInfoType | None = None,
) -> iOSNotificationService | None:
"""Get the iOS notification service."""
if "notify.ios" not in hass.config.components:
# Need this to enable requirements checking in the app.