From: Giorgio Ravera Date: Wed, 30 Oct 2024 05:56:21 +0000 (+0100) Subject: Improved entities selection for updates X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=d8039f9484854c991989450ae1527e22d9a964cd;p=homeassistant.git Improved entities selection for updates --- diff --git a/packages/BTicino/bticino_operations.yaml b/packages/BTicino/bticino_operations.yaml index 3a6aab88..66d9fc1a 100644 --- a/packages/BTicino/bticino_operations.yaml +++ b/packages/BTicino/bticino_operations.yaml @@ -10,9 +10,8 @@ script: alias: "BTicino: Aggiornamento Firmware Collettivo" variables: pending_update_list: > - {{ states.update + {{ expand('group.bticino') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.bticino.attributes.entity_id) | map(attribute='entity_id') | list }} @@ -30,9 +29,8 @@ automation: variables: pending_update_list: > - {{ states.update + {{ expand('group.bticino') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.bticino.attributes.entity_id) | map(attribute='entity_id') | list }} diff --git a/packages/netatmo/netatmo_operations.yaml b/packages/netatmo/netatmo_operations.yaml index 80cddcfb..f731e43b 100644 --- a/packages/netatmo/netatmo_operations.yaml +++ b/packages/netatmo/netatmo_operations.yaml @@ -9,9 +9,8 @@ automation: variables: disconnected_devices_list: > - {{ states.update + {{ expand('group.climate') | selectattr('state','eq','unavailable') - | selectattr('entity_id', 'in', states.group.climate.attributes.entity_id) | map(attribute='entity_id') | list }} @@ -38,7 +37,7 @@ automation: data_template: title: "Netatmo - Dispositivi disconnessi" message: > - I seguenti dispositivi si sono disconnessi : + Ci sono {{disconnected_devices_list | count }} dispositivi disconnessi: {% for entity_id in disconnected_devices_list %} -> {{ state_attr(entity_id, 'friendly_name')}} {%- endfor -%} diff --git a/packages/shelly/shelly_operations.yaml b/packages/shelly/shelly_operations.yaml index 75302fb3..38736ccb 100644 --- a/packages/shelly/shelly_operations.yaml +++ b/packages/shelly/shelly_operations.yaml @@ -10,9 +10,8 @@ script: alias: "Shelly: Aggiornamento Firmware Collettivo" variables: pending_update_list: > - {{ states.update + {{ expand('group.shelly') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.shelly.attributes.entity_id) | map(attribute='entity_id') | list }} @@ -44,9 +43,8 @@ automation: variables: pending_update_list: > - {{ states.update + {{ expand('group.shelly') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.shelly.attributes.entity_id) | map(attribute='entity_id') | list }} diff --git a/packages/update/update_engine.yaml b/packages/update/update_engine.yaml index 5ca460b2..f00fb092 100644 --- a/packages/update/update_engine.yaml +++ b/packages/update/update_engine.yaml @@ -19,9 +19,8 @@ automation: variables: pending_update_list: > - {{ states.update + {{ expand('group.hacs') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.hacs.attributes.entity_id) | map(attribute='entity_id') | list }} @@ -103,9 +102,8 @@ script: alias: "HACS: Aggiornamento Collettivo" variables: pending_update_list: > - {{ states.update + {{ expand('group.hacs') | selectattr('state','eq','on') - | selectattr('entity_id', 'in', states.group.hacs.attributes.entity_id) | map(attribute='entity_id') | list }}