Skip to content

Commit

Permalink
add clear_usercode after random code for locks where clear actually w…
Browse files Browse the repository at this point in the history
…orks
  • Loading branch information
FutureTense committed Oct 20, 2020
1 parent 4a20136 commit 6c7c1bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/lock-manager/const.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DOMAIN = "lock-manager"
VERSION = "0.0.28"
VERSION = "0.0.29"
ISSUE_URL = "https://github.com/FutureTense/lock-manager"
PLATFORM = "sensor"

Expand Down
9 changes: 9 additions & 0 deletions custom_components/lock-manager/lock_manager_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,15 @@ automation:
{{ code_slot }}
usercode: >-
{{ range(1000, 9999) | random | int }}
- service: lock.clear_usercode
data_template:
node_id: >-
{{ state_attr('LOCKENTITYNAME','node_id') }}
code_slot: >-
{% set object_id = trigger.to_state.object_id %}
{% set index = object_id.rfind('_') + 1 %}
{% set code_slot = object_id[index:] %}
{{ code_slot }}
- alias: CASE_LOCK_NAME Decrement Access Count
trigger:
Expand Down

0 comments on commit 6c7c1bb

Please sign in to comment.