Skip to content

Commit a80bc69

Browse files
committed
[TASK] fix issue with eco mode
1 parent cd8b3ff commit a80bc69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/better-thermostat-ui-card.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ export class BetterThermostatUiCard extends LitElement {
558558
private _handleAction(e: MouseEvent): void {
559559
if ((e.currentTarget as any).mode === "eco") {
560560
const stateObj = this.hass!.states[this._config!.entity] as any;
561-
if (stateObj.attributes.saved_temperature === null) {
561+
const saved_temp = stateObj?.attributes?.saved_temperature || null;
562+
if (saved_temp === null) {
562563
this.hass!.callService("better_thermostat", "set_temp_target_temperature", {
563564
entity_id: this._config!.entity,
564565
temperature: this._config?.eco_temperature || 18,

0 commit comments

Comments
 (0)