Skip to content

Commit

Permalink
history_stats: update examples (home-assistant#12282)
Browse files Browse the repository at this point in the history
it is possible to change several attributes in just one datetime.replace call
  • Loading branch information
akasma74 authored Mar 6, 2020
1 parent 777a2f3 commit b56d663
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/_integrations/history_stats.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sensor:
entity_id: light.my_lamp
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}'
```
{% endraw %}
Expand Down Expand Up @@ -132,7 +132,7 @@ Here are some examples of periods you could work with, and what to write in your

{% raw %}
```yaml
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}'
```
{% endraw %}
Expand All @@ -141,7 +141,7 @@ Here are some examples of periods you could work with, and what to write in your

{% raw %}
```yaml
end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now().replace(hour=0, minute=0, second=0) }}'
duration:
hours: 24
```
Expand All @@ -151,7 +151,7 @@ Here are some examples of periods you could work with, and what to write in your

{% raw %}
```yaml
start: '{{ now().replace(hour=6).replace(minute=0).replace(second=0) }}'
start: '{{ now().replace(hour=6, minute=0, second=0) }}'
duration:
hours: 5
```
Expand All @@ -163,7 +163,7 @@ Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekd

{% raw %}
```yaml
start: '{{ as_timestamp( now().replace(hour=0).replace(minute=0).replace(second=0) ) - now().weekday() * 86400 }}'
start: '{{ as_timestamp( now().replace(hour=0, minute=0, second=0) ) - now().weekday() * 86400 }}'
end: '{{ now() }}'
```
{% endraw %}
Expand All @@ -172,7 +172,7 @@ Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekd

{% raw %}
```yaml
end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now().replace(hour=0, minute=0, second=0) }}'
duration:
days: 30
```
Expand Down

0 comments on commit b56d663

Please sign in to comment.