Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
+11
-10
@@ -25,8 +25,7 @@ class TemplateError(HomeAssistantError):
|
||||
|
||||
def __init__(self, exception: jinja2.TemplateError) -> None:
|
||||
"""Init the error."""
|
||||
super().__init__('{}: {}'.format(exception.__class__.__name__,
|
||||
exception))
|
||||
super().__init__("{}: {}".format(exception.__class__.__name__, exception))
|
||||
|
||||
|
||||
class PlatformNotReady(HomeAssistantError):
|
||||
@@ -44,12 +43,15 @@ class InvalidStateError(HomeAssistantError):
|
||||
class Unauthorized(HomeAssistantError):
|
||||
"""When an action is unauthorized."""
|
||||
|
||||
def __init__(self, context: Optional['Context'] = None,
|
||||
user_id: Optional[str] = None,
|
||||
entity_id: Optional[str] = None,
|
||||
config_entry_id: Optional[str] = None,
|
||||
perm_category: Optional[str] = None,
|
||||
permission: Optional[Tuple[str]] = None) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
context: Optional["Context"] = None,
|
||||
user_id: Optional[str] = None,
|
||||
entity_id: Optional[str] = None,
|
||||
config_entry_id: Optional[str] = None,
|
||||
perm_category: Optional[str] = None,
|
||||
permission: Optional[Tuple[str]] = None,
|
||||
) -> None:
|
||||
"""Unauthorized error."""
|
||||
super().__init__(self.__class__.__name__)
|
||||
self.context = context
|
||||
@@ -71,8 +73,7 @@ class ServiceNotFound(HomeAssistantError):
|
||||
|
||||
def __init__(self, domain: str, service: str) -> None:
|
||||
"""Initialize error."""
|
||||
super().__init__(
|
||||
self, "Service {}.{} not found".format(domain, service))
|
||||
super().__init__(self, "Service {}.{} not found".format(domain, service))
|
||||
self.domain = domain
|
||||
self.service = service
|
||||
|
||||
|
||||
Reference in new issue
Block a user