mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add typing to async_get_handler in demo (#64029)
Co-authored-by: Franck Nijhof <git@frenck.dev> Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
84552d2406
commit
7c0dc2ff1f
@ -1,9 +1,13 @@
|
|||||||
"""Support for a demo mailbox."""
|
"""Support for a demo mailbox."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from homeassistant.components.mailbox import CONTENT_TYPE_MPEG, Mailbox, StreamError
|
from homeassistant.components.mailbox import CONTENT_TYPE_MPEG, Mailbox, StreamError
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util import dt
|
from homeassistant.util import dt
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -11,7 +15,11 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
MAILBOX_NAME = "DemoMailbox"
|
MAILBOX_NAME = "DemoMailbox"
|
||||||
|
|
||||||
|
|
||||||
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:
|
||||||
"""Set up the Demo mailbox."""
|
"""Set up the Demo mailbox."""
|
||||||
return DemoMailbox(hass, MAILBOX_NAME)
|
return DemoMailbox(hass, MAILBOX_NAME)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user