Skip to content

Commit

Permalink
update submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
yp87 committed Nov 21, 2024
1 parent 7647a40 commit 0c98868
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
50 changes: 50 additions & 0 deletions hass/script/cars/leaf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
update_leaf:
description: >-
Fetch the leaf's current state.
Calling it directly with "service: script.update_leaf"
will ensure the calling script will wait for the update.
mode: queued
sequence:
- repeat:
while:
- >
{{ as_timestamp(now()) -
as_timestamp(states('sensor.leaf_last_update'), 0)
> 600 }}
- "{{ repeat.index <= 6 }}"
sequence:
- service: joaoapps_join.android_server_send_tasker
data:
command: "LeafRefresh"
- wait_for_trigger:
- platform: state
entity_id: sensor.Leaf_last_tentative
timeout: "00:03:00"
- delay: "00:00:02"
- choose:
- conditions: >
{{ as_timestamp(now()) -
as_timestamp(states('sensor.Leaf_last_tentative'), 0)
>= 240 }}
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.leaf_update_message
value: >
Impossible d'effectuer une tentative de mise à jour.
- conditions: >
{{ as_timestamp(now()) -
as_timestamp(states('sensor.leaf_last_update'), 0)
> 600 }}
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.leaf_update_message
value: >
Les dernières valeurs obtenues sont trop vieilles.
default:
- service: input_text.set_value
data_template:
entity_id: input_text.leaf_update_message
value: "Succès."
11 changes: 11 additions & 0 deletions hass/switch/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- platform: template
switches:
update_leaf:
value_template: "{{ is_state('script.update_leaf', 'on') }}"
turn_on:
service: script.turn_on
entity_id: script.update_leaf
turn_off:
service: script.turn_off
entity_id: script.update_leaf
Binary file added hass/www/images/leaf.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c98868

Please sign in to comment.