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:
Erik Montnemery 2023-07-14 14:55:17 +02:00 committed by GitHub
parent 3b32dcb613
commit 614f3c6a15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 159 additions and 126 deletions

View file

@ -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."""