Fill a blind's slider with its closed part, like its card and Home Assistant's cover dialog (0.2.79)
On the tile (and the strip of a full-page blind) the small slider filled with the open part, while the blind's card draws the blind hanging from the top: a closed blind looked open on one and closed on the other. Now both fill with the closed part and dragging right closes; the text still gives the position (open %). The editor's mockup follows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,8 @@ const fill = computed(() => {
|
||||
const a = c.a || {};
|
||||
if (domain.value === "light") return c.state === "on" ? (a.brightness !== undefined ? Math.round((a.brightness / 255) * 100) : 100) : 0;
|
||||
if (domain.value === "fan") return c.state === "on" ? (a.percentage ?? 100) : 0;
|
||||
if (domain.value === "cover") return a.current_position ?? (c.state === "open" ? 100 : 0);
|
||||
// A blind's bar fills with its closed part, as on the screen (firmware 0.2.66+) and in Home Assistant's cover dialog.
|
||||
if (domain.value === "cover") return 100 - (a.current_position ?? (c.state === "open" ? 100 : 0));
|
||||
if (domain.value === "media_player") return Math.round((a.volume_level ?? 0) * 100);
|
||||
if (domain.value === "number" || domain.value === "input_number") {
|
||||
const value = Number(c.state), min = Number(a.min ?? 0), max = Number(a.max ?? 100);
|
||||
|
||||
Reference in New Issue
Block a user