Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions homeassistant/components/asterisk_cdr/mailbox.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Support for the Asterisk CDR interface."""
from __future__ import annotations

import datetime
import hashlib

Expand All @@ -7,13 +9,18 @@
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)

Expand Down
11 changes: 9 additions & 2 deletions homeassistant/components/asterisk_mbox/mailbox.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -16,7 +19,11 @@
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)

Expand Down