Type hint additions (#26831)

* Type hint additions

* Remove optional from sidebar_icon comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Remove optional from sidebar_title comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Fix issues after rebase and mypy 0.730
This commit is contained in:
Ville Skyttä 2019-09-29 20:07:49 +03:00 committed by GitHub
parent 4f55235aa2
commit f259ff17d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 184 additions and 68 deletions

View file

@ -2,6 +2,7 @@
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.auth.models import RefreshToken, User
from homeassistant.auth.providers import legacy_api_password
from homeassistant.components.http.ban import process_wrong_login, process_success_login
from homeassistant.const import __version__
@ -9,6 +10,9 @@ from homeassistant.const import __version__
from .connection import ActiveConnection
from .error import Disconnect
# mypy: allow-untyped-calls, allow-untyped-defs
TYPE_AUTH = "auth"
TYPE_AUTH_INVALID = "auth_invalid"
TYPE_AUTH_OK = "auth_ok"
@ -87,7 +91,9 @@ class AuthPhase:
await process_wrong_login(self._request)
raise Disconnect
async def _async_finish_auth(self, user, refresh_token) -> ActiveConnection:
async def _async_finish_auth(
self, user: User, refresh_token: RefreshToken
) -> ActiveConnection:
"""Create an active connection."""
self._logger.debug("Auth OK")
await process_success_login(self._request)