From f5f51fa125040ad3e1bf874ae9451559d0f8494b Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 12 Sep 2024 12:21:35 +0200 Subject: [PATCH] Clarify blog post about entity service action schema changes (#2316) * Clarify blog post about entity service action schema changes * Update blog/2024-08-27-entity-service-schema-validation.md Co-authored-by: Martin Hjelmare --------- Co-authored-by: Martin Hjelmare --- blog/2024-08-27-entity-service-schema-validation.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blog/2024-08-27-entity-service-schema-validation.md b/blog/2024-08-27-entity-service-schema-validation.md index 4e91405c..3e4927a0 100644 --- a/blog/2024-08-27-entity-service-schema-validation.md +++ b/blog/2024-08-27-entity-service-schema-validation.md @@ -4,14 +4,18 @@ authorURL: https://github.com/emontnemery title: "Validation of entity action schemas" --- -A warning will now be logged when registering an entity action with a custom schema which does not meet at least one of these criteria: +Registering entity service actions allows integration authors to pass in: +- No schema (`None`) +- A dictionary, which will be converted to a voluptuous schema by passing it to `cv.make_entity_service_schema` +- A custom voluptuous schema + +For the third case, a warning will now be logged when registering an entity action with a custom schema which does not meet at least one of these criteria: - A validator returned by `cv.make_entity_service_schema` - A validator returned by `cv.make_entity_service_schema`, wrapped in a `vol.Schema` - A validator returned by `cv.make_entity_service_schema`, wrapped in a `vol.All` In Home Assistant Core 2025.10, it will no longer be possible to register an entity action with a custom schema not meeting this requirement. -It's still possible to register an entity action with no schema, or with a dict representing the additional action call parameters. The reason for the change is that if `cv.make_entity_service_schema` is not used, the service will not automatically support all possible ways of targeting entities. More details can be found in the [developer documentation](/docs/dev_101_services/#entity-service-actions) and in core PRs [#124102](https://github.com/home-assistant/core/pull/124102) and [#125057](https://github.com/home-assistant/core/pull/125057).