Skip to content

Commit 89a060c

Browse files
committed
Fix barWidth formula
1 parent b2570b1 commit 89a060c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

configuration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ lovelace:
1515
mode: yaml
1616
resources:
1717
- url: /local/datetime-card/datetime-card.js
18-
type: module
18+
type: module

src/datetime/DatetimeBar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
friendlyName || hass?.states?.[entity?.id]?.attributes?.friendly_name,
2626
);
2727
let barWidth = $derived<number>(
28-
Math.min(Math.abs((100 * (resetForward ? state + max : state)) / max), 100),
28+
Math.min((100 * state) / max + (resetForward ? 100 : 0), 100),
2929
);
3030
</script>
3131

0 commit comments

Comments
 (0)