Move device info validation to device registry (#96465)
* Move device info validation to device registry * Don't move DeviceInfo * Fix type annotation * Don't block adding device for unknown config entry * Fix test * Remove use of locals() * Improve error message
This commit is contained in:
parent
3b32dcb613
commit
614f3c6a15
6 changed files with 159 additions and 126 deletions
|
@ -191,21 +191,6 @@ class MaxLengthExceeded(HomeAssistantError):
|
|||
self.max_length = max_length
|
||||
|
||||
|
||||
class RequiredParameterMissing(HomeAssistantError):
|
||||
"""Raised when a required parameter is missing from a function call."""
|
||||
|
||||
def __init__(self, parameter_names: list[str]) -> None:
|
||||
"""Initialize error."""
|
||||
super().__init__(
|
||||
self,
|
||||
(
|
||||
"Call must include at least one of the following parameters: "
|
||||
f"{', '.join(parameter_names)}"
|
||||
),
|
||||
)
|
||||
self.parameter_names = parameter_names
|
||||
|
||||
|
||||
class DependencyError(HomeAssistantError):
|
||||
"""Raised when dependencies cannot be setup."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue