Skip to content

Commit

Permalink
pushing LM 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asucrews authored Apr 30, 2024
1 parent 5ce2d78 commit cb8fa16
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
6 changes: 5 additions & 1 deletion automations/lock_management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.2.0rc1] 2024-04-29
### Added
- Notification

## [0.1.0] - 2024-04-29
### Added
- Initial release of the Log Management Blueprint.
- Initial release of the Log Management Blueprint.
2 changes: 1 addition & 1 deletion automations/lock_management/dev/lock_management_dev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blueprint:
name: Lock Management Dev (0.2.0.r13)
name: Lock Management Dev (0.3.0.r0)
description: lock Management
domain: automation
source_url: https://github.com/asucrews/ha-blueprints/blob/main/automations/lock_management/lock_management.yaml
Expand Down
44 changes: 43 additions & 1 deletion automations/lock_management/lock_management.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blueprint:
name: Lock Management Stable (0.1.0)
name: Lock Management Stable (0.2.0)
description: lock Management
domain: automation
source_url: https://github.com/asucrews/ha-blueprints/blob/main/automations/lock_management/lock_management.yaml
Expand All @@ -21,10 +21,20 @@ blueprint:
domain:
- timer
multiple: false
notify_device:
name: Easy Notify - Devices Notified (Optional)
description: If you've enabled device notifications above, please select the devices to receive the notifications.
default: []
selector:
device:
filter:
- integration: mobile_app
multiple: true

variables:
lock: !input lock
auto_lock_timer: !input auto_lock_timer
notify_device: !input notify_device

trigger:
- platform: event
Expand Down Expand Up @@ -69,6 +79,22 @@ action:
data: {}
target:
entity_id: !input auto_lock_timer
- if:
- condition: template
value_template: "{{ notify_device | length > 0 }}"
then:
- repeat:
for_each: !input notify_device
sequence:
- service: notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }}
data:
message: >
{% if code_slot > 0 %}
"{{ device_attr(lock, 'name') }} was unlocked by {{ code_slot_name }}"
{% else %}
"{{ device_attr(lock, 'name') }} was unlocked"
{% endif %}
title: "{{ device_attr(lock, 'name') }}"
- conditions:
- condition: template
value_template: "{{ lock_state == 'unlocked' }}"
Expand Down Expand Up @@ -98,6 +124,22 @@ action:
data: {}
target:
entity_id: !input auto_lock_timer
- if:
- condition: template
value_template: "{{ notify_device | length > 0 }}"
then:
- repeat:
for_each: !input notify_device
sequence:
- service: notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }}
data:
message: >
{% if code_slot > 0 %}
"{{ device_attr(lock, 'name') }} was unlocked by {{ code_slot_name }}"
{% else %}
"{{ device_attr(lock, 'name') }} was unlocked"
{% endif %}
title: "{{ device_attr(lock, 'name') }}"
- conditions:
- condition: and
conditions:
Expand Down

0 comments on commit cb8fa16

Please sign in to comment.