Skip to content

Commit 7f973bb

Browse files
Add include devices filter to battery notes blueprints
1 parent 08541fd commit 7f973bb

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

docs/blueprints/battery_notes_battery_not_reported.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ blueprint:
2020
multiple: true
2121
entity:
2222
- integration: battery_notes
23-
included_devices:
23+
include_devices_enabled:
24+
name: Enable Include Devices Filter
25+
description: Only trigger for specific devices when enabled.
26+
default: false
27+
selector:
28+
boolean:
29+
include_devices:
2430
name: Devices to include (Optional)
25-
description: If specified, only these devices will trigger this automation.
31+
description: When enabled above, only these devices will trigger this automation.
2632
default:
2733
selector:
2834
device:
@@ -46,7 +52,8 @@ blueprint:
4652
variables:
4753
not_reported_notification: !input not_reported_notification
4854
excluded_devices: !input excluded_devices
49-
included_devices: !input included_devices
55+
include_devices_enabled: !input include_devices_enabled
56+
include_devices: !input include_devices
5057
triggers:
5158
- trigger: event
5259
event_type: battery_notes_battery_not_reported
@@ -57,7 +64,7 @@ conditions:
5764
{{ trigger.event.data.device_id not in excluded_devices}}
5865
- condition: template
5966
value_template: |-
60-
{{ included_devices | length == 0 or trigger.event.data.device_id in included_devices }}
67+
{{ not include_devices_enabled or trigger.event.data.device_id in include_devices }}
6168
- alias: User pick
6269
condition: !input additional_conditions
6370
actions:

docs/blueprints/battery_notes_battery_threshold.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ blueprint:
2727
multiple: true
2828
entity:
2929
- integration: battery_notes
30-
included_devices:
30+
include_devices_enabled:
31+
name: Enable Include Devices Filter
32+
description: Only trigger for specific devices when enabled.
33+
default: false
34+
selector:
35+
boolean:
36+
include_devices:
3137
name: Devices to include (Optional)
32-
description: If specified, only these devices will trigger this automation.
38+
description: When enabled above, only these devices will trigger this automation.
3339
default:
3440
selector:
3541
device:
@@ -61,7 +67,8 @@ variables:
6167
low_notification: !input low_notification
6268
high_notification: !input high_notification
6369
excluded_devices: !input excluded_devices
64-
included_devices: !input included_devices
70+
include_devices_enabled: !input include_devices_enabled
71+
include_devices: !input include_devices
6572

6673
triggers:
6774
- trigger: event
@@ -83,7 +90,7 @@ conditions:
8390
{{ trigger.event.data.device_id not in excluded_devices}}
8491
- condition: template
8592
value_template: |-
86-
{{ included_devices | length == 0 or trigger.event.data.device_id in included_devices }}
93+
{{ not include_devices_enabled or trigger.event.data.device_id in include_devices }}
8794
- alias: User pick
8895
condition: !input additional_conditions
8996

0 commit comments

Comments
 (0)