Add setup type hints to mailboxes (#63975)
* Add setup type hints to asterisk_cdr mailbox * Add setup type hints to asterisk_mbox mailbox Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
296ebc08c0
commit
bcd2ec977d
2 changed files with 18 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
||||||
"""Support for the Asterisk CDR interface."""
|
"""Support for the Asterisk CDR interface."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
@ -7,13 +9,18 @@ from homeassistant.components.asterisk_mbox import (
|
||||||
SIGNAL_CDR_UPDATE,
|
SIGNAL_CDR_UPDATE,
|
||||||
)
|
)
|
||||||
from homeassistant.components.mailbox import Mailbox
|
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.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
MAILBOX_NAME = "asterisk_cdr"
|
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."""
|
"""Set up the Asterix CDR platform."""
|
||||||
return AsteriskCDR(hass, MAILBOX_NAME)
|
return AsteriskCDR(hass, MAILBOX_NAME)
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
"""Support for the Asterisk Voicemail interface."""
|
"""Support for the Asterisk Voicemail interface."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from asterisk_mbox import ServerError
|
from asterisk_mbox import ServerError
|
||||||
|
|
||||||
from homeassistant.components.mailbox import CONTENT_TYPE_MPEG, Mailbox, StreamError
|
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.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from . import DOMAIN as ASTERISK_DOMAIN
|
from . import DOMAIN as ASTERISK_DOMAIN
|
||||||
|
|
||||||
|
@ -16,7 +19,11 @@ SIGNAL_MESSAGE_REQUEST = "asterisk_mbox.message_request"
|
||||||
SIGNAL_MESSAGE_UPDATE = "asterisk_mbox.message_updated"
|
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."""
|
"""Set up the Asterix VM platform."""
|
||||||
return AsteriskMailbox(hass, ASTERISK_DOMAIN)
|
return AsteriskMailbox(hass, ASTERISK_DOMAIN)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue