Fix service annotations (#31402)
* Fix service annotations * Filter area_id from service data * Fix services not accepting entities * Typo
This commit is contained in:
parent
81dbdc6b9c
commit
7687ac8b91
5 changed files with 78 additions and 29 deletions
|
@ -724,6 +724,8 @@ PLATFORM_SCHEMA = vol.Schema(
|
|||
|
||||
PLATFORM_SCHEMA_BASE = PLATFORM_SCHEMA.extend({}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
ENTITY_SERVICE_FIELDS = (ATTR_ENTITY_ID, ATTR_AREA_ID)
|
||||
|
||||
|
||||
def make_entity_service_schema(
|
||||
schema: dict, *, extra: int = vol.PREVENT_EXTRA
|
||||
|
@ -738,7 +740,7 @@ def make_entity_service_schema(
|
|||
},
|
||||
extra=extra,
|
||||
),
|
||||
has_at_least_one_key(ATTR_ENTITY_ID, ATTR_AREA_ID),
|
||||
has_at_least_one_key(*ENTITY_SERVICE_FIELDS),
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue