]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Improved entities selection for updates
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 30 Oct 2024 05:56:21 +0000 (06:56 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 30 Oct 2024 05:56:21 +0000 (06:56 +0100)
packages/BTicino/bticino_operations.yaml
packages/netatmo/netatmo_operations.yaml
packages/shelly/shelly_operations.yaml
packages/update/update_engine.yaml

index 3a6aab88e707d7a3b218fd6ed51ae0b7e38ac7da..66d9fc1ade1e559974df7f108542a42fd4221493 100644 (file)
@@ -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
         }}
index 80cddcfb822317832c92143dfead90f9ba77035a..f731e43b2589eef0e826f088660ab8ee1e47a74c 100644 (file)
@@ -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 -%}
index 75302fb397b3a3096c2f91c301cb5e6dc95b871a..38736ccbb4719d7e933f74c4074572f80729c539 100644 (file)
@@ -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
         }}
index 5ca460b2188ebeaffe533f6f6af0c97cb181df6f..f00fb09211d9b00d07b9ddc2a047a73d5f64d068 100644 (file)
@@ -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
         }}