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:
parent
49747684a0
commit
0c5ca3084e
9 changed files with 53 additions and 43 deletions
|
@ -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__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue