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>
pull/64051/head
epenet 2022-01-13 14:20:05 +01:00 committed by GitHub
parent 84552d2406
commit 7c0dc2ff1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1,9 +1,13 @@
"""Support for a demo mailbox."""
from __future__ import annotations
from hashlib import sha1
import logging
import os
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
_LOGGER = logging.getLogger(__name__)
@ -11,7 +15,11 @@ _LOGGER = logging.getLogger(__name__)
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."""
return DemoMailbox(hass, MAILBOX_NAME)