Skip to content

Commit 57c9413

Browse files
committed
fix: update boolean state handling to read fresh values from HASS
1 parent c496aff commit 57c9413

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/panels/lcards-config-panel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,11 +1125,14 @@ export class LCARdSConfigPanel extends LitElement {
11251125
></ha-selector>
11261126
`;
11271127
} else if (helper.domain === 'input_boolean') {
1128+
// Read fresh value from HASS state (same pattern as input_select above) to avoid
1129+
// showing stale cache values; fall back to helper.currentValue if state not yet loaded.
1130+
const boolState = this.hass?.states?.[helper.entity_id]?.state ?? helper.currentValue;
11281131
return html`
11291132
<ha-selector
11301133
.hass=${this.hass}
11311134
.selector=${{ boolean: {} }}
1132-
.value=${helper.currentValue === 'on'}
1135+
.value=${boolState === 'on'}
11331136
@value-changed=${(e) => {
11341137
e.stopPropagation();
11351138
const newValue = e.detail.value;

0 commit comments

Comments
 (0)