diff --git a/homeassistant/components/asterisk_cdr/mailbox.py b/homeassistant/components/asterisk_cdr/mailbox.py index 28f48c7ab70..a826ca8e7ce 100644 --- a/homeassistant/components/asterisk_cdr/mailbox.py +++ b/homeassistant/components/asterisk_cdr/mailbox.py @@ -1,4 +1,6 @@ """Support for the Asterisk CDR interface.""" +from __future__ import annotations + import datetime import hashlib @@ -7,13 +9,18 @@ from homeassistant.components.asterisk_mbox import ( SIGNAL_CDR_UPDATE, ) from homeassistant.components.mailbox import Mailbox -from homeassistant.core import callback +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType MAILBOX_NAME = "asterisk_cdr" -async def async_get_handler(hass, config, discovery_info=None): +async def async_get_handler( + hass: HomeAssistant, + config: ConfigType, + discovery_info: DiscoveryInfoType | None = None, +) -> Mailbox | None: """Set up the Asterix CDR platform.""" return AsteriskCDR(hass, MAILBOX_NAME) diff --git a/homeassistant/components/asterisk_mbox/mailbox.py b/homeassistant/components/asterisk_mbox/mailbox.py index 62d817df9a3..7632203df4e 100644 --- a/homeassistant/components/asterisk_mbox/mailbox.py +++ b/homeassistant/components/asterisk_mbox/mailbox.py @@ -1,12 +1,15 @@ """Support for the Asterisk Voicemail interface.""" +from __future__ import annotations + from functools import partial import logging from asterisk_mbox import ServerError from homeassistant.components.mailbox import CONTENT_TYPE_MPEG, Mailbox, StreamError -from homeassistant.core import callback +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from . import DOMAIN as ASTERISK_DOMAIN @@ -16,7 +19,11 @@ SIGNAL_MESSAGE_REQUEST = "asterisk_mbox.message_request" SIGNAL_MESSAGE_UPDATE = "asterisk_mbox.message_updated" -async def async_get_handler(hass, config, discovery_info=None): +async def async_get_handler( + hass: HomeAssistant, + config: ConfigType, + discovery_info: DiscoveryInfoType | None = None, +) -> Mailbox | None: """Set up the Asterix VM platform.""" return AsteriskMailbox(hass, ASTERISK_DOMAIN)