mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Black
This commit is contained in:
@@ -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