Fix lock services not removing entity fields (#88805)
This commit is contained in:
parent
0f01866508
commit
bea81d3f63
2 changed files with 15 additions and 8 deletions
|
@ -513,6 +513,16 @@ async def async_get_all_descriptions(
|
|||
return descriptions
|
||||
|
||||
|
||||
@callback
|
||||
def remove_entity_service_fields(call: ServiceCall) -> dict[Any, Any]:
|
||||
"""Remove entity service fields."""
|
||||
return {
|
||||
key: val
|
||||
for key, val in call.data.items()
|
||||
if key not in cv.ENTITY_SERVICE_FIELDS
|
||||
}
|
||||
|
||||
|
||||
@callback
|
||||
@bind_hass
|
||||
def async_set_service_schema(
|
||||
|
@ -567,11 +577,7 @@ async def entity_service_call( # noqa: C901
|
|||
|
||||
# If the service function is a string, we'll pass it the service call data
|
||||
if isinstance(func, str):
|
||||
data: dict | ServiceCall = {
|
||||
key: val
|
||||
for key, val in call.data.items()
|
||||
if key not in cv.ENTITY_SERVICE_FIELDS
|
||||
}
|
||||
data: dict | ServiceCall = remove_entity_service_fields(call)
|
||||
# If the service function is not a string, we pass the service call
|
||||
else:
|
||||
data = call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue