Add and fix type hints (#36501)

* Fix exceptions.Unauthorized.permission type

* Use auth.permission consts more

* Auth typing improvements

* Helpers typing improvements

* Calculate self.state only once
This commit is contained in:
Ville Skyttä 2020-06-06 21:34:56 +03:00 committed by GitHub
parent 49747684a0
commit 0c5ca3084e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 43 deletions

View file

@ -1,5 +1,5 @@
"""The exceptions used by Home Assistant."""
from typing import TYPE_CHECKING, Optional, Tuple
from typing import TYPE_CHECKING, Optional
import jinja2
@ -49,7 +49,7 @@ class Unauthorized(HomeAssistantError):
entity_id: Optional[str] = None,
config_entry_id: Optional[str] = None,
perm_category: Optional[str] = None,
permission: Optional[Tuple[str]] = None,
permission: Optional[str] = None,
) -> None:
"""Unauthorized error."""
super().__init__(self.__class__.__name__)