Skip to content

Commit

Permalink
Fixed #295: Set default brightness to 255 if state attributes do not …
Browse files Browse the repository at this point in the history
…contain brightness.
  • Loading branch information
cgiesche committed Sep 10, 2024
1 parent 18746b2 commit 9e59c14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/config/default-display-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ light:
color: "#888888"
feedbackLayout: "$B1"
feedback: |
{% set brightness = attributes.brightness | default(255, true) %}
{
"indicator": {{ attributes.brightness / 255 * 100 }},
"value": "{{ (attributes.brightness / 255 * 100) | int }}%"
"indicator": {{ brightness / 255 * 100 }},
"value": "{{ (brightness / 255 * 100) | int }}%"
}
states:
unavailable:
Expand Down

0 comments on commit 9e59c14

Please sign in to comment.