Skip to content

Commit

Permalink
fix: remove invalid keys for template sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske committed Jun 12, 2024
1 parent fdfc38d commit 585347b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions config/templates/relative_last_boot.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
- sensor:
# relative last boot time
- name: relative_last_boot
friendly_name: Relative Last Boot
- name: Relative Last Boot
unit_of_measurement: days ago
value_template: >
state: >
{% set date = strptime(states('sensor.last_boot'), '%Y-%m-%dT%H:%M:%S%z') %}
{% set diff = now() - date %}
{{ diff.days }}

0 comments on commit 585347b

Please sign in to comment.