diff --git a/sternwarte-homeassistant-card/dist/sternwarte-card.js b/sternwarte-homeassistant-card/dist/sternwarte-card.js index e2a794c..43b47e2 100644 --- a/sternwarte-homeassistant-card/dist/sternwarte-card.js +++ b/sternwarte-homeassistant-card/dist/sternwarte-card.js @@ -409,27 +409,11 @@ class SternwarteCard extends HTMLElement { return ""; } - _powerIndicatorState() { + _powerIndicatorClassName() { const state = this._state(this._powerEntityId())?.state; - if (state === "on") { - return { - className: "on", - label: "Dachsteuerung an", - lightStyle: "background:#4caf50; box-shadow:0 0 12px rgba(76, 175, 80, 0.45);", - }; - } - if (state === "off") { - return { - className: "off", - label: "Dachsteuerung aus", - lightStyle: "background:#c62828; box-shadow:0 0 10px rgba(198, 40, 40, 0.25);", - }; - } - return { - className: "unknown", - label: "Dachsteuerung unbekannt", - lightStyle: "background:#d1a94a; box-shadow:0 0 10px rgba(209, 169, 74, 0.3);", - }; + if (state === "on") return "on"; + if (state === "off") return "off"; + return "unknown"; } _windIndicatorState() { @@ -781,7 +765,7 @@ class SternwarteCard extends HTMLElement { if (!this.shadowRoot || !this._hass) return; const powerEntityId = this._powerEntityId(); - const powerIndicator = this._powerIndicatorState(); + const powerIndicatorClassName = this._powerIndicatorClassName(); const rain = this._state(this.config.rain); const openScheduleEntityId = this._scheduleOpenEntityId(); const closeScheduleEntityId = this._scheduleCloseEntityId(); @@ -804,7 +788,11 @@ class SternwarteCard extends HTMLElement { const openOn = this._state(this.config.roofOpen)?.state === "on"; const closedOn = this._state(this.config.roofClosed)?.state === "on"; const openBlockedReason = this._openBlockedReason(); - const powerOn = this._state(powerEntityId)?.state === "on"; + const powerState = this._state(powerEntityId)?.state; + const powerOn = powerState === "on"; + const powerOff = powerState === "off"; + const powerOnButtonDisabled = powerOn; + const powerOffButtonDisabled = powerOff; let openButtonDisabled; let closeButtonDisabled; let stopButtonDisabled; @@ -1188,25 +1176,6 @@ class SternwarteCard extends HTMLElement { margin-top: 12px; align-items: center; } - .power-indicator { - display: inline-flex; - align-items: center; - gap: 8px; - padding: 10px 12px; - border-radius: 12px; - background: rgba(255,255,255,0.04); - border: 1px solid rgba(255,255,255,0.08); - font-size: 13px; - font-weight: 600; - color: var(--primary-text-color); - } - .power-indicator-light { - width: 12px; - height: 12px; - border-radius: 999px; - background: #7a7a7a; - box-shadow: 0 0 0 rgba(122, 122, 122, 0); - } .schedule-overview { display: grid; grid-template-columns: repeat(2, 1fr); @@ -1340,7 +1309,7 @@ class SternwarteCard extends HTMLElement { -