From 4e5fc3a55a853183fb545b86f14bbef50c6b3edb Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 3 Apr 2023 21:49:30 +0200 Subject: [PATCH] Modify service field filter documentation (#1740) Co-authored-by: Franck Nijhof --- docs/dev_101_services.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/dev_101_services.md b/docs/dev_101_services.md index fc3ff1bf..1c2024f1 100644 --- a/docs/dev_101_services.md +++ b/docs/dev_101_services.md @@ -128,14 +128,19 @@ In some cases, entities from a service's domain may not support all service fiel providing a `filter` for the field description, the field will only be shown if at least one selected entity supports the field according to the configured filter. -If multiple filters are specified, the field will be shown if at least one selected entity -passes at least one filter. +A filter must specify either `supported_features` or `attribute`, combing both is not +supported. -The filter supports filtering on `supported_features` as well as on state attribute values -in general. +A `supported_features` filter is specified by of a list of supported features. The field +will be shown if at least one selected entity supports at least one of the listed features. + +An `attribute` filter combines an attribute with a list of values. The field will be +shown if at least one selected entity's attribute is set to one of the listed attribute states. +If the attribute state is a list, the field will be shown if at least one item in a selected +entity's attribute state is set to one of the listed attribute states. This is a partial example of a field which is only shown if at least one selected entity -has the needed `supported_features`: +supports `ClimateEntityFeature.TARGET_TEMPERATURE`: ```yaml fields: