Skip to content

Commit

Permalink
add person zone
Browse files Browse the repository at this point in the history
  • Loading branch information
matt8707 committed Nov 19, 2021
1 parent db5fed2 commit 9e8e53a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions button_card_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,15 @@
- base
- circle
state_display: >
[[[ return variables.state === 'home' ? 'Ja' : 'Nej'; ]]]
[[[
if (variables.state === 'home') {
return 'Ja';
}
if (variables.state === 'not_home') {
return 'Nej';
}
return variables.state;
]]]
triggers_update: sensor.time
styles:
custom_fields:
Expand All @@ -581,7 +589,7 @@
? time(Date.now() - Date.parse(states[entity.entity_id].last_changed))
: time(Date.now() - Date.parse(states[variables.retain].state)),
stroke = variables.state === 'home' ? '#b2b2b2' : 'none',
fill = variables.state === 'not_home' ? 'rgba(255,255,255,0.04)' : 'none';
fill = variables.state !== 'home' ? 'rgba(255,255,255,0.04)' : 'none';
return `
<svg viewBox="0 0 50 50">
<circle cx="25" cy="25" r="20.5" stroke="${stroke}" stroke-width="1.5" fill="${fill}" />
Expand Down

0 comments on commit 9e8e53a

Please sign in to comment.