Support None schema in EntityComponent.async_register_entity_service (#123867)
This commit is contained in:
parent
7063541733
commit
e1a0a855d5
2 changed files with 22 additions and 12 deletions
|
@ -258,13 +258,13 @@ class EntityComponent(Generic[_EntityT]):
|
|||
def async_register_entity_service(
|
||||
self,
|
||||
name: str,
|
||||
schema: VolDictType | VolSchemaType,
|
||||
schema: VolDictType | VolSchemaType | None,
|
||||
func: str | Callable[..., Any],
|
||||
required_features: list[int] | None = None,
|
||||
supports_response: SupportsResponse = SupportsResponse.NONE,
|
||||
) -> None:
|
||||
"""Register an entity service."""
|
||||
if isinstance(schema, dict):
|
||||
if schema is None or isinstance(schema, dict):
|
||||
schema = cv.make_entity_service_schema(schema)
|
||||
|
||||
service_func: str | HassJob[..., Any]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue