331 files
This commit is contained in:
1 parent
22ba8b4648
commit
c4d601bfba
331 files changed
+10227
-50159
No files matched your search
@@ -177,7 +177,7 @@ const ne=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t
|
||||
* @license
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/;class we{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const ve="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class ke extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:ve?"100px":"50px",height:ve?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(e=>{document.addEventListener(e,()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0},{passive:!0})})}bind(e,t){if(e.actionHandler)return;e.actionHandler=!0,e.addEventListener("contextmenu",e=>{const t=e||window.event;return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,!1});const i=e=>{var t,i;this.held=!1;const r=null!==(t=e.pageX)&&void 0!==t?t:e.touches[0].pageX,s=null!==(i=e.pageY)&&void 0!==i?i:e.touches[0].pageY;this.timer=window.setTimeout(()=>{this.startAnimation(r,s),this.held=!0},this.holdTime)},r=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?me(e,"action",{action:"hold"}):t.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,me(e,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,me(e,"action",{action:"double_tap"})):me(e,"action",{action:"tap"}))};e.addEventListener("touchstart",i,{passive:!0}),e.addEventListener("touchend",r),e.addEventListener("touchcancel",r),e.addEventListener("mousedown",i,{passive:!0}),e.addEventListener("click",r),e.addEventListener("keyup",e=>{13===e.keyCode&&r(e)})}startAnimation(e,t){Object.assign(this.style,{left:`${e}px`,top:`${t}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.get("action-handler-clock-weather")||customElements.define("action-handler-clock-weather",ke);const xe=(e,t)=>{const i=(()=>{const e=document.body;if(e.querySelector("action-handler-clock-weather"))return e.querySelector("action-handler-clock-weather");const t=document.createElement("action-handler-clock-weather");return e.appendChild(t),t})();i&&i.bind(e,t)},Te=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends we{update(e,[t]){return xe(e.element,t),j}render(e){}});var Me={"clear-night":"صافي",cloudy:"غائم",fog:"ضباب",hail:"برد",lightning:"عواصف رعدية","lightning-rainy":"عواصف رعدية ممطرة",partlycloudy:"غائم جزئياً",pouring:"غزير",rainy:"ممطر",snowy:"ثلجي","snowy-rainy":"مطر ثلجي",sunny:"مشمس",windy:"عاصف","windy-variant":"رياح قوية",exceptional:"استثنائي"},Se={1:"الإثنين",2:"الثلاثاء",3:"الأربعاء",4:"الخميس",5:"الجمعة",6:"السبت",7:"الأحد"},_e={aqi:"مؤشر جودة الهواء",humidity:"رطوبة","feels-like":"يشعر كأنه"},Ne={weather:Me,day:Se,misc:_e},Oe=Object.freeze({__proto__:null,day:Se,default:Ne,misc:_e,weather:Me}),Ae={"clear-night":"Ясно",cloudy:"Облачно",fog:"Мъгла",hail:"Градушка",lightning:"Гръмотевични бури","lightning-rainy":"Дъждовни гръмотевични бури",partlycloudy:"Частична облачност",pouring:"Пороен дъжд",rainy:"Дъждовно",snowy:"Сняг","snowy-rainy":"Суграшица",sunny:"Слънчево",windy:"Ветровито","windy-variant":"Силен вятър",exceptional:"Изключително"},$e={1:"Пн",2:"Вт",3:"Ср",4:"Чт",5:"Пт",6:"Сб",7:"Нд"},Ce={aqi:"AQI",humidity:"Влажност","feels-like":"Усеща се като"},Ze={weather:Ae,day:$e,misc:Ce},Be=Object.freeze({__proto__:null,day:$e,default:Ze,misc:Ce,weather:Ae}),Ue={"clear-night":"Klart",cloudy:"Overskyet",fog:"Tåge",hail:"Hagl",lightning:"Lyn","lightning-rainy":"Regnvejr og lyn",partlycloudy:"Delvist overskyet",pouring:"Regnvejr",rainy:"Regnfuldt",snowy:"Sne","snowy-rainy":"Slud",sunny:"Solrigt",windy:"Blæsende","windy-variant":"Stærk vind",exceptional:"Kaos"},Ge={1:"Man",2:"Tir",3:"Ons",4:"Tor",5:"Fre",6:"Lør",7:"Søn"},Ve={aqi:"AQI",humidity:"luftfugtighed","feels-like":"Føles som"},Ee={weather:Ue,day:Ge,misc:Ve},De=Object.freeze({__proto__:null,day:Ge,default:Ee,misc:Ve,weather:Ue}),je={"clear-night":"Serè",cloudy:"Ennuvolat",fog:"Boira",hail:"Calamarsa",lightning:"Tempesta elèctrica","lightning-rainy":"Tempesta",partlycloudy:"Parcialment enLine truncated
|
||||
*/;class we{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const ve="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class ke extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:ve?"100px":"50px",height:ve?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(e=>{document.addEventListener(e,()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0},{passive:!0})})}bind(e,t){if(e.actionHandler)return;e.actionHandler=!0,e.addEventListener("contextmenu",e=>{const t=e||window.event;return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,!1});const i=e=>{var t,i;this.held=!1;const r=null!==(t=e.pageX)&&void 0!==t?t:e.touches[0].pageX,s=null!==(i=e.pageY)&&void 0!==i?i:e.touches[0].pageY;this.timer=window.setTimeout(()=>{this.startAnimation(r,s),this.held=!0},this.holdTime)},r=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?me(e,"action",{action:"hold"}):t.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,me(e,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,me(e,"action",{action:"double_tap"})):me(e,"action",{action:"tap"}))};e.addEventListener("touchstart",i,{passive:!0}),e.addEventListener("touchend",r),e.addEventListener("touchcancel",r),e.addEventListener("mousedown",i,{passive:!0}),e.addEventListener("click",r),e.addEventListener("keyup",e=>{13===e.keyCode&&r(e)})}startAnimation(e,t){Object.assign(this.style,{left:`${e}px`,top:`${t}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.get("action-handler-clock-weather")||customElements.define("action-handler-clock-weather",ke);const xe=(e,t)=>{const i=(()=>{const e=document.body;if(e.querySelector("action-handler-clock-weather"))return e.querySelector("action-handler-clock-weather");const t=document.createElement("action-handler-clock-weather");return e.appendChild(t),t})();i&&i.bind(e,t)},Te=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends we{update(e,[t]){return xe(e.element,t),j}render(e){}});var Me={"clear-night":"صافي",cloudy:"غائم",fog:"ضباب",hail:"برد",lightning:"عواصف رعدية","lightning-rainy":"عواصف رعدية ممطرة",partlycloudy:"غائم جزئياً",pouring:"غزير",rainy:"ممطر",snowy:"ثلجي","snowy-rainy":"مطر ثلجي",sunny:"مشمس",windy:"عاصف","windy-variant":"رياح قوية",exceptional:"استثنائي"},Se={1:"الإثنين",2:"الثلاثاء",3:"الأربعاء",4:"الخميس",5:"الجمعة",6:"السبت",7:"الأحد"},_e={aqi:"مؤشر جودة الهواء",humidity:"رطوبة","feels-like":"يشعر كأنه"},Ne={weather:Me,day:Se,misc:_e},Oe=Object.freeze({__proto__:null,day:Se,default:Ne,misc:_e,weather:Me}),Ae={"clear-night":"Ясно",cloudy:"Облачно",fog:"Мъгла",hail:"Градушка",lightning:"Гръмотевични бури","lightning-rainy":"Дъждовни гръмотевични бури",partlycloudy:"Частична облачност",pouring:"Пороен дъжд",rainy:"Дъждовно",snowy:"Сняг","snowy-rainy":"Суграшица",sunny:"Слънчево",windy:"Ветровито","windy-variant":"Силен вятър",exceptional:"Изключително"},$e={1:"Пн",2:"Вт",3:"Ср",4:"Чт",5:"Пт",6:"Сб",7:"Нд"},Ce={aqi:"AQI",humidity:"Влажност","feels-like":"Усеща се като"},Ze={weather:Ae,day:$e,misc:Ce},Be=Object.freeze({__proto__:null,day:$e,default:Ze,misc:Ce,weather:Ae}),Ue={"clear-night":"Klart",cloudy:"Overskyet",fog:"Tåge",hail:"Hagl",lightning:"Lyn","lightning-rainy":"Regnvejr og lyn",partlycloudy:"Delvist overskyet",pouring:"Regnvejr",rainy:"Regnfuldt",snowy:"Sne","snowy-rainy":"Slud",sunny:"Solrigt",windy:"Blæsende","windy-variant":"Stærk vind",exceptional:"Kaos"},Ge={1:"Man",2:"Tir",3:"Ons",4:"Tor",5:"Fre",6:"Lør",7:"Søn"},Ve={aqi:"AQI",humidity:"luftfugtighed","feels-like":"Føles som"},Ee={weather:Ue,day:Ge,misc:Ve},De=Object.freeze({__proto__:null,day:Ge,default:Ee,misc:Ve,weather:Ue}),je={"clear-night":"Serè",cloudy:"Ennuvolat",fog:"Boira",hail:"Calamarsa",lightning:"Tempesta elèctrica","lightning-rainy":"Tempesta",partlycloudy:"Parcialment enLine truncated
|
||||
<ha-card
|
||||
@action=${e=>{this.handleAction(e)}}
|
||||
.actionHandler=${Te({hasHold:ye(this.config.hold_action),hasDoubleClick:ye(this.config.double_tap_action)})}
|
||||
@@ -218,7 +218,7 @@ const ne=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t
|
||||
${this.config.hide_date?"":this.date()}
|
||||
</clock-weather-card-today-right-wrap-bottom>
|
||||
</clock-weather-card-today-right-wrap>
|
||||
</clock-weather-card-today-right>`}renderForecast(){const e=this.getWeather(),t=Er(this.getCurrentTemperature()),i=this.config.forecast_rows,r=this.config.hourly_forecast,s=e.attributes.temperature_unit,a=this.mergeForecasts(i,r),n=a.map(e=>e.templow),o=a.map(e=>e.temperature);null!==t&&(n.push(t),o.push(t));const l=Math.round(Vr(n)),c=Math.round(Gr(o)),d=a.map(e=>e.datetime).map(e=>r?this.time(e):this.localize(`day.${e.weekday}`)),u=d.length?Gr(d.map(e=>e.length)):0;return a.map((e,i)=>Kr(()=>this.renderForecastItem(e,l,c,t,s,r,d[i],u)))}renderForecastItem(e,t,i,r,s,a,n,o){const l="pouring"===e.condition?"raindrops":"rainy"===e.condition?"raindrop":e.condition,c=this.toIcon(l,"fill",!0,"static"),d=this.getWeather().attributes.temperature_unit,u=a?yl.now().hour===e.datetime.hour:yl.now().day===e.datetime.day,h=Math.round(u&&null!==r?Math.min(r,e.templow):e.templow),m=Math.round(u&&null!==r?Math.max(r,e.temperature):e.temperature);return D`
|
||||
</clock-weather-card-today-right>`}renderForecast(){const e=this.getWeather(),t=Er(this.getCurrentTemperature()),i=this.config.forecast_rows,r=this.config.hourly_forecast,s=e.attributes.temperature_unit,a=this.mergeForecasts(i,r),n=a.map(e=>e.templow),o=a.map(e=>e.temperature);null!==t&&(n.push(t),o.push(t));const l=Math.round(Vr(n)),c=Math.round(Gr(o)),d=a.map(e=>e.datetime).map(e=>r?this.time(e):this.localize(`day.${e.weekday}`)),u=d.length?Gr(d.map(e=>e.length)):0;return a.map((e,i)=>Kr(()=>this.renderForecastItem(e,l,c,t,s,r,d[i],u)))}renderForecastItem(e,t,i,r,s,a,n,o){const l="pouring"===e.condition?"raindrops":"rainy"===e.condition?"raindrop":e.condition,c=this.toIcon(l,"fill",!0,"static"),d=this.getWeather().attributes.temperature_unit,u=yl.now().hasSame(e.datetime,a?"hour":"day"),h=Math.round(u&&null!==r?Math.min(r,e.templow):e.templow),m=Math.round(u&&null!==r?Math.max(r,e.temperature):e.temperature);return D`
|
||||
<clock-weather-card-forecast-row style="--col-one-size: ${.5*o}rem;">
|
||||
${this.renderText(n)}
|
||||
${this.renderIcon(c)}
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
(function() {
|
||||
const env = {"DEBUG":true,"BUILD_TIME":"2026-09-20T21:21:02-02:30"};
|
||||
const env = {"DEBUG":true,"BUILD_TIME":"2026-10-02T16:09:58-02:30"};
|
||||
try {
|
||||
if (process) {
|
||||
process.env = Object.assign({}, process.env);
|
||||
@@ -11,7 +11,7 @@
|
||||
})();
|
||||
|
||||
var name = "simple-thermostat";
|
||||
var version = "4.5.0";
|
||||
var version = "4.5.1";
|
||||
|
||||
function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
@@ -235,6 +235,24 @@ ha-card.loading {
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes st-value-pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: scale(1.045);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
@supports (color: color-mix(in lch, red, blue)) {
|
||||
|
||||
@keyframes st-value-pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
@@ -256,6 +274,7 @@ ha-card.loading {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
display: flex;
|
||||
@@ -900,6 +919,7 @@ ha-card.cooling .header__icon-wrap::before {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
position: relative;
|
||||
display: inline-grid;
|
||||
align-items: center;
|
||||
@@ -5123,6 +5143,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.persistedActivityApplied = false;
|
||||
}
|
||||
updated() {
|
||||
this.reconcileAvailableSelection();
|
||||
this.syncAutoSelectRecentActivity();
|
||||
this.syncEmbeddedCard();
|
||||
this.syncOutsideClickListener();
|
||||
@@ -5134,13 +5155,15 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.resumeAutoSelectAfterReconnect();
|
||||
}
|
||||
getCardSize() {
|
||||
if (!this.config || !this.targets.length)
|
||||
if (!this.config || !this.getAvailableTargets().length)
|
||||
return 1;
|
||||
const embeddedSize = this.embeddedCard?.getCardSize?.();
|
||||
if (typeof embeddedSize === 'number' && Number.isFinite(embeddedSize)) {
|
||||
return Math.max(1, embeddedSize);
|
||||
}
|
||||
const target = this.getSelectedTarget();
|
||||
if (!target)
|
||||
return 1;
|
||||
const cardConfig = this.getTargetCardConfig(target);
|
||||
const entityCount = Array.isArray(cardConfig.entities)
|
||||
? cardConfig.entities.length
|
||||
@@ -5300,12 +5323,31 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.scheduleAutoSelectResume(this.getAutoSelectManualPauseMs() - elapsed);
|
||||
}
|
||||
getSelectedTarget() {
|
||||
return (this.targets.find((target) => target.entity === this.selectedEntity) ??
|
||||
this.targets[0]);
|
||||
const targets = this.getAvailableTargets();
|
||||
return (targets.find((target) => target.entity === this.selectedEntity) ??
|
||||
targets[0]);
|
||||
}
|
||||
getAvailableTargets() {
|
||||
if (!this.hass)
|
||||
return this.targets;
|
||||
return this.targets.filter((target) => isEntityAvailable(this.hass.states?.[target.entity]));
|
||||
}
|
||||
reconcileAvailableSelection() {
|
||||
const targets = this.getAvailableTargets();
|
||||
if (!targets.length) {
|
||||
this.menuOpen = false;
|
||||
return;
|
||||
}
|
||||
if (!targets.some((target) => target.entity === this.selectedEntity)) {
|
||||
this.menuOpen = false;
|
||||
this.cardFading = false;
|
||||
this.fadeInAfterSync = false;
|
||||
this.selectedEntity = targets[0].entity;
|
||||
}
|
||||
}
|
||||
getSelectedState() {
|
||||
const target = this.getSelectedTarget();
|
||||
return this.hass?.states?.[target.entity];
|
||||
return target ? this.hass?.states?.[target.entity] : undefined;
|
||||
}
|
||||
openSelectedPopover() {
|
||||
const target = this.getSelectedTarget();
|
||||
@@ -5359,7 +5401,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
return getCardStyle$1(getDomain(state.entity_id), state.attributes);
|
||||
}
|
||||
getSelectedIndex() {
|
||||
const index = this.targets.findIndex((target) => target.entity === this.selectedEntity);
|
||||
const index = this.getAvailableTargets().findIndex((target) => target.entity === this.selectedEntity);
|
||||
return index === -1 ? 0 : index;
|
||||
}
|
||||
isRecentActivityAutoSelectEnabled() {
|
||||
@@ -5447,7 +5489,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
return candidate.timestamp >= selected.timestamp;
|
||||
}
|
||||
getMostRecentStateActivityCandidate() {
|
||||
return this.targets
|
||||
return this.getAvailableTargets()
|
||||
.map((target) => this.getActivityCandidate(target))
|
||||
.filter((candidate) => candidate.timestamp > 0)
|
||||
.reduce((selected, candidate) => {
|
||||
@@ -5517,7 +5559,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
}
|
||||
getActivityActiveRank(target) {
|
||||
const state = this.hass?.states?.[target.entity];
|
||||
if (!state)
|
||||
if (!isEntityAvailable(state))
|
||||
return 0;
|
||||
const domain = getDomain(target.entity);
|
||||
const action = getEntityAction(state) ?? state.attributes?.action;
|
||||
@@ -5599,7 +5641,10 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.getAutoSelectManualPauseMs()) {
|
||||
return;
|
||||
}
|
||||
const latest = changedTargets.reduce((selected, candidate) => this.isBetterActivityCandidate(candidate, selected) ? candidate : selected);
|
||||
const selectableChanges = changedTargets.filter((candidate) => this.getAvailableTargets().some((target) => target.entity === candidate.target.entity));
|
||||
if (!selectableChanges.length)
|
||||
return;
|
||||
const latest = selectableChanges.reduce((selected, candidate) => this.isBetterActivityCandidate(candidate, selected) ? candidate : selected);
|
||||
this.selectEntity(latest.target.entity, false);
|
||||
}
|
||||
getTargetLabel(target) {
|
||||
@@ -5664,6 +5709,8 @@ class SimpleThermostatGroup extends i$1 {
|
||||
}
|
||||
getEmbeddedConfig() {
|
||||
const target = this.getSelectedTarget();
|
||||
if (!target)
|
||||
return undefined;
|
||||
return this.getTargetCardConfig(target);
|
||||
}
|
||||
getEmbeddedConfigSignature(config) {
|
||||
@@ -5717,8 +5764,9 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.embeddedCardPendingSignature = '';
|
||||
return;
|
||||
}
|
||||
if (this.getEmbeddedConfigSignature(this.getEmbeddedConfig()) !==
|
||||
configSignature) {
|
||||
const currentConfig = this.getEmbeddedConfig();
|
||||
if (!currentConfig ||
|
||||
this.getEmbeddedConfigSignature(currentConfig) !== configSignature) {
|
||||
return;
|
||||
}
|
||||
this.embeddedCard = embedded;
|
||||
@@ -5736,9 +5784,14 @@ class SimpleThermostatGroup extends i$1 {
|
||||
if (!this.config || !this.hass)
|
||||
return;
|
||||
const host = this.renderRoot.querySelector('.embedded-card-host');
|
||||
if (!host)
|
||||
return;
|
||||
const embeddedConfig = this.getEmbeddedConfig();
|
||||
if (!host || !embeddedConfig) {
|
||||
this.embeddedCard = undefined;
|
||||
this.embeddedCardEntity = '';
|
||||
this.embeddedCardConfigSignature = '';
|
||||
this.embeddedCardPendingSignature = '';
|
||||
return;
|
||||
}
|
||||
const configSignature = this.getEmbeddedConfigSignature(embeddedConfig);
|
||||
if (!this.embeddedCard ||
|
||||
this.embeddedCardEntity !== embeddedConfig.entity ||
|
||||
@@ -5860,11 +5913,11 @@ class SimpleThermostatGroup extends i$1 {
|
||||
this.writeStoredSelection(entity);
|
||||
}
|
||||
selectOffset(offset) {
|
||||
if (this.targets.length < 2)
|
||||
const targets = this.getAvailableTargets();
|
||||
if (targets.length < 2)
|
||||
return;
|
||||
const next = (this.getSelectedIndex() + offset + this.targets.length) %
|
||||
this.targets.length;
|
||||
this.selectEntity(this.targets[next].entity);
|
||||
const next = (this.getSelectedIndex() + offset + targets.length) % targets.length;
|
||||
this.selectEntity(targets[next].entity);
|
||||
}
|
||||
toggleHeaderEntity(ev, entityId) {
|
||||
ev.stopPropagation();
|
||||
@@ -5916,7 +5969,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
`;
|
||||
}
|
||||
toggleMenu() {
|
||||
if (this.targets.length < 2)
|
||||
if (this.getAvailableTargets().length < 2)
|
||||
return;
|
||||
this.menuOpen = !this.menuOpen;
|
||||
}
|
||||
@@ -5965,9 +6018,10 @@ class SimpleThermostatGroup extends i$1 {
|
||||
renderPicker() {
|
||||
if (!this.menuOpen)
|
||||
return A;
|
||||
const targets = this.getAvailableTargets();
|
||||
return b `
|
||||
<div class="group-picker" role="menu">
|
||||
${this.targets.map((target) => {
|
||||
${targets.map((target) => {
|
||||
const label = this.getTargetLabel(target);
|
||||
const icon = this.getTargetIcon(target);
|
||||
const selected = target.entity === this.selectedEntity;
|
||||
@@ -6024,10 +6078,11 @@ class SimpleThermostatGroup extends i$1 {
|
||||
}
|
||||
renderTabSelector() {
|
||||
const selector = this.config?.selector ?? DEFAULT_SELECTOR;
|
||||
const targets = this.getAvailableTargets();
|
||||
return b `
|
||||
<div class="group-selector tabs">
|
||||
<div class="group-tabs" role="tablist">
|
||||
${this.targets.map((target) => {
|
||||
${targets.map((target) => {
|
||||
const label = this.getTargetLabel(target);
|
||||
const icon = this.getTargetIcon(target);
|
||||
const selected = target.entity === this.selectedEntity;
|
||||
@@ -6074,6 +6129,9 @@ class SimpleThermostatGroup extends i$1 {
|
||||
return this.renderTabSelector();
|
||||
}
|
||||
const target = this.getSelectedTarget();
|
||||
if (!target)
|
||||
return A;
|
||||
const targetCount = this.getAvailableTargets().length;
|
||||
const label = this.getTargetLabel(target);
|
||||
const previousLabel = this.localizeNavigationLabel('ui.common.previous', 'Previous device');
|
||||
const nextLabel = this.localizeNavigationLabel('ui.common.next', 'Next device');
|
||||
@@ -6098,7 +6156,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
class="group-nav previous"
|
||||
type="button"
|
||||
aria-label=${previousLabel}
|
||||
?disabled=${this.targets.length < 2}
|
||||
?disabled=${targetCount < 2}
|
||||
@click=${() => this.selectOffset(-1)}
|
||||
>
|
||||
<ha-icon icon="mdi:chevron-left"></ha-icon>
|
||||
@@ -6107,7 +6165,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
class="group-nav next"
|
||||
type="button"
|
||||
aria-label=${nextLabel}
|
||||
?disabled=${this.targets.length < 2}
|
||||
?disabled=${targetCount < 2}
|
||||
@click=${() => this.selectOffset(1)}
|
||||
>
|
||||
<ha-icon icon="mdi:chevron-right"></ha-icon>
|
||||
@@ -6118,7 +6176,7 @@ class SimpleThermostatGroup extends i$1 {
|
||||
aria-label=${menuLabel}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded=${this.menuOpen ? 'true' : 'false'}
|
||||
?disabled=${this.targets.length < 2}
|
||||
?disabled=${targetCount < 2}
|
||||
@click=${() => this.toggleMenu()}
|
||||
>
|
||||
<ha-icon icon="mdi:dots-vertical"></ha-icon>
|
||||
@@ -6137,6 +6195,8 @@ class SimpleThermostatGroup extends i$1 {
|
||||
render() {
|
||||
if (!this.config)
|
||||
return b `<ha-card></ha-card>`;
|
||||
if (!this.getAvailableTargets().length)
|
||||
return A;
|
||||
return b `
|
||||
<div
|
||||
class=${this.getGroupCardClasses()}
|
||||
@@ -8974,6 +9034,16 @@ if (!w.customCards.find((c) => c.type === name)) {
|
||||
preview: true,
|
||||
description: 'A different take on the thermostat card',
|
||||
documentationURL: 'https://github.com/Wheemer/simple-thermostat',
|
||||
getEntitySuggestion: (_hass, entityId) => {
|
||||
if (entityId.split('.')[0] !== 'climate')
|
||||
return null;
|
||||
return {
|
||||
config: {
|
||||
type: `custom:${name}`,
|
||||
entity: entityId,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
if (!w.customCards.find((c) => c.type === `${name}-group`)) {
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
!function(){const t={DEBUG:!1,BUILD_TIME:"2026-09-20T21:21:02-02:30"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,t)}catch(t){}globalThis.process={env:t}}();var t="simple-thermostat",e="4.5.0";function i(t,e,i,o){var a,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}"function"==typeof SuppressedError&&SuppressedError;const o=globalThis,a=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let s=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(a&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}};const c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new s(i,t,n)},l=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:d,defineProperty:h,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:m,getPrototypeOf:g}=Object,f=globalThis,v=f.trustedTypes,y=v?v.emptyScript:"",b=f.reactiveElementPolyfillSupport,_=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},x=(t,e)=>!d(t,e),$={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&h(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:a}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const n=o?.call(this);a?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...p(t),...m(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(a)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),a=o.litNonLine truncated
|
||||
!function(){const t={DEBUG:!1,BUILD_TIME:"2026-10-02T16:09:58-02:30"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,t)}catch(t){}globalThis.process={env:t}}();var t="simple-thermostat",e="4.5.1";function i(t,e,i,a){var o,n=arguments.length,r=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,a);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}"function"==typeof SuppressedError&&SuppressedError;const a=globalThis,o=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let s=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}};const c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,a)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new s(i,t,n)},l=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:d,defineProperty:h,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:m,getPrototypeOf:g}=Object,f=globalThis,v=f.trustedTypes,y=v?v.emptyScript:"",b=f.reactiveElementPolyfillSupport,_=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},x=(t,e)=>!d(t,e),$={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(t,i,e);void 0!==a&&h(this.prototype,t,a)}}static getPropertyDescriptor(t,e,i){const{get:a,set:o}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:a,set(e){const n=a?.call(this);o?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...p(t),...m(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(o)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),o=a.litNonLine truncated
|
||||
display: block;
|
||||
isolation: isolate;
|
||||
max-width: 100%;
|
||||
@@ -138,6 +138,24 @@ ha-card.loading {
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes st-value-pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: scale(1.045);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
@supports (color: color-mix(in lch, red, blue)) {
|
||||
|
||||
@keyframes st-value-pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
@@ -159,6 +177,7 @@ ha-card.loading {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
display: flex;
|
||||
@@ -803,6 +822,7 @@ ha-card.cooling .header__icon-wrap::before {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
position: relative;
|
||||
display: inline-grid;
|
||||
align-items: center;
|
||||
@@ -1887,7 +1907,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
font-size: 12px;
|
||||
font-size: var(--ha-font-size-s, 12px);
|
||||
}
|
||||
`;function _t(t,e,i,o={}){o=o||{},i=null==i?{}:i;const a=new Event(e,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});return a.detail=i,t.dispatchEvent(a),a}function wt(t){return Array.isArray(t)?t.map(t=>{const{label:e,...i}=t;return!i.name&&e&&(i.name=e),i}):t}function xt(t){const e={...t,layout:t.layout?{...t.layout}:void 0},i=3===e.version;return i&&void 0===e.enhanced_visuals&&(e.enhanced_visuals=!1),i&&!e.layout?.step&&(e.layout={...e.layout??{},step:"column"}),!e.current_value_entity&&e.current_temperature_entity&&(e.current_value_entity=e.current_temperature_entity),void 0===e.entities&&void 0!==e.sensors&&function(t){if(!Array.isArray(t.sensors))return;const e=[];t.sensors.forEach(i=>{const o=i;return"temperature"===o.id?(o.label&&(t.label={...t.label??{},temperature:o.label}),void(!1===o.show&&(t.hide={...t.hide??{},temperature:!0}))):"state"===o.id?(o.label&&(t.label={...t.label??{},state:o.label}),void(!1===o.show&&(t.hide={...t.hide??{},state:!0}))):void e.push(i)}),t.entities=wt(e)}(e),e.entities=wt(e.entities),e.layout&&void 0===e.layout.entities&&void 0!==e.layout.sensors&&(e.layout.entities=e.layout.sensors),delete e.current_temperature_entity,delete e.sensors,delete e.layout?.sensors,delete e.version,e}!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}}(bt),function(t){t.HVAC="hvac",t.FAN="fan",t.STATE="state",t.PRESET="preset",t.SWING="swing",t.SWING_HORIZONTAL="swing_horizontal",t.SWING_VERTICAL="swing_vertical",t.VANE_HORIZONTAL="vane_horizontal",t.VANE_VERTICAL="vane_vertical",t.DIRECTION="direction",t.OSCILLATING="oscillating",t.MODE="mode"}(yt||(yt={}));const $t="dual";const St={getSetpoints:t=>function(t){return"number"==typeof t.target_temp_high&&"number"==typeof t.target_temp_low?$t:"single"}(t)===$t?{target_temp_low:t.target_temp_low,target_temp_high:t.target_temp_high}:{temperature:t.temperature},getRange:t=>({min:t?.min_temp??null,max:t?.max_temp??null,step:t?.target_temp_step??null}),getCurrentValue:t=>t?.current_temperature??null,getCurrentValueTemplate:()=>"{{current_temperature|formatNumber}}",getSetpointService:()=>({domain:"climate",service:"set_temperature"}),getModeService:t=>"vane_horizontal"===t||"vane_vertical"===t?`set_${t}`:`set_${t}_mode`,getModePayloadKey:t=>"vane_horizontal"===t||"vane_vertical"===t?t:`${t}_mode`,getModeAttribute:t=>"vane_horizontal"===t||"vane_vertical"===t?`${t}_positions`:`${t}_modes`,getDefaultControl:()=>["hvac","preset"],getLocalizationDomain:()=>"climate"},At={climate:St,fan:{getSetpoints:t=>"number"!=typeof t?.percentage?{}:{percentage:t.percentage},getRange(t){const e=Number(t?.percentage_step);return{min:0,max:100,step:Number.isFinite(e)&&e>0?e:1}},getCurrentValue:t=>t?.current_temperature??t?.temperature??null,getCurrentValueUnit:(t,e)=>null!=t?.current_temperature?e?.unit_system?.temperature??!1:null!=t?.temperature&&(t?.unit_of_measurement??e?.unit_system?.temperature??!1),getCurrentValueTemplate:()=>"{{current_temperature|formatNumber}}",getSetpointService:()=>({domain:"fan",service:"set_percentage"}),getModeService:t=>"state"===t?"turn_on":"direction"===t?"set_direction":"oscillating"===t?"oscillate":`set_${t}_mode`,getModePayloadKey:t=>"state"===t?"state":"direction"===t?"direction":"oscillating"===t?"oscillating":`${t}_mode`,getModeAttribute:t=>"state"===t?"state":"direction"===t?"direction":"oscillating"===t?"oscillating":`${t}_modes`,getDefaultControl:()=>["preset","direction","oscillating","state"],transformModePayloadValue:(t,e)=>"oscillating"===t?"true"===e:e,getLocalizationDomain:()=>"fan"},humidifier:{getSetpoints:t=>({humidity:t?.humidity}),getRange:t=>({min:t?.min_humidity??0,max:t?.max_humidity??100,step:1}),getCurrentValue:t=>t?.current_humidity??null,getCurrentValueTemplate:()=>"{{current_humidity|formatNumber}}",getSetpointService:()=>({domain:"humidifier",service:"set_humidity"}),getModeService:t=>"state"===t?"turn_on":"mode"===t?"set_mode":`set_${t}`,getModePayloadKey:t=>"state"===t?"state":"mode"===t?"mode":t,getModeAttribute:t=>"state"===t?"state":"mode"===t?"available_modes":`${t}_modes`,getDefaultControl:()=>["mode","state"],getLocalizationDomain:()=>"humidifier"}};function kt(t){if(!t)return St;const e=t.split(".")[0];return At[e]??St}const Et=process.env.BUILD_TIME,zt=["climate","fan","humidifier"],Ct=[yt.HVAC,yt.FAN,yt.STATE,yt.PRESET,yt.SWING,yt.SWING_HORIZONTAL,yt.SWING_VERTICAL,yt.VANE_HORIZONTAL,yt.VANE_VERTICAL,yt.DIRECTION,yt.OSCILLATING,yt.MODE],Tt=Object.values(yt),Rt={[yt.HVAC]:"HVAC modes",[yt.FAN]:"Fan modes",[yt.STATE]:"On/off state",[yt.PRESET]:"Preset modes",[yt.SWING]:"Swing modes",[yt.SWING_HORIZONTAL]:"Horizontal swing",[yt.SWING
Line truncated
|
||||
`;function _t(t,e,i,a={}){a=a||{},i=null==i?{}:i;const o=new Event(e,{bubbles:void 0===a.bubbles||a.bubbles,cancelable:Boolean(a.cancelable),composed:void 0===a.composed||a.composed});return o.detail=i,t.dispatchEvent(o),o}function wt(t){return Array.isArray(t)?t.map(t=>{const{label:e,...i}=t;return!i.name&&e&&(i.name=e),i}):t}function xt(t){const e={...t,layout:t.layout?{...t.layout}:void 0},i=3===e.version;return i&&void 0===e.enhanced_visuals&&(e.enhanced_visuals=!1),i&&!e.layout?.step&&(e.layout={...e.layout??{},step:"column"}),!e.current_value_entity&&e.current_temperature_entity&&(e.current_value_entity=e.current_temperature_entity),void 0===e.entities&&void 0!==e.sensors&&function(t){if(!Array.isArray(t.sensors))return;const e=[];t.sensors.forEach(i=>{const a=i;return"temperature"===a.id?(a.label&&(t.label={...t.label??{},temperature:a.label}),void(!1===a.show&&(t.hide={...t.hide??{},temperature:!0}))):"state"===a.id?(a.label&&(t.label={...t.label??{},state:a.label}),void(!1===a.show&&(t.hide={...t.hide??{},state:!0}))):void e.push(i)}),t.entities=wt(e)}(e),e.entities=wt(e.entities),e.layout&&void 0===e.layout.entities&&void 0!==e.layout.sensors&&(e.layout.entities=e.layout.sensors),delete e.current_temperature_entity,delete e.sensors,delete e.layout?.sensors,delete e.version,e}!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(bt),function(t){t.HVAC="hvac",t.FAN="fan",t.STATE="state",t.PRESET="preset",t.SWING="swing",t.SWING_HORIZONTAL="swing_horizontal",t.SWING_VERTICAL="swing_vertical",t.VANE_HORIZONTAL="vane_horizontal",t.VANE_VERTICAL="vane_vertical",t.DIRECTION="direction",t.OSCILLATING="oscillating",t.MODE="mode"}(yt||(yt={}));const $t="dual";const St={getSetpoints:t=>function(t){return"number"==typeof t.target_temp_high&&"number"==typeof t.target_temp_low?$t:"single"}(t)===$t?{target_temp_low:t.target_temp_low,target_temp_high:t.target_temp_high}:{temperature:t.temperature},getRange:t=>({min:t?.min_temp??null,max:t?.max_temp??null,step:t?.target_temp_step??null}),getCurrentValue:t=>t?.current_temperature??null,getCurrentValueTemplate:()=>"{{current_temperature|formatNumber}}",getSetpointService:()=>({domain:"climate",service:"set_temperature"}),getModeService:t=>"vane_horizontal"===t||"vane_vertical"===t?`set_${t}`:`set_${t}_mode`,getModePayloadKey:t=>"vane_horizontal"===t||"vane_vertical"===t?t:`${t}_mode`,getModeAttribute:t=>"vane_horizontal"===t||"vane_vertical"===t?`${t}_positions`:`${t}_modes`,getDefaultControl:()=>["hvac","preset"],getLocalizationDomain:()=>"climate"},At={climate:St,fan:{getSetpoints:t=>"number"!=typeof t?.percentage?{}:{percentage:t.percentage},getRange(t){const e=Number(t?.percentage_step);return{min:0,max:100,step:Number.isFinite(e)&&e>0?e:1}},getCurrentValue:t=>t?.current_temperature??t?.temperature??null,getCurrentValueUnit:(t,e)=>null!=t?.current_temperature?e?.unit_system?.temperature??!1:null!=t?.temperature&&(t?.unit_of_measurement??e?.unit_system?.temperature??!1),getCurrentValueTemplate:()=>"{{current_temperature|formatNumber}}",getSetpointService:()=>({domain:"fan",service:"set_percentage"}),getModeService:t=>"state"===t?"turn_on":"direction"===t?"set_direction":"oscillating"===t?"oscillate":`set_${t}_mode`,getModePayloadKey:t=>"state"===t?"state":"direction"===t?"direction":"oscillating"===t?"oscillating":`${t}_mode`,getModeAttribute:t=>"state"===t?"state":"direction"===t?"direction":"oscillating"===t?"oscillating":`${t}_modes`,getDefaultControl:()=>["preset","direction","oscillating","state"],transformModePayloadValue:(t,e)=>"oscillating"===t?"true"===e:e,getLocalizationDomain:()=>"fan"},humidifier:{getSetpoints:t=>({humidity:t?.humidity}),getRange:t=>({min:t?.min_humidity??0,max:t?.max_humidity??100,step:1}),getCurrentValue:t=>t?.current_humidity??null,getCurrentValueTemplate:()=>"{{current_humidity|formatNumber}}",getSetpointService:()=>({domain:"humidifier",service:"set_humidity"}),getModeService:t=>"state"===t?"turn_on":"mode"===t?"set_mode":`set_${t}`,getModePayloadKey:t=>"state"===t?"state":"mode"===t?"mode":t,getModeAttribute:t=>"state"===t?"state":"mode"===t?"available_modes":`${t}_modes`,getDefaultControl:()=>["mode","state"],getLocalizationDomain:()=>"humidifier"}};function kt(t){if(!t)return St;const e=t.split(".")[0];return At[e]??St}const Et=process.env.BUILD_TIME,zt=["climate","fan","humidifier"],Ct=[yt.HVAC,yt.FAN,yt.STATE,yt.PRESET,yt.SWING,yt.SWING_HORIZONTAL,yt.SWING_VERTICAL,yt.VANE_HORIZONTAL,yt.VANE_VERTICAL,yt.DIRECTION,yt.OSCILLATING,yt.MODE],Tt=Object.values(yt),Rt={[yt.HVAC]:"HVAC modes",[yt.FAN]:"Fan modes",[yt.STATE]:"On/off state",[yt.PRESET]:"Preset modes",[yt.SWING]:"Swing modes",[yt.SWING_HORIZONTAL]:"Horizontal swing",[yt.SWING
Line truncated
|
||||
<div class="editor-row-actions">
|
||||
<ha-icon-button
|
||||
label="Move up"
|
||||
@@ -1907,7 +1927,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
label="Remove"
|
||||
title="Remove"
|
||||
.path=${vt}
|
||||
@click=${o}
|
||||
@click=${a}
|
||||
></ha-icon-button>
|
||||
</div>
|
||||
`}_renderExtraEntityRows(t=[]){const e=this._getExtraEntities(),i=this._getRelatedEntitySuggestions();return B`
|
||||
@@ -2020,7 +2040,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
</div>
|
||||
`)}
|
||||
</section>
|
||||
`}render(){if(!this.hass||!this.config)return B``;const t=function(t,e){const i=Jt(t,e),o=t.entity?.split(".")[0],a=kt(t.entity),n=t.entity?e?.states?.[t.entity]:void 0,r=!0===t.hide_setpoint||!n||Object.keys(a.getSetpoints(n.attributes??{})).length>0,s="fan"!==o&&("climate"===o||"humidifier"===o),c="fan"===o?[]:[{name:"current_value_entity",selector:{entity:{domain:["sensor","input_number"]}}}],l=[...s?[{name:"hide.temperature",selector:{boolean:{}}},{name:"hide_current_value_when_off",selector:{boolean:{}}}]:[],{name:"hide.state",selector:{boolean:{}}}],d=[...s?[{name:"label.temperature",selector:{text:{}}}]:[],{name:"label.state",selector:{text:{}}},...r?[{name:"label.setpoint",selector:{text:{}}}]:[]],h=!1===t.header?[]:[{type:"grid",schema:[{name:"name",selector:{text:{}}},{name:"icon",selector:{icon:{}}}]},{name:"toggle.entity",selector:{entity:{}}},{name:"toggle.name",selector:{text:{}}},...t.header&&"object"==typeof t.header&&t.header.toggle?.entity?[{name:"toggle.icon",selector:{icon:{}}}]:[]];return[{name:"entity",required:!0,selector:{entity:{domain:zt}}},{type:"expandable",title:"Card header",schema:[{name:"show_header",selector:{boolean:{}}},...h]},...i.length>0?[{type:"expandable",title:"Controls",schema:[{type:"grid",column_min_width:"150px",schema:i.map(t=>({name:`control.${t}`,selector:{boolean:{}}}))}]}]:[],...r?[{type:"expandable",title:"Target",schema:[{type:"grid",schema:[{name:"layout.step",selector:{select:{mode:"dropdown",options:Ft}}},{name:"step_size",selector:{select:{mode:"dropdown",options:It}}}]},{type:"grid",column_min_width:"160px",schema:[{name:"hide_setpoint",selector:{boolean:{}}},{name:"disable_setpoint_change",selector:{boolean:{}}},{name:"hide_setpoint_when_off",selector:{boolean:{}}},{name:"hide.setpoint_label",selector:{boolean:{}}},{name:"disable_setpoint_change_when_off",selector:{boolean:{}}},{name:"setpoint_hold_repeat",selector:{boolean:{}}}]}]}]:[],{type:"expandable",title:"Extra entity rows",schema:[{type:"grid",column_min_width:"160px",schema:[{name:"layout.entities.type",selector:{select:{mode:"dropdown",options:Lt}}},{name:"layout.entities.display",selector:{select:{mode:"dropdown",options:Vt}}},{name:"layout.entities.labels",selector:{boolean:{}}},{name:"layout.entities.separator",selector:{boolean:{}}},{name:"layout.entities.alignment",selector:{select:{mode:"dropdown",options:Ut}}}]}]},{type:"expandable",title:"Appearance",schema:[{name:"enhanced_visuals",selector:{boolean:{}}},{type:"grid",column_min_width:"160px",schema:l}].filter(Pt)},{type:"expandable",title:"Advanced",schema:[...c,...s?[{type:"grid",schema:[{name:"decimals",selector:{number:{min:0,max:5,step:1,mode:"box"}}},{name:"unit",selector:{text:{}}}]}]:[],{name:"fallback",selector:{text:{}}},{name:"setpoint_debounce_ms",selector:{number:{min:0,step:100,mode:"box"}}},{type:"grid",column_min_width:"160px",schema:d},{type:"grid",column_min_width:"150px",schema:[{name:"layout.mode.names",selector:{boolean:{}}},{name:"layout.mode.icons",selector:{boolean:{}}},{name:"layout.mode.headings",selector:{boolean:{}}}]},{type:"grid",column_min_width:"150px",schema:[{name:"tap_action.action",selector:{select:{mode:"dropdown",options:jt}}},{name:"hold_action.action",selector:{select:{mode:"dropdown",options:jt}}},{name:"double_tap_action.action",selector:{select:{mode:"dropdown",options:jt}}}]}].filter(Pt)}]}(this.config,this.hass),i=t.find(t=>"Extra entity rows"===t.title);return B`
|
||||
`}render(){if(!this.hass||!this.config)return B``;const t=function(t,e){const i=Jt(t,e),a=t.entity?.split(".")[0],o=kt(t.entity),n=t.entity?e?.states?.[t.entity]:void 0,r=!0===t.hide_setpoint||!n||Object.keys(o.getSetpoints(n.attributes??{})).length>0,s="fan"!==a&&("climate"===a||"humidifier"===a),c="fan"===a?[]:[{name:"current_value_entity",selector:{entity:{domain:["sensor","input_number"]}}}],l=[...s?[{name:"hide.temperature",selector:{boolean:{}}},{name:"hide_current_value_when_off",selector:{boolean:{}}}]:[],{name:"hide.state",selector:{boolean:{}}}],d=[...s?[{name:"label.temperature",selector:{text:{}}}]:[],{name:"label.state",selector:{text:{}}},...r?[{name:"label.setpoint",selector:{text:{}}}]:[]],h=!1===t.header?[]:[{type:"grid",schema:[{name:"name",selector:{text:{}}},{name:"icon",selector:{icon:{}}}]},{name:"toggle.entity",selector:{entity:{}}},{name:"toggle.name",selector:{text:{}}},...t.header&&"object"==typeof t.header&&t.header.toggle?.entity?[{name:"toggle.icon",selector:{icon:{}}}]:[]];return[{name:"entity",required:!0,selector:{entity:{domain:zt}}},{type:"expandable",title:"Card header",schema:[{name:"show_header",selector:{boolean:{}}},...h]},...i.length>0?[{type:"expandable",title:"Controls",schema:[{type:"grid",column_min_width:"150px",schema:i.map(t=>({name:`control.${t}`,selector:{boolean:{}}}))}]}]:[],...r?[{type:"expandable",title:"Target",schema:[{type:"grid",schema:[{name:"layout.step",selector:{select:{mode:"dropdown",options:Ft}}},{name:"step_size",selector:{select:{mode:"dropdown",options:It}}}]},{type:"grid",column_min_width:"160px",schema:[{name:"hide_setpoint",selector:{boolean:{}}},{name:"disable_setpoint_change",selector:{boolean:{}}},{name:"hide_setpoint_when_off",selector:{boolean:{}}},{name:"hide.setpoint_label",selector:{boolean:{}}},{name:"disable_setpoint_change_when_off",selector:{boolean:{}}},{name:"setpoint_hold_repeat",selector:{boolean:{}}}]}]}]:[],{type:"expandable",title:"Extra entity rows",schema:[{type:"grid",column_min_width:"160px",schema:[{name:"layout.entities.type",selector:{select:{mode:"dropdown",options:Lt}}},{name:"layout.entities.display",selector:{select:{mode:"dropdown",options:Vt}}},{name:"layout.entities.labels",selector:{boolean:{}}},{name:"layout.entities.separator",selector:{boolean:{}}},{name:"layout.entities.alignment",selector:{select:{mode:"dropdown",options:Ut}}}]}]},{type:"expandable",title:"Appearance",schema:[{name:"enhanced_visuals",selector:{boolean:{}}},{type:"grid",column_min_width:"160px",schema:l}].filter(Pt)},{type:"expandable",title:"Advanced",schema:[...c,...s?[{type:"grid",schema:[{name:"decimals",selector:{number:{min:0,max:5,step:1,mode:"box"}}},{name:"unit",selector:{text:{}}}]}]:[],{name:"fallback",selector:{text:{}}},{name:"setpoint_debounce_ms",selector:{number:{min:0,step:100,mode:"box"}}},{type:"grid",column_min_width:"160px",schema:d},{type:"grid",column_min_width:"150px",schema:[{name:"layout.mode.names",selector:{boolean:{}}},{name:"layout.mode.icons",selector:{boolean:{}}},{name:"layout.mode.headings",selector:{boolean:{}}}]},{type:"grid",column_min_width:"150px",schema:[{name:"tap_action.action",selector:{select:{mode:"dropdown",options:jt}}},{name:"hold_action.action",selector:{select:{mode:"dropdown",options:jt}}},{name:"double_tap_action.action",selector:{select:{mode:"dropdown",options:jt}}}]}].filter(Pt)}]}(this.config,this.hass),i=t.find(t=>"Extra entity rows"===t.title);return B`
|
||||
<div class="card-config">
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
@@ -2046,7 +2066,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
`}}i([mt()],ee.prototype,"config",void 0),i([pt({attribute:!1})],ee.prototype,"hass",void 0);const ie=2,oe=t=>(...e)=>({_$litDirective$:t,values:e});class ae{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const ne=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),ne(t,e);return!0},re=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},se=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),de(e)}};function ce(t){void 0!==this._$AN?(re(this),this._$AM=t,se(this)):this._$AM=t}function le(t,e=!1,i=0){const o=this._$AH,a=this._$AN;if(void 0!==a&&0!==a.size)if(e)if(Array.isArray(o))for(let t=i;t<o.length;t++)ne(o[t],!1),re(o[t]);else null!=o&&(ne(o,!1),re(o));else ne(this,t)}const de=t=>{t.type==ie&&(t._$AP??=le,t._$AQ??=ce)};class he extends ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),se(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ne(this,t),re(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const ue=new WeakMap,pe=oe(class extends he{render(t){return q}update(t,[e]){const i=e!==this.G;return i&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),q}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let i=ue.get(e);void 0===i&&(i=new WeakMap,ue.set(e,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?ue.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),me=["climate","fan","humidifier"],ge={style:"header",icons:!0,names:!0,states:!1};function fe(t){if("string"==typeof t)return{entity:t};const e=t?.header&&"object"==typeof t.header?t.header:void 0;return{...t,entity:t?.entity??"",name:t?.name??("string"==typeof e?.name?e.name:void 0),icon:t?.icon??("string"==typeof e?.icon?e.icon:void 0)}}function ve(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)||Array.isArray(e))return Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((t,i)=>ve(t,e[i]));if(!t||!e||"object"!=typeof t||"object"!=typeof e)return!1;const i=t,o=e,a=Object.keys(i);return a.length===Object.keys(o).length&&a.every(t=>ve(i[t],o[t]))}class ye extends lt{constructor(){super(...arguments),this.config={entities:[]},this.expandedTargetIndex=null,this.editorConfigKeys=new WeakMap}static get styles(){return c`
|
||||
`}}i([mt()],ee.prototype,"config",void 0),i([pt({attribute:!1})],ee.prototype,"hass",void 0);const ie=2,ae=t=>(...e)=>({_$litDirective$:t,values:e});class oe{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const ne=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),ne(t,e);return!0},re=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},se=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),de(e)}};function ce(t){void 0!==this._$AN?(re(this),this._$AM=t,se(this)):this._$AM=t}function le(t,e=!1,i=0){const a=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(a))for(let t=i;t<a.length;t++)ne(a[t],!1),re(a[t]);else null!=a&&(ne(a,!1),re(a));else ne(this,t)}const de=t=>{t.type==ie&&(t._$AP??=le,t._$AQ??=ce)};class he extends oe{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),se(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ne(this,t),re(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const ue=new WeakMap,pe=ae(class extends he{render(t){return q}update(t,[e]){const i=e!==this.G;return i&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),q}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let i=ue.get(e);void 0===i&&(i=new WeakMap,ue.set(e,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?ue.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),me=["climate","fan","humidifier"],ge={style:"header",icons:!0,names:!0,states:!1};function fe(t){if("string"==typeof t)return{entity:t};const e=t?.header&&"object"==typeof t.header?t.header:void 0;return{...t,entity:t?.entity??"",name:t?.name??("string"==typeof e?.name?e.name:void 0),icon:t?.icon??("string"==typeof e?.icon?e.icon:void 0)}}function ve(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)||Array.isArray(e))return Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((t,i)=>ve(t,e[i]));if(!t||!e||"object"!=typeof t||"object"!=typeof e)return!1;const i=t,a=e,o=Object.keys(i);return o.length===Object.keys(a).length&&o.every(t=>ve(i[t],a[t]))}class ye extends lt{constructor(){super(...arguments),this.config={entities:[]},this.expandedTargetIndex=null,this.editorConfigKeys=new WeakMap}static get styles(){return c`
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
@@ -2198,7 +2218,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
`}setConfig(t){this.config={...t}}commit(t){const e=this.cleanConfig(t);this.config=e,_t(this,"config-changed",{config:e})}cleanConfig(t){const e={...t};for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e.selector&&0===Object.keys(e.selector).length&&delete e.selector,e}getTargets(){return function(t){const e=(t.cards??t.entities??[]).map(fe);return e.length?e:[{entity:""},{entity:""}]}(this.config)}updateTarget(t,e){const i=this.getTargets(),o={...i[t],...e};if(o.header&&"object"==typeof o.header){o.header={...o.header};for(const t of["name","icon"]){if(!(t in e)||!(t in o.header))continue;const i=e[t]?.trim();i?o.header[t]=i:delete o.header[t]}}i[t]=o,this.commitTargets(i)}cleanTargets(t){return t.map(t=>{const e=t.entity?.trim()??"",i="string"==typeof t.name?t.name.trim():void 0,o="string"==typeof t.icon?t.icon.trim():void 0,{name:a,icon:n,entity:r,...s}=t;return i||o||0!==Object.keys(s).length?{...s,entity:e,...i?{name:i}:{},...o?{icon:o}:{}}:e})}addTarget(){const t=[...this.getTargets(),{entity:""}];this.commitTargets(t)}removeTarget(t){const e=this.getTargets().filter((e,i)=>i!==t);this.expandedTargetIndex===t?this.expandedTargetIndex=null:null!==this.expandedTargetIndex&&this.expandedTargetIndex>t&&this.expandedTargetIndex--,this.commitTargets(e.length?e:[{entity:""}])}moveTarget(t,e){const i=this.getTargets(),o=t+e;t<0||t>=i.length||o<0||o>=i.length||(i.splice(o,0,i.splice(t,1)[0]),this.expandedTargetIndex===t?this.expandedTargetIndex=o:this.expandedTargetIndex===o&&(this.expandedTargetIndex=t),this.commitTargets(i))}commitTargets(t){const{entities:e,...i}=this.config;this.commit({...i,cards:this.cleanTargets(t)})}updateSelector(t,e){const i={...this.config.selector??{}},o=Boolean(e);o===ge[t]?delete i[t]:i[t]=o,this.commit({...this.config,selector:i})}updateSelectorStyle(t){const e={...this.config.selector??{}},i="tabs"===t?"tabs":"header";i===ge.style?delete e.style:e.style=i,this.commit({...this.config,selector:e})}renderSelectorStyleOption(t,e,i){return B`
|
||||
`}setConfig(t){this.config={...t}}commit(t){const e=this.cleanConfig(t);this.config=e,_t(this,"config-changed",{config:e})}cleanConfig(t){const e={...t};for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e.selector&&0===Object.keys(e.selector).length&&delete e.selector,e}getTargets(){return function(t){const e=(t.cards??t.entities??[]).map(fe);return e.length?e:[{entity:""},{entity:""}]}(this.config)}updateTarget(t,e){const i=this.getTargets(),a={...i[t],...e};if(a.header&&"object"==typeof a.header){a.header={...a.header};for(const t of["name","icon"]){if(!(t in e)||!(t in a.header))continue;const i=e[t]?.trim();i?a.header[t]=i:delete a.header[t]}}i[t]=a,this.commitTargets(i)}cleanTargets(t){return t.map(t=>{const e=t.entity?.trim()??"",i="string"==typeof t.name?t.name.trim():void 0,a="string"==typeof t.icon?t.icon.trim():void 0,{name:o,icon:n,entity:r,...s}=t;return i||a||0!==Object.keys(s).length?{...s,entity:e,...i?{name:i}:{},...a?{icon:a}:{}}:e})}addTarget(){const t=[...this.getTargets(),{entity:""}];this.commitTargets(t)}removeTarget(t){const e=this.getTargets().filter((e,i)=>i!==t);this.expandedTargetIndex===t?this.expandedTargetIndex=null:null!==this.expandedTargetIndex&&this.expandedTargetIndex>t&&this.expandedTargetIndex--,this.commitTargets(e.length?e:[{entity:""}])}moveTarget(t,e){const i=this.getTargets(),a=t+e;t<0||t>=i.length||a<0||a>=i.length||(i.splice(a,0,i.splice(t,1)[0]),this.expandedTargetIndex===t?this.expandedTargetIndex=a:this.expandedTargetIndex===a&&(this.expandedTargetIndex=t),this.commitTargets(i))}commitTargets(t){const{entities:e,...i}=this.config;this.commit({...i,cards:this.cleanTargets(t)})}updateSelector(t,e){const i={...this.config.selector??{}},a=Boolean(e);a===ge[t]?delete i[t]:i[t]=a,this.commit({...this.config,selector:i})}updateSelectorStyle(t){const e={...this.config.selector??{}},i="tabs"===t?"tabs":"header";i===ge.style?delete e.style:e.style=i,this.commit({...this.config,selector:e})}renderSelectorStyleOption(t,e,i){return B`
|
||||
<ha-button
|
||||
class=${i?"selected":""}
|
||||
appearance=${i?"filled":"outlined"}
|
||||
@@ -2207,7 +2227,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
>
|
||||
${t}
|
||||
</ha-button>
|
||||
`}isAutoSelectEnabled(){const t=this.config.auto_select;return!0===t||"recent_activity"===t||"object"==typeof t&&"recent_activity"===t?.mode}updateAutoSelect(t){const{auto_select:e,...i}=this.config;this.commit({...i,...t?{auto_select:{mode:"recent_activity"}}:{}})}updateRememberSelection(t){const{remember_selection:e,...i}=this.config;this.commit({...i,...t?{}:{remember_selection:!1}})}updateStorageKey(t){const e=t.trim(),{storage_key:i,...o}=this.config;this.commit({...o,...e?{storage_key:e}:{}})}getTargetCardConfig(e){const{name:i,icon:o,...a}=e,n={...this.config.card??{},...a};let r=n.header&&"object"==typeof n.header?{...n.header}:void 0;return i&&!1!==n.header&&void 0===r?.name&&(r??={},r.name=i),o&&!1!==n.header&&void 0===r?.icon&&(r??={},r.icon=o),{type:n.type??`custom:${t}`,...n,...!1===n.header?{header:!1}:r?{header:r}:{}}}configureNestedEditor(t,e){if(!t)return;const i=t,o=this.getTargetCardConfig(e),a=JSON.stringify(o);i.hass=this.hass,this.editorConfigKeys.get(t)!==a&&(i.setConfig?.(o),this.editorConfigKeys.set(t,a))}updateTargetCardConfig(t,e){e.stopPropagation();const i=this.getTargets(),o={...e.detail.config??{}},a=this.config.card??{};"step_size"in a&&!("step_size"in o)&&(o.step_size=null),"entities"in a&&!("entities"in o)&&(o.entities=!1),Object.keys(a).forEach(t=>{"entity"!==t&&ve(o[t],a[t])&&delete o[t]}),delete o.embedded,i[t]=fe(o),this.commitTargets(i)}toggleTargetEditor(t){this.expandedTargetIndex=this.expandedTargetIndex===t?null:t}renderEntityPicker(t,e){return B`
|
||||
`}isAutoSelectEnabled(){const t=this.config.auto_select;return!0===t||"recent_activity"===t||"object"==typeof t&&"recent_activity"===t?.mode}updateAutoSelect(t){const{auto_select:e,...i}=this.config;this.commit({...i,...t?{auto_select:{mode:"recent_activity"}}:{}})}updateRememberSelection(t){const{remember_selection:e,...i}=this.config;this.commit({...i,...t?{}:{remember_selection:!1}})}updateStorageKey(t){const e=t.trim(),{storage_key:i,...a}=this.config;this.commit({...a,...e?{storage_key:e}:{}})}getTargetCardConfig(e){const{name:i,icon:a,...o}=e,n={...this.config.card??{},...o};let r=n.header&&"object"==typeof n.header?{...n.header}:void 0;return i&&!1!==n.header&&void 0===r?.name&&(r??={},r.name=i),a&&!1!==n.header&&void 0===r?.icon&&(r??={},r.icon=a),{type:n.type??`custom:${t}`,...n,...!1===n.header?{header:!1}:r?{header:r}:{}}}configureNestedEditor(t,e){if(!t)return;const i=t,a=this.getTargetCardConfig(e),o=JSON.stringify(a);i.hass=this.hass,this.editorConfigKeys.get(t)!==o&&(i.setConfig?.(a),this.editorConfigKeys.set(t,o))}updateTargetCardConfig(t,e){e.stopPropagation();const i=this.getTargets(),a={...e.detail.config??{}},o=this.config.card??{};"step_size"in o&&!("step_size"in a)&&(a.step_size=null),"entities"in o&&!("entities"in a)&&(a.entities=!1),Object.keys(o).forEach(t=>{"entity"!==t&&ve(a[t],o[t])&&delete a[t]}),delete a.embedded,i[t]=fe(a),this.commitTargets(i)}toggleTargetEditor(t){this.expandedTargetIndex=this.expandedTargetIndex===t?null:t}renderEntityPicker(t,e){return B`
|
||||
<ha-entity-picker
|
||||
.hass=${this.hass}
|
||||
.value=${t.entity}
|
||||
@@ -2316,7 +2336,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
@input=${t=>this.updateStorageKey(t.target.value)}
|
||||
></ha-textfield>
|
||||
</div>
|
||||
`}renderOption(t,e,i,o){return B`
|
||||
`}renderOption(t,e,i,a){return B`
|
||||
<div class="option-row">
|
||||
<div class="option-text">
|
||||
<span class="option-title">${t}</span>
|
||||
@@ -2325,10 +2345,10 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
<ha-switch
|
||||
aria-label=${t}
|
||||
.checked=${i}
|
||||
@change=${t=>o(t.currentTarget.checked)}
|
||||
@change=${t=>a(t.currentTarget.checked)}
|
||||
></ha-switch>
|
||||
</div>
|
||||
`}}function be(t){return"string"==typeof t?.state&&"unavailable"!==t.state&&("unknown"!==t.state||["button","input_button","scene"].includes(t.entity_id?.split(".")[0]??""))}function _e(t){if("string"!=typeof t.entity_id)return;const[e]=t.entity_id.split(".");return"climate"===e?"hvac_action":"humidifier"===e?"action":void 0}function we(t){const e=_e(t),i=e?t.attributes?.[e]:void 0;return"string"==typeof i&&i?i:void 0}function xe(t,e,i){if("string"!=typeof t.entity_id)return void 0===t.state?"":String(t.state);const[o]=t.entity_id.split("."),a=we(t),n=_e(t);if(a)return"function"==typeof e.formatEntityAttributeValue&&n?e.formatEntityAttributeValue(t,n):i(a,function(t){if("string"!=typeof t.entity_id)return"";const[e]=t.entity_id.split("."),i=_e(t);return e&&i?`state_attributes.${e}.${i}.`:""}(t));if("fan"===o&&"on"===t.state){if(t.attributes?.preset_mode)return"function"==typeof e.formatEntityAttributeValue?e.formatEntityAttributeValue(t,"preset_mode"):i(t.attributes.preset_mode,"state_attributes.fan.preset_mode.");if("number"==typeof t.attributes?.percentage)return"function"==typeof e.formatEntityAttributeValue?e.formatEntityAttributeValue(t,"percentage"):`${t.attributes.percentage}%`;if(t.attributes?.speed)return String(t.attributes.speed)}return"function"==typeof e.formatEntityState?e.formatEntityState(t):i(String(t.state),`component.${o}.state._.`)}i([pt({attribute:!1})],ye.prototype,"hass",void 0),i([mt()],ye.prototype,"config",void 0),i([mt()],ye.prototype,"expandedTargetIndex",void 0);const $e={auto:"mdi:radiator",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:radiator-disabled",on:"mdi:power",off:"mdi:radiator-off"},Se={auto:"mdi:air-conditioner",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:air-conditioner",on:"mdi:air-conditioner",off:"mdi:air-conditioner"},Ae={...$e,auto:"mdi:radiator",idle:$e.idle,off:"mdi:radiator"},ke={fan:{on:"mdi:fan",off:"mdi:fan-off"},humidifier:{on:"mdi:air-humidifier",off:"mdi:air-humidifier-off"}},Ee={auto:"hass:autorenew",cool:"hass:snowflake",dry:"hass:water-percent",fan_only:"hass:fan",heat_cool:"hass:autorenew",heat:"hass:fire",on:"hass:power",off:"hass:power",forward:"mdi:arrow-right",reverse:"mdi:arrow-left",true:"mdi:fan",false:"mdi:fan-off",low:"mdi:fan-speed-1",mid:"mdi:fan-speed-2",medium:"mdi:fan-speed-2",high:"mdi:fan-speed-3",max:"st:fan-speed-4",turbo:"st:fan-speed-5",1:"mdi:fan-speed-1",2:"mdi:fan-speed-2",3:"mdi:fan-speed-3",4:"st:fan-speed-4",5:"st:fan-speed-5",automatic:"mdi:fan-auto",powerful:"mdi:fan-plus",quiet:"mdi:fan-minus",silent:"mdi:fan-minus",normal:"mdi:water-percent",vertical:"mdi:arrow-up-down",top:"mdi:arrow-up","top-middle":"mdi:arrow-top-right",middle:"mdi:arrow-collapse-vertical","middle-bottom":"mdi:arrow-bottom-right",bottom:"mdi:arrow-down",upper:"mdi:arrow-up",lower:"mdi:arrow-down",horizontal:"mdi:arrow-left-right",left:"mdi:arrow-left","center-left":"mdi:arrow-top-left",center:"mdi:arrow-collapse-horizontal","center-right":"mdi:arrow-top-right",right:"mdi:arrow-right",both:"mdi:arrow-all",swing:"mdi:arrow-oscillating",wide:"mdi:arrow-expand-horizontal",narrow:"mdi:arrow-collapse-horizontal",split:"mdi:arrow-split-vertical",none:"mdi:circle-off-outline",frost:"mdi:snowflake",frost_protection:"mdi:snowflake","frost-protection":"mdi:snowflake",frost_protect:"mdi:snowflake",away:"mdi:home-export-outline",eco:"mdi:leaf",boost:"mdi:weather-windy",comfort:"mdi:sofa",auto_comfort:"mdi:sofa","auto-comfort":"mdi:sofa","auto comfort":"mdi:sofa",home:"mdi:home",sleep:"mdi:sleep",activity:"mdi:run"};function ze(t){const e=String(t),i=e.toLowerCase().replace(/\s+/g,"_");return Ee[e]??Ee[i]}function Ce(t){const e=String(t);return{low:"Low",mid:"Mid",medium:"Medium",high:"High",max:"Max",turbo:"Turbo",auto:"Auto"}[e.toLowerCase().replace(/\s+/g,"_")]??e}function Te(t,e,i,o=!0){if(!1===t)return!1;let a;a="string"==typeof t?.name?t.name:!1!==t?.name&&("function"==typeof i.formatEntityName?i.formatEntityName(e):e.attributes.friendly_name);let n=o?function(t){const[e]=t.entity_id.split("."),i=we(t),o=i?Ne(t):void 0;return o??t.attributes.icon??Ne(t)??ke[e]?.[t.state]??(i?$e:Ee)}(e):function(t){return we(t)?$e:Ee}(e);return void 0!==t?.icon&&(n=t.icon),{name:a,icon:n,slashOffIcon:o&&Me(e,n),toggle:t?.toggle?Re(t.toggle,i):null,toggles:Oe(t,i),faults:Pe(t?.faults,i)}}function Re(t,e){const i=e.states[t.entity];if(!i)return null;let o="";return o=!0===t?.name?i.attributes.friendly_name:t?.name??"",{entity:i,label:o,icon:t?.icon??!1,hide_when_off:t?.hide_when_off}}function Oe(t,e){return[...t?.toggle?[t.toggle]:[],...Array.isArray(t?.toggles)?t.toggles:[]].map(t=>Re(t,e)).filter(t=>!!t)}function Ne(t){const[e]=t.entity_id.split(".");if("climate"!==e)return;const i=Array.isArray(t.attributes?.hvac_modes)?t.attributes.hvac_modes:[],o=we(t),a=String(o||t.state);return i.includes("cool")||i.includes("dry")||i.includes("fan_only")||["cool","cooling","dry","fan_only","fan"].includes(a)?Se:Ae}function Me(t,e
Line truncated
|
||||
`}}function be(t){return"string"==typeof t?.state&&"unavailable"!==t.state&&("unknown"!==t.state||["button","input_button","scene"].includes(t.entity_id?.split(".")[0]??""))}function _e(t){if("string"!=typeof t.entity_id)return;const[e]=t.entity_id.split(".");return"climate"===e?"hvac_action":"humidifier"===e?"action":void 0}function we(t){const e=_e(t),i=e?t.attributes?.[e]:void 0;return"string"==typeof i&&i?i:void 0}function xe(t,e,i){if("string"!=typeof t.entity_id)return void 0===t.state?"":String(t.state);const[a]=t.entity_id.split("."),o=we(t),n=_e(t);if(o)return"function"==typeof e.formatEntityAttributeValue&&n?e.formatEntityAttributeValue(t,n):i(o,function(t){if("string"!=typeof t.entity_id)return"";const[e]=t.entity_id.split("."),i=_e(t);return e&&i?`state_attributes.${e}.${i}.`:""}(t));if("fan"===a&&"on"===t.state){if(t.attributes?.preset_mode)return"function"==typeof e.formatEntityAttributeValue?e.formatEntityAttributeValue(t,"preset_mode"):i(t.attributes.preset_mode,"state_attributes.fan.preset_mode.");if("number"==typeof t.attributes?.percentage)return"function"==typeof e.formatEntityAttributeValue?e.formatEntityAttributeValue(t,"percentage"):`${t.attributes.percentage}%`;if(t.attributes?.speed)return String(t.attributes.speed)}return"function"==typeof e.formatEntityState?e.formatEntityState(t):i(String(t.state),`component.${a}.state._.`)}i([pt({attribute:!1})],ye.prototype,"hass",void 0),i([mt()],ye.prototype,"config",void 0),i([mt()],ye.prototype,"expandedTargetIndex",void 0);const $e={auto:"mdi:radiator",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:radiator-disabled",on:"mdi:power",off:"mdi:radiator-off"},Se={auto:"mdi:air-conditioner",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:air-conditioner",on:"mdi:air-conditioner",off:"mdi:air-conditioner"},Ae={...$e,auto:"mdi:radiator",idle:$e.idle,off:"mdi:radiator"},ke={fan:{on:"mdi:fan",off:"mdi:fan-off"},humidifier:{on:"mdi:air-humidifier",off:"mdi:air-humidifier-off"}},Ee={auto:"hass:autorenew",cool:"hass:snowflake",dry:"hass:water-percent",fan_only:"hass:fan",heat_cool:"hass:autorenew",heat:"hass:fire",on:"hass:power",off:"hass:power",forward:"mdi:arrow-right",reverse:"mdi:arrow-left",true:"mdi:fan",false:"mdi:fan-off",low:"mdi:fan-speed-1",mid:"mdi:fan-speed-2",medium:"mdi:fan-speed-2",high:"mdi:fan-speed-3",max:"st:fan-speed-4",turbo:"st:fan-speed-5",1:"mdi:fan-speed-1",2:"mdi:fan-speed-2",3:"mdi:fan-speed-3",4:"st:fan-speed-4",5:"st:fan-speed-5",automatic:"mdi:fan-auto",powerful:"mdi:fan-plus",quiet:"mdi:fan-minus",silent:"mdi:fan-minus",normal:"mdi:water-percent",vertical:"mdi:arrow-up-down",top:"mdi:arrow-up","top-middle":"mdi:arrow-top-right",middle:"mdi:arrow-collapse-vertical","middle-bottom":"mdi:arrow-bottom-right",bottom:"mdi:arrow-down",upper:"mdi:arrow-up",lower:"mdi:arrow-down",horizontal:"mdi:arrow-left-right",left:"mdi:arrow-left","center-left":"mdi:arrow-top-left",center:"mdi:arrow-collapse-horizontal","center-right":"mdi:arrow-top-right",right:"mdi:arrow-right",both:"mdi:arrow-all",swing:"mdi:arrow-oscillating",wide:"mdi:arrow-expand-horizontal",narrow:"mdi:arrow-collapse-horizontal",split:"mdi:arrow-split-vertical",none:"mdi:circle-off-outline",frost:"mdi:snowflake",frost_protection:"mdi:snowflake","frost-protection":"mdi:snowflake",frost_protect:"mdi:snowflake",away:"mdi:home-export-outline",eco:"mdi:leaf",boost:"mdi:weather-windy",comfort:"mdi:sofa",auto_comfort:"mdi:sofa","auto-comfort":"mdi:sofa","auto comfort":"mdi:sofa",home:"mdi:home",sleep:"mdi:sleep",activity:"mdi:run"};function ze(t){const e=String(t),i=e.toLowerCase().replace(/\s+/g,"_");return Ee[e]??Ee[i]}function Ce(t){const e=String(t);return{low:"Low",mid:"Mid",medium:"Medium",high:"High",max:"Max",turbo:"Turbo",auto:"Auto"}[e.toLowerCase().replace(/\s+/g,"_")]??e}function Te(t,e,i,a=!0){if(!1===t)return!1;let o;o="string"==typeof t?.name?t.name:!1!==t?.name&&("function"==typeof i.formatEntityName?i.formatEntityName(e):e.attributes.friendly_name);let n=a?function(t){const[e]=t.entity_id.split("."),i=we(t),a=i?Ne(t):void 0;return a??t.attributes.icon??Ne(t)??ke[e]?.[t.state]??(i?$e:Ee)}(e):function(t){return we(t)?$e:Ee}(e);return void 0!==t?.icon&&(n=t.icon),{name:o,icon:n,slashOffIcon:a&&Me(e,n),toggle:t?.toggle?Re(t.toggle,i):null,toggles:Oe(t,i),faults:Pe(t?.faults,i)}}function Re(t,e){const i=e.states[t.entity];if(!i)return null;let a="";return a=!0===t?.name?i.attributes.friendly_name:t?.name??"",{entity:i,label:a,icon:t?.icon??!1,hide_when_off:t?.hide_when_off}}function Oe(t,e){return[...t?.toggle?[t.toggle]:[],...Array.isArray(t?.toggles)?t.toggles:[]].map(t=>Re(t,e)).filter(t=>!!t)}function Ne(t){const[e]=t.entity_id.split(".");if("climate"!==e)return;const i=Array.isArray(t.attributes?.hvac_modes)?t.attributes.hvac_modes:[],a=we(t),o=String(a||t.state);return i.includes("cool")||i.includes("dry")||i.includes("fan_only")||["cool","cooling","dry","fan_only","fan"].includes(o)?Se:Ae}function Me(t,e
Line truncated
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
@@ -2973,33 +2993,33 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
animation: st-group-fan-spin var(--st-fan-spin-duration, 2.4s) linear
|
||||
infinite;
|
||||
}
|
||||
`}static getConfigElement(){return window.document.createElement(`${t}-group-editor`)}static getStubConfig(t){return{entities:Object.keys(t?.states??{}).filter(t=>Fe.includes(Ie(t))).slice(0,2),card:{}}}setConfig(t){this.clearAutoSelectResumeTimer();const e=(t.cards??t.entities??[]).map(He).filter(Boolean);if(!e.length)throw new Error("Simple Thermostat Group requires at least one card");this.config={...t,selector:{...je,...t.selector??{}}},this.targets=e,this.activityRecords.clear();try{const i=JSON.parse(window.localStorage.getItem(`${this.getActivityStorageKey(t)}:v2`)??"[]");Array.isArray(i)&&i.forEach(t=>{e.some(e=>e.entity===t?.entity)&&"string"==typeof t.signature&&Number.isFinite(t.timestamp)&&this.activityRecords.set(t.entity,t)})}catch{}this.selectedEntity=this.getInitialSelection(t,e),this.activitySignatures.clear(),this.activitySignaturesInitialized=!1,this.persistedActivityApplied=!1}updated(){this.syncAutoSelectRecentActivity(),this.syncEmbeddedCard(),this.syncOutsideClickListener(),this.syncTitleFit()}connectedCallback(){super.connectedCallback(),this.attachPresentationResizeListeners(),this.resumeAutoSelectAfterReconnect()}getCardSize(){if(!this.config||!this.targets.length)return 1;const t=this.embeddedCard?.getCardSize?.();if("number"==typeof t&&Number.isFinite(t))return Math.max(1,t);const e=this.getSelectedTarget(),i=this.getTargetCardConfig(e),o=Array.isArray(i.entities)?i.entities.length:0,a=o?Math.max(1,Math.ceil(o/2)):0,n=this.getConfiguredModeRowCount(i),r=!0===i.hide_setpoint?0:1;return Math.max(2,1+a+r+n)}disconnectedCallback(){this.clearOutsideClickListener(),this.clearAutoSelectResumeTimer(),this.clearEmbeddedResizeObserver(),this.detachPresentationResizeListeners(),super.disconnectedCallback()}attachPresentationResizeListeners(){this.presentationResizeListenersAttached||(window.addEventListener("resize",this.handlePresentationResize),window.addEventListener("orientationchange",this.handlePresentationResize),this.presentationResizeListenersAttached=!0)}detachPresentationResizeListeners(){this.presentationResizeListenersAttached&&(window.removeEventListener("resize",this.handlePresentationResize),window.removeEventListener("orientationchange",this.handlePresentationResize),this.presentationResizeListenersAttached=!1)}getInitialSelection(t,e){const i=new Set(e.map(t=>t.entity)),o=!1===t.remember_selection?"":this.readStoredSelection(t);return o&&i.has(o)?o:t.selected&&i.has(t.selected)?t.selected:e[0].entity}readStoredSelection(t){return this.readStoredSelectionRecord(t)?.entity??""}readStoredSelectionRecord(t){try{const e=window.localStorage?.getItem(this.getStorageKey(t));if(!e)return;if(!e.trim().startsWith("{"))return{entity:e,timestamp:0};const i=JSON.parse(e);if("string"==typeof i.entity)return{entity:i.entity,timestamp:Number.isFinite(i.timestamp)?Number(i.timestamp):0}}catch(t){return}}writeStoredSelection(t){if(this.config&&!1!==this.config.remember_selection)try{window.localStorage?.setItem(this.getStorageKey(this.config),JSON.stringify({entity:t,timestamp:Date.now()}))}catch(t){}}readStoredActivity(t){try{const e=window.localStorage?.getItem(this.getActivityStorageKey(t));if(!e)return;const i=JSON.parse(e);if("string"==typeof i.entity&&"string"==typeof i.signature&&Number.isFinite(i.timestamp))return{entity:i.entity,signature:i.signature,timestamp:Number(i.timestamp)}}catch(t){return}}writeStoredActivity(t){if(this.config)try{window.localStorage?.setItem(this.getActivityStorageKey(this.config),JSON.stringify(t))}catch(t){}}getStorageKey(t){if(t.storage_key)return`simple-thermostat-group:${t.storage_key}`;return`simple-thermostat-group:${this.targets.map(t=>t.entity).join("|")}`}getActivityStorageKey(t){return`${this.getStorageKey(t)}:recent-activity`}getConfiguredModeRowCount(t){const e=t.control;return!1===e?0:Array.isArray(e)?e.filter(Boolean).length:e&&"object"==typeof e?Object.entries(e).filter(([t,e])=>!t.startsWith("_")&&!1!==e).length:1}clearAutoSelectResumeTimer(){void 0!==this.autoSelectResumeTimer&&(window.clearTimeout(this.autoSelectResumeTimer),this.autoSelectResumeTimer=void 0)}scheduleAutoSelectResume(t){this.clearAutoSelectResumeTimer(),this.autoSelectResumeTimer=window.setTimeout(()=>{this.autoSelectResumeTimer=void 0,this.lastManualSelectionAt=0,this.isRecentActivityAutoSelectEnabled()&&!this.menuOpen&&this.selectMostRecentStateActivity()},Math.max(0,t))}resumeAutoSelectAfterReconnect(){if(!this.lastManualSelectionAt||!this.isRecentActivityAutoSelectEnabled())return;const t=Date.now()-this.lastManualSelectionAt;this.scheduleAutoSelectResume(this.getAutoSelectManualPauseMs()-t)}getSelectedTarget(){return this.targets.find(t=>t.entity===this.selectedEntity)??this.targets[0]}getSelectedState(){const t=this.getSelectedTarget();return this.hass?.states?.[t.entity]}openSelectedPopover(){const t=this.getSelectedTarget();t?.entity&&_t(this,"hass-more-info",{entityId:t.entity})}onSelectorHeaderKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),thi
Line truncated
|
||||
`}static getConfigElement(){return window.document.createElement(`${t}-group-editor`)}static getStubConfig(t){return{entities:Object.keys(t?.states??{}).filter(t=>Fe.includes(Ie(t))).slice(0,2),card:{}}}setConfig(t){this.clearAutoSelectResumeTimer();const e=(t.cards??t.entities??[]).map(He).filter(Boolean);if(!e.length)throw new Error("Simple Thermostat Group requires at least one card");this.config={...t,selector:{...je,...t.selector??{}}},this.targets=e,this.activityRecords.clear();try{const i=JSON.parse(window.localStorage.getItem(`${this.getActivityStorageKey(t)}:v2`)??"[]");Array.isArray(i)&&i.forEach(t=>{e.some(e=>e.entity===t?.entity)&&"string"==typeof t.signature&&Number.isFinite(t.timestamp)&&this.activityRecords.set(t.entity,t)})}catch{}this.selectedEntity=this.getInitialSelection(t,e),this.activitySignatures.clear(),this.activitySignaturesInitialized=!1,this.persistedActivityApplied=!1}updated(){this.reconcileAvailableSelection(),this.syncAutoSelectRecentActivity(),this.syncEmbeddedCard(),this.syncOutsideClickListener(),this.syncTitleFit()}connectedCallback(){super.connectedCallback(),this.attachPresentationResizeListeners(),this.resumeAutoSelectAfterReconnect()}getCardSize(){if(!this.config||!this.getAvailableTargets().length)return 1;const t=this.embeddedCard?.getCardSize?.();if("number"==typeof t&&Number.isFinite(t))return Math.max(1,t);const e=this.getSelectedTarget();if(!e)return 1;const i=this.getTargetCardConfig(e),a=Array.isArray(i.entities)?i.entities.length:0,o=a?Math.max(1,Math.ceil(a/2)):0,n=this.getConfiguredModeRowCount(i),r=!0===i.hide_setpoint?0:1;return Math.max(2,1+o+r+n)}disconnectedCallback(){this.clearOutsideClickListener(),this.clearAutoSelectResumeTimer(),this.clearEmbeddedResizeObserver(),this.detachPresentationResizeListeners(),super.disconnectedCallback()}attachPresentationResizeListeners(){this.presentationResizeListenersAttached||(window.addEventListener("resize",this.handlePresentationResize),window.addEventListener("orientationchange",this.handlePresentationResize),this.presentationResizeListenersAttached=!0)}detachPresentationResizeListeners(){this.presentationResizeListenersAttached&&(window.removeEventListener("resize",this.handlePresentationResize),window.removeEventListener("orientationchange",this.handlePresentationResize),this.presentationResizeListenersAttached=!1)}getInitialSelection(t,e){const i=new Set(e.map(t=>t.entity)),a=!1===t.remember_selection?"":this.readStoredSelection(t);return a&&i.has(a)?a:t.selected&&i.has(t.selected)?t.selected:e[0].entity}readStoredSelection(t){return this.readStoredSelectionRecord(t)?.entity??""}readStoredSelectionRecord(t){try{const e=window.localStorage?.getItem(this.getStorageKey(t));if(!e)return;if(!e.trim().startsWith("{"))return{entity:e,timestamp:0};const i=JSON.parse(e);if("string"==typeof i.entity)return{entity:i.entity,timestamp:Number.isFinite(i.timestamp)?Number(i.timestamp):0}}catch(t){return}}writeStoredSelection(t){if(this.config&&!1!==this.config.remember_selection)try{window.localStorage?.setItem(this.getStorageKey(this.config),JSON.stringify({entity:t,timestamp:Date.now()}))}catch(t){}}readStoredActivity(t){try{const e=window.localStorage?.getItem(this.getActivityStorageKey(t));if(!e)return;const i=JSON.parse(e);if("string"==typeof i.entity&&"string"==typeof i.signature&&Number.isFinite(i.timestamp))return{entity:i.entity,signature:i.signature,timestamp:Number(i.timestamp)}}catch(t){return}}writeStoredActivity(t){if(this.config)try{window.localStorage?.setItem(this.getActivityStorageKey(this.config),JSON.stringify(t))}catch(t){}}getStorageKey(t){if(t.storage_key)return`simple-thermostat-group:${t.storage_key}`;return`simple-thermostat-group:${this.targets.map(t=>t.entity).join("|")}`}getActivityStorageKey(t){return`${this.getStorageKey(t)}:recent-activity`}getConfiguredModeRowCount(t){const e=t.control;return!1===e?0:Array.isArray(e)?e.filter(Boolean).length:e&&"object"==typeof e?Object.entries(e).filter(([t,e])=>!t.startsWith("_")&&!1!==e).length:1}clearAutoSelectResumeTimer(){void 0!==this.autoSelectResumeTimer&&(window.clearTimeout(this.autoSelectResumeTimer),this.autoSelectResumeTimer=void 0)}scheduleAutoSelectResume(t){this.clearAutoSelectResumeTimer(),this.autoSelectResumeTimer=window.setTimeout(()=>{this.autoSelectResumeTimer=void 0,this.lastManualSelectionAt=0,this.isRecentActivityAutoSelectEnabled()&&!this.menuOpen&&this.selectMostRecentStateActivity()},Math.max(0,t))}resumeAutoSelectAfterReconnect(){if(!this.lastManualSelectionAt||!this.isRecentActivityAutoSelectEnabled())return;const t=Date.now()-this.lastManualSelectionAt;this.scheduleAutoSelectResume(this.getAutoSelectManualPauseMs()-t)}getSelectedTarget(){const t=this.getAvailableTargets();return t.find(t=>t.entity===this.selectedEntity)??t[0]}getAvailableTargets(){return this.hass?this.targets.filter(t=>be(this.hass.states?.[t.entity])):this.targets}reconcileAvailableSelection(){const t=this.getAvailableTargets();t.length?t.some(t=>t.ent
Line truncated
|
||||
<div class="group-toggles">
|
||||
${e.map(t=>{const e=this.hass?.states?.[t.entity],i=!0===t.name?e?.attributes?.friendly_name:"string"==typeof t.name?t.name:e?.attributes?.friendly_name,o=t.icon||e?.attributes?.icon;return B`
|
||||
${e.map(t=>{const e=this.hass?.states?.[t.entity],i=!0===t.name?e?.attributes?.friendly_name:"string"==typeof t.name?t.name:e?.attributes?.friendly_name,a=t.icon||e?.attributes?.icon;return B`
|
||||
<div class="group-toggle">
|
||||
<ha-switch
|
||||
.checked=${"on"===e?.state}
|
||||
.disabled=${!be(e)}
|
||||
@change=${e=>this.toggleHeaderEntity(e,t.entity)}
|
||||
></ha-switch>
|
||||
${o?B`<ha-icon
|
||||
${a?B`<ha-icon
|
||||
title=${i||t.entity}
|
||||
icon=${o}
|
||||
icon=${a}
|
||||
></ha-icon>`:i?B`<span class="group-toggle-label">${i}</span>`:q}
|
||||
${i&&o?B`<span class="group-toggle-label" title=${i}
|
||||
${i&&a?B`<span class="group-toggle-label" title=${i}
|
||||
>${i}</span
|
||||
>`:q}
|
||||
</div>
|
||||
`})}
|
||||
</div>
|
||||
`:q}toggleMenu(){this.targets.length<2||(this.menuOpen=!this.menuOpen)}clearOutsideClickListener(){this.removeOutsideClickListener?.(),this.removeOutsideClickListener=void 0}syncTitleFit(){window.requestAnimationFrame(()=>{const t=this.renderRoot.querySelector(".group-title");if(!t)return;t.style.removeProperty("--st-group-title-fit-size"),t.style.removeProperty("--st-group-title-fit-line-height");const e=t.clientWidth,i=t.scrollWidth;if(!e||i<=e)return;const o=window.getComputedStyle(t),a=Number.parseFloat(o.fontSize)||24,n=Math.max(14,Math.floor(a*(e/i)*100)/100);t.style.setProperty("--st-group-title-fit-size",`${n}px`),t.style.setProperty("--st-group-title-fit-line-height",`${n}px`)})}syncOutsideClickListener(){if(!this.menuOpen)return void this.clearOutsideClickListener();if(this.removeOutsideClickListener)return;const t=t=>{t.composedPath().includes(this)||(this.menuOpen=!1)};window.addEventListener("pointerdown",t,{capture:!0}),this.removeOutsideClickListener=()=>window.removeEventListener("pointerdown",t,{capture:!0})}renderPicker(){return this.menuOpen?B`
|
||||
`:q}toggleMenu(){this.getAvailableTargets().length<2||(this.menuOpen=!this.menuOpen)}clearOutsideClickListener(){this.removeOutsideClickListener?.(),this.removeOutsideClickListener=void 0}syncTitleFit(){window.requestAnimationFrame(()=>{const t=this.renderRoot.querySelector(".group-title");if(!t)return;t.style.removeProperty("--st-group-title-fit-size"),t.style.removeProperty("--st-group-title-fit-line-height");const e=t.clientWidth,i=t.scrollWidth;if(!e||i<=e)return;const a=window.getComputedStyle(t),o=Number.parseFloat(a.fontSize)||24,n=Math.max(14,Math.floor(o*(e/i)*100)/100);t.style.setProperty("--st-group-title-fit-size",`${n}px`),t.style.setProperty("--st-group-title-fit-line-height",`${n}px`)})}syncOutsideClickListener(){if(!this.menuOpen)return void this.clearOutsideClickListener();if(this.removeOutsideClickListener)return;const t=t=>{t.composedPath().includes(this)||(this.menuOpen=!1)};window.addEventListener("pointerdown",t,{capture:!0}),this.removeOutsideClickListener=()=>window.removeEventListener("pointerdown",t,{capture:!0})}renderPicker(){if(!this.menuOpen)return q;const t=this.getAvailableTargets();return B`
|
||||
<div class="group-picker" role="menu">
|
||||
${this.targets.map(t=>{const e=this.getTargetLabel(t),i=this.getTargetIcon(t),o=t.entity===this.selectedEntity;return B`
|
||||
${t.map(t=>{const e=this.getTargetLabel(t),i=this.getTargetIcon(t),a=t.entity===this.selectedEntity;return B`
|
||||
<button
|
||||
type="button"
|
||||
role="menuitemradio"
|
||||
aria-checked=${o?"true":"false"}
|
||||
class=${o?"selected":""}
|
||||
aria-checked=${a?"true":"false"}
|
||||
class=${a?"selected":""}
|
||||
@click=${()=>this.selectEntity(t.entity)}
|
||||
>
|
||||
${i?B`<ha-icon icon=${i}></ha-icon>`:B`<span class="icon-placeholder"></span>`}
|
||||
@@ -3007,28 +3027,28 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
</button>
|
||||
`})}
|
||||
</div>
|
||||
`:q}renderHeaderIcon(t){const e=this.hass?.states?.[t.entity],i=this.getTargetHeaderData(t);if(!e||!i||!i.icon)return q;const o=we(e)||String(e.state),a="object"==typeof i.icon?i.icon?.[o]??!1:i.icon;if(!a)return q;const n=o&&o!==e.state?` ${Le(o)}`:"",r=Le(e.state);return B`
|
||||
`}renderHeaderIcon(t){const e=this.hass?.states?.[t.entity],i=this.getTargetHeaderData(t);if(!e||!i||!i.icon)return q;const a=we(e)||String(e.state),o="object"==typeof i.icon?i.icon?.[a]??!1:i.icon;if(!o)return q;const n=a&&a!==e.state?` ${Le(a)}`:"",r=Le(e.state);return B`
|
||||
<span
|
||||
class="header__icon-wrap ${r}${n} ${i.slashOffIcon?"slash-off":""}"
|
||||
>
|
||||
<ha-icon
|
||||
class="header__icon ${r}${n}"
|
||||
.icon=${a}
|
||||
.icon=${o}
|
||||
></ha-icon>
|
||||
</span>
|
||||
`}getTargetStateLabel(t){const e=this.hass?.states?.[t.entity];return e?"function"==typeof this.hass?.formatEntityState?this.hass.formatEntityState(e):String(e.state):""}renderTabSelector(){const t=this.config?.selector??je;return B`
|
||||
`}getTargetStateLabel(t){const e=this.hass?.states?.[t.entity];return e?"function"==typeof this.hass?.formatEntityState?this.hass.formatEntityState(e):String(e.state):""}renderTabSelector(){const t=this.config?.selector??je,e=this.getAvailableTargets();return B`
|
||||
<div class="group-selector tabs">
|
||||
<div class="group-tabs" role="tablist">
|
||||
${this.targets.map(e=>{const i=this.getTargetLabel(e),o=this.getTargetIcon(e),a=e.entity===this.selectedEntity,n=t.states?this.getTargetStateLabel(e):"";return B`
|
||||
${e.map(e=>{const i=this.getTargetLabel(e),a=this.getTargetIcon(e),o=e.entity===this.selectedEntity,n=t.states?this.getTargetStateLabel(e):"";return B`
|
||||
<button
|
||||
class=${["group-tab",this.getTargetClasses(e),a&&"selected"].filter(Boolean).join(" ")}
|
||||
class=${["group-tab",this.getTargetClasses(e),o&&"selected"].filter(Boolean).join(" ")}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected=${a?"true":"false"}
|
||||
aria-selected=${o?"true":"false"}
|
||||
title=${i}
|
||||
@click=${()=>this.selectEntity(e.entity)}
|
||||
>
|
||||
${o?B`<ha-icon icon=${o}></ha-icon>`:q}
|
||||
${a?B`<ha-icon icon=${a}></ha-icon>`:q}
|
||||
${!1!==t.names?B`
|
||||
<span class="group-tab-labels">
|
||||
<span class="group-tab-name">${i}</span>
|
||||
@@ -3041,7 +3061,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
`})}
|
||||
</div>
|
||||
</div>
|
||||
`}renderSelector(){if("tabs"===this.config?.selector?.style)return this.renderTabSelector();const t=this.getSelectedTarget(),e=this.getTargetLabel(t),i=this.localizeNavigationLabel("ui.common.previous","Previous device"),o=this.localizeNavigationLabel("ui.common.next","Next device"),a=this.localizeNavigationLabel("ui.common.open_menu","Open menu");return B`
|
||||
`}renderSelector(){if("tabs"===this.config?.selector?.style)return this.renderTabSelector();const t=this.getSelectedTarget();if(!t)return q;const e=this.getAvailableTargets().length,i=this.getTargetLabel(t),a=this.localizeNavigationLabel("ui.common.previous","Previous device"),o=this.localizeNavigationLabel("ui.common.next","Next device"),n=this.localizeNavigationLabel("ui.common.open_menu","Open menu");return B`
|
||||
<div class="group-selector">
|
||||
<div class="group-header-content">
|
||||
<div
|
||||
@@ -3052,7 +3072,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
@keydown=${t=>this.onSelectorHeaderKeyDown(t)}
|
||||
>
|
||||
${this.renderHeaderIcon(t)}
|
||||
<div class="group-title header__title" title=${e}>${e}</div>
|
||||
<div class="group-title header__title" title=${i}>${i}</div>
|
||||
</div>
|
||||
${this.renderHeaderToggles(t)}
|
||||
</div>
|
||||
@@ -3060,8 +3080,8 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
<button
|
||||
class="group-nav previous"
|
||||
type="button"
|
||||
aria-label=${i}
|
||||
?disabled=${this.targets.length<2}
|
||||
aria-label=${a}
|
||||
?disabled=${e<2}
|
||||
@click=${()=>this.selectOffset(-1)}
|
||||
>
|
||||
<ha-icon icon="mdi:chevron-left"></ha-icon>
|
||||
@@ -3070,7 +3090,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
class="group-nav next"
|
||||
type="button"
|
||||
aria-label=${o}
|
||||
?disabled=${this.targets.length<2}
|
||||
?disabled=${e<2}
|
||||
@click=${()=>this.selectOffset(1)}
|
||||
>
|
||||
<ha-icon icon="mdi:chevron-right"></ha-icon>
|
||||
@@ -3078,10 +3098,10 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
<button
|
||||
class="group-menu"
|
||||
type="button"
|
||||
aria-label=${a}
|
||||
aria-label=${n}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded=${this.menuOpen?"true":"false"}
|
||||
?disabled=${this.targets.length<2}
|
||||
?disabled=${e<2}
|
||||
@click=${()=>this.toggleMenu()}
|
||||
>
|
||||
<ha-icon icon="mdi:dots-vertical"></ha-icon>
|
||||
@@ -3089,7 +3109,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
</div>
|
||||
${this.renderPicker()}
|
||||
</div>
|
||||
`}localizeNavigationLabel(t,e){const i=this.hass?.localize?.(t);return"string"==typeof i&&i&&i!==t?i:e}render(){return this.config?B`
|
||||
`}localizeNavigationLabel(t,e){const i=this.hass?.localize?.(t);return"string"==typeof i&&i&&i!==t?i:e}render(){return this.config?this.getAvailableTargets().length?B`
|
||||
<div
|
||||
class=${this.getGroupCardClasses()}
|
||||
style=${this.getGroupCardStyle()}
|
||||
@@ -3099,29 +3119,29 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
class=${"embedded-card-host"+(this.cardFading?" fading":"")}
|
||||
></div>
|
||||
</div>
|
||||
`:B`<ha-card></ha-card>`}}var De;i([pt({attribute:!1})],Ve.prototype,"hass",void 0),i([mt()],Ve.prototype,"config",void 0),i([mt()],Ve.prototype,"targets",void 0),i([mt()],Ve.prototype,"selectedEntity",void 0),i([mt()],Ve.prototype,"menuOpen",void 0),i([mt()],Ve.prototype,"cardFading",void 0),function(t){t.OFF="off",t.HEAT="heat",t.COOL="cool",t.HEAT_COOL="heat_cool",t.AUTO="auto",t.DRY="dry",t.FAN_ONLY="fan_only"}(De||(De={}));const Ue=["auto","silent","quiet","low","mid","medium","high","max","turbo","full"];const We=["mdi:fan-speed-1","mdi:fan-speed-2","mdi:fan-speed-3","st:fan-speed-4","st:fan-speed-5"],Be=t=>String(t).toLowerCase().replace(/\s+/g,"_"),Ge={low:1,medlow:2,medium_low:2,mid:2,medium:2,medium_high:3,medhigh:3,max:5,turbo:5,full:5};function qe(t,e){const i=Be(t),o=function(t){if(!/^\d+$/.test(t))return;const e=Number(t);return e>=1&&e<=We.length?e:void 0}(i);if(o)return We[o-1];const a=function(t,e){if("high"===t){const t=new Set(e.map(Be));return t.has("medium_high")||t.has("medhigh")||t.has("max")||t.has("turbo")||t.has("full")?4:3}return Ge[t]}(i,e);return a?We[a-1]:void 0}function Ke(t,{decimals:e=1,fallback:i="N/A",locale:o}={}){if(null===t||""===t||["boolean","undefined"].includes(typeof t))return i;const a=Number(t);if(Number.isNaN(a))return i;const n=function(t){if(null===t||""===t||"boolean"==typeof t)return 1;const e=Number(t);return Number.isInteger(e)&&e>=0&&e<=100?e:1}(e);if(!o)return a.toFixed(n);try{return new Intl.NumberFormat("none"===o.number_format?"en-US":function({language:t,number_format:e}){switch(e){case"comma_decimal":return["en-US","en"];case"decimal_comma":return["de","es","it"];case"space_comma":return["fr","sv","cs"];case"quote_decimal":return["de-CH"];case"system":return;default:return t}}(o),{useGrouping:"none"!==o.number_format,minimumFractionDigits:n,maximumFractionDigits:n}).format(a)}catch{return a.toFixed(n)}}const Ze=[["heat",/\b(heat|heater|furnace|radiator|boiler|water[_ -]?heater)\b/],["cool",/\b(cool|cooling|ac|a\/c|air[_ -]?conditioner|snowflake)\b/],["dry",/\b(dry|drying|dehumidifier|dehumidify)\b/],["water-percent",/\b(humidifier|humidify|humidity)\b/],["fan",/\b(fan|blower)\b/],["lightbulb",/\b(light|lamp|bulb)\b/]],Je={heat:["component.climate.state._.heat","state_attributes.climate.hvac_action.heating"],cool:["component.climate.state._.cool","state_attributes.climate.hvac_action.cooling"],dry:["component.climate.state._.dry","state_attributes.humidifier.action.drying"],fan:["component.fan.entity_component._.name"],lightbulb:["component.light.entity_component._.name"],"water-percent":["component.humidifier.entity_component._.name","state_attributes.humidifier.action.humidifying"]};function Ye(t,e){const i=t.toLowerCase().replace(/[.:]/g," "),o=function(t){return"function"!=typeof t?.localize?[]:Object.entries(Je).flatMap(([e,i])=>i.map(e=>t.localize(e)).filter(t=>t&&!i.includes(t)).map(t=>{return[e,(i=String(t),i.toLowerCase().replace(/[.:]/g," "))];var i}))}(e).find(([,t])=>!!t&&(i===t||i.includes(t)));if(o)return o[0];const a=Ze.find(([,t])=>t.test(i));return a?.[0]??""}function Xe(t){if("string"!=typeof t||!t)return"";const e=(i=t.replace(/^[a-z]+:/,""),String(i??"").replace(/[^a-z0-9_-]/gi,""));var i;const o=Ye(e.replace(/-/g," "));return o||(["fire","radiator","heat-wave","heating-coil","water-boiler","water-boiler-auto","water-boiler-off"].includes(e)?"heat":["snowflake","air-conditioner"].includes(e)?"cool":"fan"===e?"fan":e.includes("light")?"lightbulb":["water-percent","air-humidifier"].includes(e)||["air-humidifier-off"].includes(e)?"water-percent":e)}function Qe({icon:t,label:e,entity:i,hass:o}){const a=Xe(t);if(a)return a;const n=function(t){const e=t?.entity_id,i="string"==typeof e?e.split(".")[0]:"",o=t?.attributes?.device_class;return"light"===i?"lightbulb":"fan"===i?"fan":"humidifier"===i?"dehumidifier"===o?"dry":"water-percent":"heat"===o||"heater"===o?"heat":"cold"===o||"cooling"===o?"cool":"moisture"===o||"humidity"===o?"water-percent":""}(i);if(n)return n;return Ye([e,i?.entity_id,i?.attributes?.friendly_name].filter(Boolean).join(" "),o)}function ti(t){return t?`toggle-${t}`:""}function ei({header:t,toggleEntityChanged:e,entity:i,hass:o,openEntityPopover:a}){if(!1===t)return q;const n=we(i)||i.state;let r=t.icon;"object"==typeof t.icon&&(r=r?.[n]??!1);const s=Boolean(t.slashOffIcon),c=t?.name??!1;return B`
|
||||
`:q:B`<ha-card></ha-card>`}}var De;i([pt({attribute:!1})],Ve.prototype,"hass",void 0),i([mt()],Ve.prototype,"config",void 0),i([mt()],Ve.prototype,"targets",void 0),i([mt()],Ve.prototype,"selectedEntity",void 0),i([mt()],Ve.prototype,"menuOpen",void 0),i([mt()],Ve.prototype,"cardFading",void 0),function(t){t.OFF="off",t.HEAT="heat",t.COOL="cool",t.HEAT_COOL="heat_cool",t.AUTO="auto",t.DRY="dry",t.FAN_ONLY="fan_only"}(De||(De={}));const Ue=["auto","silent","quiet","low","mid","medium","high","max","turbo","full"];const We=["mdi:fan-speed-1","mdi:fan-speed-2","mdi:fan-speed-3","st:fan-speed-4","st:fan-speed-5"],Be=t=>String(t).toLowerCase().replace(/\s+/g,"_"),Ge={low:1,medlow:2,medium_low:2,mid:2,medium:2,medium_high:3,medhigh:3,max:5,turbo:5,full:5};function qe(t,e){const i=Be(t),a=function(t){if(!/^\d+$/.test(t))return;const e=Number(t);return e>=1&&e<=We.length?e:void 0}(i);if(a)return We[a-1];const o=function(t,e){if("high"===t){const t=new Set(e.map(Be));return t.has("medium_high")||t.has("medhigh")||t.has("max")||t.has("turbo")||t.has("full")?4:3}return Ge[t]}(i,e);return o?We[o-1]:void 0}function Ke(t,{decimals:e=1,fallback:i="N/A",locale:a}={}){if(null===t||""===t||["boolean","undefined"].includes(typeof t))return i;const o=Number(t);if(Number.isNaN(o))return i;const n=function(t){if(null===t||""===t||"boolean"==typeof t)return 1;const e=Number(t);return Number.isInteger(e)&&e>=0&&e<=100?e:1}(e);if(!a)return o.toFixed(n);try{return new Intl.NumberFormat("none"===a.number_format?"en-US":function({language:t,number_format:e}){switch(e){case"comma_decimal":return["en-US","en"];case"decimal_comma":return["de","es","it"];case"space_comma":return["fr","sv","cs"];case"quote_decimal":return["de-CH"];case"system":return;default:return t}}(a),{useGrouping:"none"!==a.number_format,minimumFractionDigits:n,maximumFractionDigits:n}).format(o)}catch{return o.toFixed(n)}}const Ze=[["heat",/\b(heat|heater|furnace|radiator|boiler|water[_ -]?heater)\b/],["cool",/\b(cool|cooling|ac|a\/c|air[_ -]?conditioner|snowflake)\b/],["dry",/\b(dry|drying|dehumidifier|dehumidify)\b/],["water-percent",/\b(humidifier|humidify|humidity)\b/],["fan",/\b(fan|blower)\b/],["lightbulb",/\b(light|lamp|bulb)\b/]],Je={heat:["component.climate.state._.heat","state_attributes.climate.hvac_action.heating"],cool:["component.climate.state._.cool","state_attributes.climate.hvac_action.cooling"],dry:["component.climate.state._.dry","state_attributes.humidifier.action.drying"],fan:["component.fan.entity_component._.name"],lightbulb:["component.light.entity_component._.name"],"water-percent":["component.humidifier.entity_component._.name","state_attributes.humidifier.action.humidifying"]};function Ye(t,e){const i=t.toLowerCase().replace(/[.:]/g," "),a=function(t){return"function"!=typeof t?.localize?[]:Object.entries(Je).flatMap(([e,i])=>i.map(e=>t.localize(e)).filter(t=>t&&!i.includes(t)).map(t=>{return[e,(i=String(t),i.toLowerCase().replace(/[.:]/g," "))];var i}))}(e).find(([,t])=>!!t&&(i===t||i.includes(t)));if(a)return a[0];const o=Ze.find(([,t])=>t.test(i));return o?.[0]??""}function Xe(t){if("string"!=typeof t||!t)return"";const e=(i=t.replace(/^[a-z]+:/,""),String(i??"").replace(/[^a-z0-9_-]/gi,""));var i;const a=Ye(e.replace(/-/g," "));return a||(["fire","radiator","heat-wave","heating-coil","water-boiler","water-boiler-auto","water-boiler-off"].includes(e)?"heat":["snowflake","air-conditioner"].includes(e)?"cool":"fan"===e?"fan":e.includes("light")?"lightbulb":["water-percent","air-humidifier"].includes(e)||["air-humidifier-off"].includes(e)?"water-percent":e)}function Qe({icon:t,label:e,entity:i,hass:a}){const o=Xe(t);if(o)return o;const n=function(t){const e=t?.entity_id,i="string"==typeof e?e.split(".")[0]:"",a=t?.attributes?.device_class;return"light"===i?"lightbulb":"fan"===i?"fan":"humidifier"===i?"dehumidifier"===a?"dry":"water-percent":"heat"===a||"heater"===a?"heat":"cold"===a||"cooling"===a?"cool":"moisture"===a||"humidity"===a?"water-percent":""}(i);if(n)return n;return Ye([e,i?.entity_id,i?.attributes?.friendly_name].filter(Boolean).join(" "),a)}function ti(t){return t?`toggle-${t}`:""}function ei({header:t,toggleEntityChanged:e,entity:i,hass:a,openEntityPopover:o}){if(!1===t)return q;const n=we(i)||i.state;let r=t.icon;"object"==typeof t.icon&&(r=r?.[n]??!1);const s=Boolean(t.slashOffIcon),c=t?.name??!1;return B`
|
||||
<header>
|
||||
<div class="header__main clickable" @click=${()=>a()}>
|
||||
${function(t,e,i,o=!1){const a=i&&i!==e?` ${i}`:"";return t?B`
|
||||
<div class="header__main clickable" @click=${()=>o()}>
|
||||
${function(t,e,i,a=!1){const o=i&&i!==e?` ${i}`:"";return t?B`
|
||||
<span
|
||||
class="header__icon-wrap ${e}${a} ${o?"slash-off":""}"
|
||||
class="header__icon-wrap ${e}${o} ${a?"slash-off":""}"
|
||||
>
|
||||
<ha-icon
|
||||
class="header__icon ${e}${a}"
|
||||
class="header__icon ${e}${o}"
|
||||
.icon=${t}
|
||||
></ha-icon>
|
||||
</span>
|
||||
`:q}(r,i.state,n,s)}
|
||||
${function(t){return t?B`<h2 class="header__title">${t}</h2>`:q}(c)}
|
||||
</div>
|
||||
${function(t,e){if(!t?.length)return q;const i=t.map(({icon:t,hide_inactive:i,state:o})=>o?B` <ha-icon
|
||||
class="fault-icon ${"on"===o.state?"active":i?" hide":""}"
|
||||
.icon=${t||o.attributes?.icon}
|
||||
@click="${()=>e(o.entity_id)}"
|
||||
></ha-icon>`:q);return B` <div class="faults">${i}</div>`}(t.faults,a)}
|
||||
${function(t,e,i,o,a){return t?.length?B`
|
||||
${function(t,e){if(!t?.length)return q;const i=t.map(({icon:t,hide_inactive:i,state:a})=>a?B` <ha-icon
|
||||
class="fault-icon ${"on"===a.state?"active":i?" hide":""}"
|
||||
.icon=${t||a.attributes?.icon}
|
||||
@click="${()=>e(a.entity_id)}"
|
||||
></ha-icon>`:q);return B` <div class="faults">${i}</div>`}(t.faults,o)}
|
||||
${function(t,e,i,a,o){return t?.length?B`
|
||||
<div class="header__toggles">
|
||||
${t.map(t=>{if(!0===t.hide_when_off&&"off"===a?.state)return q;const n=t.entity?.entity_id,r=t.entity?.state,s="string"==typeof n?n.split(".")[0]:"",c=ti(Qe({icon:"string"==typeof t.icon?t.icon:t.entity?.attributes?.icon,label:t.label,entity:t.entity,hass:o}));return B`
|
||||
${t.map(t=>{if(!0===t.hide_when_off&&"off"===o?.state)return q;const n=t.entity?.entity_id,r=t.entity?.state,s="string"==typeof n?n.split(".")[0]:"",c=ti(Qe({icon:"string"==typeof t.icon?t.icon:t.entity?.attributes?.icon,label:t.label,entity:t.entity,hass:a}));return B`
|
||||
<div
|
||||
class="header__toggle ${r||""} ${s?`domain-${s}`:""} ${c}"
|
||||
>
|
||||
@@ -3139,30 +3159,30 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
</div>
|
||||
`})}
|
||||
</div>
|
||||
`:q}(t.toggles,a,e,o,i)}
|
||||
`:q}(t.toggles,o,e,a,i)}
|
||||
</header>
|
||||
`}function ii(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oi(t,e,i){if(!e||"string"!=typeof e)return String(t);const o=String(t);return new RegExp(`${ii(e)}$`).test(o)?o:`${o}${function(t,e){if(e){const i=e.match(new RegExp(`(\\s*)${ii(t)}$`));if(i)return i[1]??""}return"%"===t?"":" "}(e,i)}${e}`}var ai,ni={exports:{}};function ri(){return ai||(ai=1,function(t){function e(t){var i,o,a=new Error(t);return i=a,o=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,o):i.__proto__=o,a}function i(t,i,o){var a=i.slice(0,o).split(/\n/),n=a.length,r=a[n-1].length+1;throw e(t+=" at line "+n+" col "+r+":\n\n "+i.split(/\n/)[n-1]+"\n "+Array(r).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,a=!1;try{a=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(t,e,i){for(var o in e)n(e,o)&&(null==e[o]||"object"!=typeof e[o]||"storage"!==o&&"prefixes"!==o||i?t[o]=e[o]:t[o]=r({},e[o]));return t}var s=/^async +/,c=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,d=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,h=/[.*+\-?^${}()|[\]\\]/g;function u(t){return h.test(t)?t.replace(h,"\\$&"):t}function p(t,o){o.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,l.lastIndex=0,d.lastIndex=0;var a=o.prefixes,n=[a.h,a.b,a.i,a.r,a.c,a.e].reduce(function(t,e){return t&&e?t+"|"+u(e):e?u(e):t},""),r=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+u(o.tags[1])+")","g"),h=new RegExp("([^]*?)"+u(o.tags[0])+"(-|_)?\\s*("+n+")?\\s*","g"),p=0,m=!1;function g(e,a){var n,u={f:[]},g=0,f="c";function v(e){var a=t.slice(p,e),n=a.trim();if("f"===f)"safe"===n?u.raw=!0:o.async&&s.test(n)?(n=n.replace(s,""),u.f.push([n,"",!0])):u.f.push([n,""]);else if("fp"===f)u.f[u.f.length-1][1]+=n;else if("err"===f){if(n){var r=a.search(/\S/);i("invalid syntax",t,p+r)}}else u[f]=n;p=e+1}for("h"===a||"b"===a||"c"===a?f="n":"r"===a&&(u.raw=!0,a="i"),r.lastIndex=p;null!==(n=r.exec(t));){var y=n[1],b=n[2],_=n[3],w=n[4],x=n[5],$=n.index;if(y)"("===y?(0===g&&("n"===f?(v($),f="p"):"f"===f&&(v($),f="fp")),g++):")"===y?0===--g&&"c"!==f&&(v($),f="err"):0===g&&"|"===y?(v($),f="f"):"=>"===y&&(v($),p+=1,f="res");else if(b)if("/*"===b){var S=t.indexOf("*/",r.lastIndex);-1===S&&i("unclosed comment",t,n.index),r.lastIndex=S+2}else"'"===b?(l.lastIndex=n.index,l.exec(t)?r.lastIndex=l.lastIndex:i("unclosed string",t,n.index)):'"'===b?(d.lastIndex=n.index,d.exec(t)?r.lastIndex=d.lastIndex:i("unclosed string",t,n.index)):"`"===b&&(c.lastIndex=n.index,c.exec(t)?r.lastIndex=c.lastIndex:i("unclosed string",t,n.index));else if(_)return v($),p=$+n[0].length,h.lastIndex=p,m=x,w&&"h"===a&&(a="s"),u.t=a,u}return i("unclosed tag",t,e),u}var f=function n(r,c){r.b=[],r.d=[];var l,d=!1,u=[];function f(t,e){t&&(t=function(t,e,i,o){var a,n;return"string"==typeof e.autoTrim?a=n=e.autoTrim:Array.isArray(e.autoTrim)&&(a=e.autoTrim[1],n=e.autoTrim[0]),(i||!1===i)&&(a=i),(o||!1===o)&&(n=o),"slurp"===a&&"slurp"===n?t.trim():("_"===a||"slurp"===a?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==a&&"nl"!==a||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===n||"slurp"===n?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==n&&"nl"!==n||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,o,m,e),t&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),u.push(t)))}for(;null!==(l=h.exec(t));){var v,y=l[1],b=l[2],_=l[3]||"";for(var w in a)if(a[w]===_){v=w;break}f(y,b),p=l.index+l[0].length,v||i("unrecognized tag type: "+_,t,p);var x=g(l.index,v),$=x.t;if("h"===$){var S=x.n||"";o.async&&s.test(S)&&(x.a=!0,x.n=S.replace(s,"")),x=n(x),u.push(x)}else if("c"===$){if(r.n===x.n)return d?(d.d=u,r.b.push(d)):r.d=u,r;i("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===$){d?(d.d=u,r.b.push(d)):r.d=u;var A=x.n||"";o.async&&s.test(A)&&(x.a=!0,x.n=A.replace(s,"")),d=x,u=[]}else if("s"===$){var k=x.n||"";o.async&&s.test(k)&&(x.a=!0,x.n=k.replace(s,"")),u.push(x)}else u.push(x)}if(!c)throw e('unclosed helper "'+r.n+'"');return f(t.slice(p,t.length),!1),r.d=u,r}({f:[]},!0);if(o.plugins)for(var v=0;v<o.plugins.length;v++){var y=o.plugins[v];y.processAST&&(f.d=y.processAST(f.d,o))}return f.d}function m(t,e){var i=p(t,e),o="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+b(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins)for(var a=0;a<e.plugins.length;a++){var n=e.plugins[a];n.processFnString&&(o=n.processFnString(o,e))}return o}function g(t,e){for(var i=0;i<e.length;i++){var o=e[i][0],a=e[i][1];t=(e[i][2]?"await ":"")+"c.l('F','"+o+"')("+t,a&&(t+=","+a),t+=")"}return t}function f(t,e,i,o,a,n){var r="{exec:"+(a?"async ":"")+y(i,e,t)+",params:["+o+"]";return n&&(r+=",name:'"+n+"'"),a&&(r+=",async:true"Line truncated
|
||||
`}function ii(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ai(t,e,i){if(!e||"string"!=typeof e)return String(t);const a=String(t);return new RegExp(`${ii(e)}$`).test(a)?a:`${a}${function(t,e){if(e){const i=e.match(new RegExp(`(\\s*)${ii(t)}$`));if(i)return i[1]??""}return"%"===t?"":" "}(e,i)}${e}`}var oi,ni={exports:{}};function ri(){return oi||(oi=1,function(t){function e(t){var i,a,o=new Error(t);return i=o,a=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(i,a):i.__proto__=a,o}function i(t,i,a){var o=i.slice(0,a).split(/\n/),n=o.length,r=o[n-1].length+1;throw e(t+=" at line "+n+" col "+r+":\n\n "+i.split(/\n/)[n-1]+"\n "+Array(r).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var a=new Function("return this")().Promise,o=!1;try{o=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(t,e,i){for(var a in e)n(e,a)&&(null==e[a]||"object"!=typeof e[a]||"storage"!==a&&"prefixes"!==a||i?t[a]=e[a]:t[a]=r({},e[a]));return t}var s=/^async +/,c=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,d=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,h=/[.*+\-?^${}()|[\]\\]/g;function u(t){return h.test(t)?t.replace(h,"\\$&"):t}function p(t,a){a.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,l.lastIndex=0,d.lastIndex=0;var o=a.prefixes,n=[o.h,o.b,o.i,o.r,o.c,o.e].reduce(function(t,e){return t&&e?t+"|"+u(e):e?u(e):t},""),r=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+u(a.tags[1])+")","g"),h=new RegExp("([^]*?)"+u(a.tags[0])+"(-|_)?\\s*("+n+")?\\s*","g"),p=0,m=!1;function g(e,o){var n,u={f:[]},g=0,f="c";function v(e){var o=t.slice(p,e),n=o.trim();if("f"===f)"safe"===n?u.raw=!0:a.async&&s.test(n)?(n=n.replace(s,""),u.f.push([n,"",!0])):u.f.push([n,""]);else if("fp"===f)u.f[u.f.length-1][1]+=n;else if("err"===f){if(n){var r=o.search(/\S/);i("invalid syntax",t,p+r)}}else u[f]=n;p=e+1}for("h"===o||"b"===o||"c"===o?f="n":"r"===o&&(u.raw=!0,o="i"),r.lastIndex=p;null!==(n=r.exec(t));){var y=n[1],b=n[2],_=n[3],w=n[4],x=n[5],$=n.index;if(y)"("===y?(0===g&&("n"===f?(v($),f="p"):"f"===f&&(v($),f="fp")),g++):")"===y?0===--g&&"c"!==f&&(v($),f="err"):0===g&&"|"===y?(v($),f="f"):"=>"===y&&(v($),p+=1,f="res");else if(b)if("/*"===b){var S=t.indexOf("*/",r.lastIndex);-1===S&&i("unclosed comment",t,n.index),r.lastIndex=S+2}else"'"===b?(l.lastIndex=n.index,l.exec(t)?r.lastIndex=l.lastIndex:i("unclosed string",t,n.index)):'"'===b?(d.lastIndex=n.index,d.exec(t)?r.lastIndex=d.lastIndex:i("unclosed string",t,n.index)):"`"===b&&(c.lastIndex=n.index,c.exec(t)?r.lastIndex=c.lastIndex:i("unclosed string",t,n.index));else if(_)return v($),p=$+n[0].length,h.lastIndex=p,m=x,w&&"h"===o&&(o="s"),u.t=o,u}return i("unclosed tag",t,e),u}var f=function n(r,c){r.b=[],r.d=[];var l,d=!1,u=[];function f(t,e){t&&(t=function(t,e,i,a){var o,n;return"string"==typeof e.autoTrim?o=n=e.autoTrim:Array.isArray(e.autoTrim)&&(o=e.autoTrim[1],n=e.autoTrim[0]),(i||!1===i)&&(o=i),(a||!1===a)&&(n=a),"slurp"===o&&"slurp"===n?t.trim():("_"===o||"slurp"===o?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==o&&"nl"!==o||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===n||"slurp"===n?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==n&&"nl"!==n||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,a,m,e),t&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),u.push(t)))}for(;null!==(l=h.exec(t));){var v,y=l[1],b=l[2],_=l[3]||"";for(var w in o)if(o[w]===_){v=w;break}f(y,b),p=l.index+l[0].length,v||i("unrecognized tag type: "+_,t,p);var x=g(l.index,v),$=x.t;if("h"===$){var S=x.n||"";a.async&&s.test(S)&&(x.a=!0,x.n=S.replace(s,"")),x=n(x),u.push(x)}else if("c"===$){if(r.n===x.n)return d?(d.d=u,r.b.push(d)):r.d=u,r;i("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===$){d?(d.d=u,r.b.push(d)):r.d=u;var A=x.n||"";a.async&&s.test(A)&&(x.a=!0,x.n=A.replace(s,"")),d=x,u=[]}else if("s"===$){var k=x.n||"";a.async&&s.test(k)&&(x.a=!0,x.n=k.replace(s,"")),u.push(x)}else u.push(x)}if(!c)throw e('unclosed helper "'+r.n+'"');return f(t.slice(p,t.length),!1),r.d=u,r}({f:[]},!0);if(a.plugins)for(var v=0;v<a.plugins.length;v++){var y=a.plugins[v];y.processAST&&(f.d=y.processAST(f.d,a))}return f.d}function m(t,e){var i=p(t,e),a="var tR='';"+(e.useWith?"with("+e.varName+"||{}){":"")+b(i,e)+"if(cb){cb(null,tR)} return tR"+(e.useWith?"}":"");if(e.plugins)for(var o=0;o<e.plugins.length;o++){var n=e.plugins[o];n.processFnString&&(a=n.processFnString(a,e))}return a}function g(t,e){for(var i=0;i<e.length;i++){var a=e[i][0],o=e[i][1];t=(e[i][2]?"await ":"")+"c.l('F','"+a+"')("+t,o&&(t+=","+o),t+=")"}return t}function f(t,e,i,a,o,n){var r="{exec:"+(o?"async ":"")+y(i,e,t)+",params:["+a+"]";return n&&(r+=",name:'"+n+"'"),o&&(r+=",async:true"Line truncated
|
||||
style="display: contents"
|
||||
.markup=${t}
|
||||
.hass=${e}
|
||||
></simple-thermostat-template-content>`:vi(t)}i([pt({attribute:!1})],yi.prototype,"markup",void 0),i([pt({attribute:!1})],yi.prototype,"hass",void 0),customElements.get("simple-thermostat-template-content")||customElements.define("simple-thermostat-template-content",yi);const _i=["automation","fan","humidifier","input_boolean","light","switch"],wi=["button","input_button","script","scene"],xi=["row","auto","button","toggle","chip"];function $i(t,e,i){if(!be(t.states?.[e]))return;const o="turn_"+(i?"on":"off");"function"==typeof t.performAction?t.performAction({action:`homeassistant.${o}`,data:{entity_id:e}}):t.callService("homeassistant",o,{entity_id:e})}function Si(t){return String(t??"").replace(/[^a-z0-9_-]/gi,"")}function Ai(t){return!!t&&"object"==typeof t&&"string"==typeof t.entity_id}function ki(t,e,i,o){const{template:a,attribute:n,decimals:r,unit:s,type:c,config:l,variables:d}=e,h=Ai(t);if(a&&h)return bi(oi(ui({template:a,stateObj:t,attribute:n,hass:i,config:l,variables:d,localize:o}),s||!1),i);const u=h?n?t.attributes?.[n]:t.state:t;if("relativetime"===c)return B`<ha-relative-time
|
||||
></simple-thermostat-template-content>`:vi(t)}i([pt({attribute:!1})],yi.prototype,"markup",void 0),i([pt({attribute:!1})],yi.prototype,"hass",void 0),customElements.get("simple-thermostat-template-content")||customElements.define("simple-thermostat-template-content",yi);const _i=["automation","fan","humidifier","input_boolean","light","switch"],wi=["button","input_button","script","scene"],xi=["row","auto","button","toggle","chip"];function $i(t,e,i){if(!be(t.states?.[e]))return;const a="turn_"+(i?"on":"off");"function"==typeof t.performAction?t.performAction({action:`homeassistant.${a}`,data:{entity_id:e}}):t.callService("homeassistant",a,{entity_id:e})}function Si(t){return String(t??"").replace(/[^a-z0-9_-]/gi,"")}function Ai(t){return!!t&&"object"==typeof t&&"string"==typeof t.entity_id}function ki(t,e,i,a){const{template:o,attribute:n,decimals:r,unit:s,type:c,config:l,variables:d}=e,h=Ai(t);if(o&&h)return bi(ai(ui({template:o,stateObj:t,attribute:n,hass:i,config:l,variables:d,localize:a}),s||!1),i);const u=h?n?t.attributes?.[n]:t.state:t;if("relativetime"===c)return B`<ha-relative-time
|
||||
.datetime=${u}
|
||||
.hass=${i}
|
||||
></ha-relative-time>`;if(h&&!n&&t.entity_id.startsWith("timer."))return B`<simple-thermostat-timer-remaining
|
||||
.stateObj=${t}
|
||||
.hass=${i}
|
||||
></simple-thermostat-timer-remaining>`;if(null==u)return l?.fallback??"N/A";if("object"==typeof u)return JSON.stringify(u);let p=u;if("number"==typeof r)p=Ke(u,{decimals:r,locale:i.locale,fallback:l?.fallback});else if(h){const e=t.entity_id.split(".")[0];p=n?"function"==typeof i.formatEntityAttributeValue?i.formatEntityAttributeValue(t,n):u:"function"==typeof i.formatEntityState?i.formatEntityState(s?{...t,attributes:{...t.attributes,unit_of_measurement:void 0}}:t):o?o(String(u),`component.${e}.state.${t.attributes?.device_class??"_"}.`):u}const m=h&&!n?t.attributes?.unit_of_measurement:"",g=!h||n||"humidity"!==t.attributes?.device_class&&!t.entity_id.includes("humidity")&&"mdi:water-percent"!==e.icon?"":"%",f=s?function(t,e){const i=String(t);return e&&"string"==typeof e&&i.endsWith(e)?i.slice(0,-e.length).trimEnd():i}(p,m):p;return oi(f,s||m||g||!1,String(p))}function Ei({hide:t=!1,hass:e,state:i,details:o,localize:a,openEntityPopover:n}){if(t||void 0===i)return;const{type:r,heading:s,icon:c,unit:l,decimals:d,tooltip:h,entity:u,template:p,attribute:m,variables:g,config:f,separator:v=!0,display:y}=o,b=function({icon:t,state:e,attribute:i,hass:o,config:a,variables:n,localize:r}){return"string"==typeof t&&t.includes("{{")&&"object"==typeof e&&null!==e?ui({template:t,stateObj:e,attribute:i,hass:o,config:a,variables:n,localize:r}).trim():t}({icon:c,state:i,attribute:m,hass:e,config:f,variables:g,localize:a}),_=function({heading:t,state:e,attribute:i,hass:o,config:a,variables:n,localize:r}){if("string"==typeof t&&t.includes("{{")&&"object"==typeof e&&null!==e)return ui({template:t,stateObj:e,attribute:i,hass:o,config:a,variables:n,localize:r}).trim()}({heading:s,state:i,attribute:m,hass:e,config:f,variables:g,localize:a}),w=Ai(i),x=w?i.entity_id:u,$=x&&"function"==typeof n,S=h||(w?i?.attributes?.friendly_name||i?.entity_id:u?e.states?.[u]?.attributes?.friendly_name||u:void 0);let A,k="",E="",z=!1,C=!1;const T=ki(i,o,e,a);if(w){const[t]=i.entity_id.split(".");k=t,E=i.state,z=_i.includes(t);const o=function(t,e){return"string"==typeof t&&xi.includes(t)?"auto"!==t?t:_i.includes(e)?"toggle":wi.includes(e)?"button":"chip":"row"}(y,t),a=[z&&"toggle-entity",k&&`domain-${Si(k)}`,E&&`state-${Si(E)}`,"row"!==o&&`display-${o}`,z&&ti(Qe({icon:b||i.attributes?.icon,label:s||i.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" ");if("row"!==o){C=!0;const r=z||wi.includes(t),c="on"===i.state,l=void 0!==_?bi(_,e):"string"==typeof s?s:i.attributes?.friendly_name||i.entity_id,d=b||i.attributes?.icon||(z?"mdi:toggle-switch":wi.includes(t)?"mdi:gesture-tap-button":void 0);A=B`
|
||||
></simple-thermostat-timer-remaining>`;if(null==u)return l?.fallback??"N/A";if("object"==typeof u)return JSON.stringify(u);let p=u;if("number"==typeof r)p=Ke(u,{decimals:r,locale:i.locale,fallback:l?.fallback});else if(h){const e=t.entity_id.split(".")[0];p=n?"function"==typeof i.formatEntityAttributeValue?i.formatEntityAttributeValue(t,n):u:"function"==typeof i.formatEntityState?i.formatEntityState(s?{...t,attributes:{...t.attributes,unit_of_measurement:void 0}}:t):a?a(String(u),`component.${e}.state.${t.attributes?.device_class??"_"}.`):u}const m=h&&!n?t.attributes?.unit_of_measurement:"",g=!h||n||"humidity"!==t.attributes?.device_class&&!t.entity_id.includes("humidity")&&"mdi:water-percent"!==e.icon?"":"%",f=s?function(t,e){const i=String(t);return e&&"string"==typeof e&&i.endsWith(e)?i.slice(0,-e.length).trimEnd():i}(p,m):p;return ai(f,s||m||g||!1,String(p))}function Ei({hide:t=!1,hass:e,state:i,details:a,localize:o,openEntityPopover:n}){if(t||void 0===i)return;const{type:r,heading:s,icon:c,unit:l,decimals:d,tooltip:h,entity:u,template:p,attribute:m,variables:g,config:f,separator:v=!0,display:y}=a,b=function({icon:t,state:e,attribute:i,hass:a,config:o,variables:n,localize:r}){return"string"==typeof t&&t.includes("{{")&&"object"==typeof e&&null!==e?ui({template:t,stateObj:e,attribute:i,hass:a,config:o,variables:n,localize:r}).trim():t}({icon:c,state:i,attribute:m,hass:e,config:f,variables:g,localize:o}),_=function({heading:t,state:e,attribute:i,hass:a,config:o,variables:n,localize:r}){if("string"==typeof t&&t.includes("{{")&&"object"==typeof e&&null!==e)return ui({template:t,stateObj:e,attribute:i,hass:a,config:o,variables:n,localize:r}).trim()}({heading:s,state:i,attribute:m,hass:e,config:f,variables:g,localize:o}),w=Ai(i),x=w?i.entity_id:u,$=x&&"function"==typeof n,S=h||(w?i?.attributes?.friendly_name||i?.entity_id:u?e.states?.[u]?.attributes?.friendly_name||u:void 0);let A,k="",E="",z=!1,C=!1;const T=ki(i,a,e,o);if(w){const[t]=i.entity_id.split(".");k=t,E=i.state,z=_i.includes(t);const a=function(t,e){return"string"==typeof t&&xi.includes(t)?"auto"!==t?t:_i.includes(e)?"toggle":wi.includes(e)?"button":"chip":"row"}(y,t),o=[z&&"toggle-entity",k&&`domain-${Si(k)}`,E&&`state-${Si(E)}`,"row"!==a&&`display-${a}`,z&&ti(Qe({icon:b||i.attributes?.icon,label:s||i.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" ");if("row"!==a){C=!0;const r=z||wi.includes(t),c="on"===i.state,l=void 0!==_?bi(_,e):"string"==typeof s?s:i.attributes?.friendly_name||i.entity_id,d=b||i.attributes?.icon||(z?"mdi:toggle-switch":wi.includes(t)?"mdi:gesture-tap-button":void 0);A=B`
|
||||
<button
|
||||
class="entity-action ${a} ${c?"active":""}"
|
||||
class="entity-action ${o} ${c?"active":""}"
|
||||
type="button"
|
||||
?disabled=${r&&!be(i)}
|
||||
title=${S}
|
||||
aria-pressed=${z?String(c):q}
|
||||
@click=${()=>r?function(t,e,i){if(!be(t.states?.[e]))return;if(_i.includes(i))return void $i(t,e,"on"!==t.states?.[e]?.state);const o="button"===i||"input_button"===i?"press":"turn_on";"function"==typeof t.performAction?t.performAction({action:`${i}.${o}`,data:{entity_id:e}}):t.callService(i,o,{entity_id:e})}(e,i.entity_id,t):$?n(i.entity_id):void 0}
|
||||
@click=${()=>r?function(t,e,i){if(!be(t.states?.[e]))return;if(_i.includes(i))return void $i(t,e,"on"!==t.states?.[e]?.state);const a="button"===i||"input_button"===i?"press":"turn_on";"function"==typeof t.performAction?t.performAction({action:`${i}.${a}`,data:{entity_id:e}}):t.callService(i,a,{entity_id:e})}(e,i.entity_id,t):$?n(i.entity_id):void 0}
|
||||
>
|
||||
${d?B`<ha-icon .icon=${d}></ha-icon>`:""}
|
||||
<span class="entity-action__label">${l}</span>
|
||||
${"chip"===o||"toggle"===o?B`<span class="entity-action__state">${T}</span>`:""}
|
||||
${"chip"===a||"toggle"===a?B`<span class="entity-action__state">${T}</span>`:""}
|
||||
</button>
|
||||
`}else"timer"===t||!z||m||p||"relativetime"===r?A=B`
|
||||
<div
|
||||
@@ -3173,7 +3193,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
${T}
|
||||
</div>
|
||||
`:z&&(A=B`
|
||||
<div class="entity-value ${a}">
|
||||
<div class="entity-value ${o}">
|
||||
<ha-switch
|
||||
.checked=${"on"===i.state}
|
||||
.disabled=${!be(i)}
|
||||
@@ -3198,14 +3218,14 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
@click=${$?()=>n(x):null}
|
||||
>
|
||||
${N}
|
||||
</div>`,A]}function zi({_hide:t,entity:e,unit:i,hass:o,entities:a,config:n,localize:r,openEntityPopover:s,adapter:c}){const l=n.current_value_entity,d=l?o.states[l]:e,h=l?d?.state:c.getCurrentValue(e.attributes),u=l?d?.attributes?.unit_of_measurement??i:c.getCurrentValueUnit?.(e.attributes,o.config)??i,p=n?.layout?.entities?.labels??!0,m=!1!==n?.layout?.entities?.separator,g=n?.state_labels?.[e.state]??xe(e,o,r),f=(!0===n?.hide_current_value_when_off||!0===n?.hide?.current_value_when_off||!0===n?.hide?.temperature_when_off)&&e.state===De.OFF,v=[Ei({hide:t.temperature||f||null==h,state:oi(Ke(h,{...n,locale:o.locale}),u),hass:o,openEntityPopover:s,details:{heading:!!p&&(n?.label?.temperature??r("ui.card.climate.currently")),tooltip:d?.attributes?.friendly_name??l,entity:l??n.entity,separator:m}}),Ei({hide:t.state,state:g,hass:o,openEntityPopover:s,details:{heading:!!p&&(n?.label?.state??r("ui.panel.lovelace.editor.card.generic.state")),entity:n.entity,separator:m}}),...(a??[]).map(({name:t,state:i,show:a,display:c,_hide_when_off:l,hide_when_off:d,...h})=>Ei({hide:!1===a||(!0===l||!0===d)&&e.state===De.OFF,state:i,hass:o,localize:r,openEntityPopover:s,details:{...h,heading:p&&t,tooltip:t,config:n,variables:n.variables,separator:m,display:c??n?.layout?.entities?.display}}))||null].filter(t=>null!==t);return function(t,e){const{type:i="table",labels:o=!0,alignment:a}=t?.layout?.entities??{},n=[o?"with-labels":"without-labels","list"===i?"as-list":"as-table","left"===a?"align-left":"",1===e.filter(t=>null!=t).length?"single-row":""];return B` <div class="entities ${n.join(" ")}">${e}</div> `}(n,v)}const Ci=new Set(["heat_cool","fan_only"]);function Ti(t,e,i){if(!e||!i)return{layout:"inline",lines:e?[e]:[]};const o=e.trim();if(!o)return{layout:"inline",lines:[]};if("heat_cool"===t){const t=o.split(/\s*\/\s*/).filter(Boolean);if(2===t.length&&t.every(t=>t.length>0&&t.length<=12))return{layout:"stacked",lines:t}}if("fan_only"===t){const t=o.split(/\s+/).filter(Boolean);if(2===t.length&&t.every(t=>t.length>0&&t.length<=10))return{layout:"stacked",lines:t}}return Ci.has(t)&&o.length>10?{layout:"column",lines:[o]}:{layout:"inline",lines:[o]}}const Ri={"st:fan-speed-4":{path:"M16 15V21H19V23H21V15H19V19H18V15H16Z"},"st:fan-speed-5":{path:"M16 15H21V17H18V18H19C20.11 18 21 18.89 21 20V21C21 22.11 20.11 23 19 23H16V21H19V20H16V15Z"}};function Oi(t){return t?B` <ha-icon class="mode-icon" .icon=${t}></ha-icon> `:null}function Ni({state:t,entity:e,hass:i,mode:o,adapter:a,modeOptions:n,localize:r,setMode:s}){const{type:c,hide_when_off:l,mode:d="none",list:h,name:u,heading:p,icons:m}=o;if(0===h.length||l&&t===De.OFF)return null;const g="hvac"===c?null:a.getModePayloadKey(c),f=o.entity?i?.states?.[o.entity]:void 0,v=!be(o.entity?f:e);let y=g?`state_attributes.${a.getLocalizationDomain()}.${g}.`:"";"hvac"===c?y="component.climate.state._.":"vane_horizontal"===c||"vane_vertical"===c?y="":"direction"!==c&&"oscillating"!==c&&"mode"!==c||(y="");const b=(t,o,a)=>{if(!1!==t&&!0===a||!1!==t&&void 0===a&&t!==o)return t;if(f&&"function"==typeof i?.formatEntityState)return i.formatEntityState({...f,state:o});if(("hvac"===c||"state"===c)&&"function"==typeof i?.formatEntityState)return i.formatEntityState({...e,state:o});if(g&&e&&"function"==typeof i?.formatEntityAttributeValue)return i.formatEntityAttributeValue(e,g,o);const n=y?r(o,y):o;return n&&n!==o?n:!1===t?o:t},_=(t,e)=>{for(const e of Array.isArray(t)?t:[t]){const t=r(e);if(t&&t!==e)return t}return e};let w;w="vane_horizontal"===c?"Vane Horizontal":"vane_vertical"===c?"Vane Vertical":"swing_horizontal"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.swing_horizontal_modes","Swing Horizontal"):"swing_vertical"===c?"Swing Vertical":"direction"===c?_("ui.card.fan.direction","Direction"):"oscillating"===c?_("ui.card.fan.oscillate","Oscillating"):"mode"===c?_(`ui.card.${a.getLocalizationDomain()}.mode`,"Mode"):"preset"===c?!0===p&&_("fan"===a.getLocalizationDomain()?"ui.card.fan.preset_mode":"ui.card.climate.preset","Preset"):"state"===c?!0===p&&_(`ui.card.${a.getLocalizationDomain()}.state`,"State"):"fan"===c?_("ui.panel.lovelace.editor.features.types.climate-fan-modes.fan_modes","Mode"):"swing"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-modes.swing_modes","Mode"):_(`ui.card.${a.getLocalizationDomain()}.mode`,"hvac"===c?"Operation":"Mode");const x=!1!==u&&(u||w),$="fan"===c||"preset"===c&&"fan"===a.getLocalizationDomain()?_("ui.panel.lovelace.editor.features.types.climate-fan-modes.fan_modes","Fan speed"):"swing"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-modes.swing_modes","Swing mode"):"swing_horizontal"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.swing_horizontal_modes","Horizontal swing"):"swing_vertical"===c?_("ui.card.climate.swing_vertical_mode","Vertical swing"):"vane_horizontal"===c?"Horizontal vane":"vane_vertical"===c?"Vertical vane":"string"==typeof w?w:"",S=x||$||c,A=(!0==Line truncated
|
||||
</div>`,A]}function zi({_hide:t,entity:e,unit:i,hass:a,entities:o,config:n,localize:r,openEntityPopover:s,adapter:c}){const l=n.current_value_entity,d=l?a.states[l]:e,h=l?d?.state:c.getCurrentValue(e.attributes),u=l?d?.attributes?.unit_of_measurement??i:c.getCurrentValueUnit?.(e.attributes,a.config)??i,p=n?.layout?.entities?.labels??!0,m=!1!==n?.layout?.entities?.separator,g=n?.state_labels?.[e.state]??xe(e,a,r),f=(!0===n?.hide_current_value_when_off||!0===n?.hide?.current_value_when_off||!0===n?.hide?.temperature_when_off)&&e.state===De.OFF,v=[Ei({hide:t.temperature||f||null==h,state:ai(Ke(h,{...n,locale:a.locale}),u),hass:a,openEntityPopover:s,details:{heading:!!p&&(n?.label?.temperature??r("ui.card.climate.currently")),tooltip:d?.attributes?.friendly_name??l,entity:l??n.entity,separator:m}}),Ei({hide:t.state,state:g,hass:a,openEntityPopover:s,details:{heading:!!p&&(n?.label?.state??r("ui.panel.lovelace.editor.card.generic.state")),entity:n.entity,separator:m}}),...(o??[]).map(({name:t,state:i,show:o,display:c,_hide_when_off:l,hide_when_off:d,...h})=>Ei({hide:!1===o||(!0===l||!0===d)&&e.state===De.OFF,state:i,hass:a,localize:r,openEntityPopover:s,details:{...h,heading:p&&t,tooltip:t,config:n,variables:n.variables,separator:m,display:c??n?.layout?.entities?.display}}))||null].filter(t=>null!==t);return function(t,e){const{type:i="table",labels:a=!0,alignment:o}=t?.layout?.entities??{},n=[a?"with-labels":"without-labels","list"===i?"as-list":"as-table","left"===o?"align-left":"",1===e.filter(t=>null!=t).length?"single-row":""];return B` <div class="entities ${n.join(" ")}">${e}</div> `}(n,v)}const Ci=new Set(["heat_cool","fan_only"]);function Ti(t,e,i){if(!e||!i)return{layout:"inline",lines:e?[e]:[]};const a=e.trim();if(!a)return{layout:"inline",lines:[]};if("heat_cool"===t){const t=a.split(/\s*\/\s*/).filter(Boolean);if(2===t.length&&t.every(t=>t.length>0&&t.length<=12))return{layout:"stacked",lines:t}}if("fan_only"===t){const t=a.split(/\s+/).filter(Boolean);if(2===t.length&&t.every(t=>t.length>0&&t.length<=10))return{layout:"stacked",lines:t}}return Ci.has(t)&&a.length>10?{layout:"column",lines:[a]}:{layout:"inline",lines:[a]}}const Ri={"st:fan-speed-4":{path:"M16 15V21H19V23H21V15H19V19H18V15H16Z"},"st:fan-speed-5":{path:"M16 15H21V17H18V18H19C20.11 18 21 18.89 21 20V21C21 22.11 20.11 23 19 23H16V21H19V20H16V15Z"}};function Oi(t){return t?B` <ha-icon class="mode-icon" .icon=${t}></ha-icon> `:null}function Ni({state:t,entity:e,hass:i,mode:a,adapter:o,modeOptions:n,localize:r,setMode:s}){const{type:c,hide_when_off:l,mode:d="none",list:h,name:u,heading:p,icons:m}=a;if(0===h.length||l&&t===De.OFF)return null;const g="hvac"===c?null:o.getModePayloadKey(c),f=a.entity?i?.states?.[a.entity]:void 0,v=!be(a.entity?f:e);let y=g?`state_attributes.${o.getLocalizationDomain()}.${g}.`:"";"hvac"===c?y="component.climate.state._.":"vane_horizontal"===c||"vane_vertical"===c?y="":"direction"!==c&&"oscillating"!==c&&"mode"!==c||(y="");const b=(t,a,o)=>{if(!1!==t&&!0===o||!1!==t&&void 0===o&&t!==a)return t;if(f&&"function"==typeof i?.formatEntityState)return i.formatEntityState({...f,state:a});if(("hvac"===c||"state"===c)&&"function"==typeof i?.formatEntityState)return i.formatEntityState({...e,state:a});if(g&&e&&"function"==typeof i?.formatEntityAttributeValue)return i.formatEntityAttributeValue(e,g,a);const n=y?r(a,y):a;return n&&n!==a?n:!1===t?a:t},_=(t,e)=>{for(const e of Array.isArray(t)?t:[t]){const t=r(e);if(t&&t!==e)return t}return e};let w;w="vane_horizontal"===c?"Vane Horizontal":"vane_vertical"===c?"Vane Vertical":"swing_horizontal"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.swing_horizontal_modes","Swing Horizontal"):"swing_vertical"===c?"Swing Vertical":"direction"===c?_("ui.card.fan.direction","Direction"):"oscillating"===c?_("ui.card.fan.oscillate","Oscillating"):"mode"===c?_(`ui.card.${o.getLocalizationDomain()}.mode`,"Mode"):"preset"===c?!0===p&&_("fan"===o.getLocalizationDomain()?"ui.card.fan.preset_mode":"ui.card.climate.preset","Preset"):"state"===c?!0===p&&_(`ui.card.${o.getLocalizationDomain()}.state`,"State"):"fan"===c?_("ui.panel.lovelace.editor.features.types.climate-fan-modes.fan_modes","Mode"):"swing"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-modes.swing_modes","Mode"):_(`ui.card.${o.getLocalizationDomain()}.mode`,"hvac"===c?"Operation":"Mode");const x=!1!==u&&(u||w),$="fan"===c||"preset"===c&&"fan"===o.getLocalizationDomain()?_("ui.panel.lovelace.editor.features.types.climate-fan-modes.fan_modes","Fan speed"):"swing"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-modes.swing_modes","Swing mode"):"swing_horizontal"===c?_("ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.swing_horizontal_modes","Horizontal swing"):"swing_vertical"===c?_("ui.card.climate.swing_vertical_mode","Vertical swing"):"vane_horizontal"===c?"Horizontal vane":"vane_vertical"===c?"Vertical vane":"string"==typeof w?w:"",S=x||$||c,A=(!0==Line truncated
|
||||
<div
|
||||
class="modes ${c} ${k?"fan-preset":""} ${A?"heading":""} ${z?"compact":""} ${C?"dense":""} ${E?"sparse":""}"
|
||||
role="group"
|
||||
aria-label=${S}
|
||||
>
|
||||
${A?B` <div class="mode-title">${x}</div> `:""}
|
||||
${h.map(({value:e,icon:i,iconConfigured:o,name:a,nameConfigured:r,hide_when_off:l})=>{if(!0===l&&t===De.OFF)return q;const h=(t=>String(t).replace(/[^a-z0-9_-]/gi,""))(e),u=((t,e,i)=>!1===t||!1===n?.names?null:b(t,e,i))(a,e,r),p=b(a,e,r),g=Ti(String(e),u,E),f="stacked"===g.layout?"label-stacked":"column"===g.layout?"label-column":"",y=u?q:$||q;return B`
|
||||
${h.map(({value:e,icon:i,iconConfigured:a,name:o,nameConfigured:r,hide_when_off:l})=>{if(!0===l&&t===De.OFF)return q;const h=(t=>String(t).replace(/[^a-z0-9_-]/gi,""))(e),u=((t,e,i)=>!1===t||!1===n?.names?null:b(t,e,i))(o,e,r),p=b(o,e,r),g=Ti(String(e),u,E),f="stacked"===g.layout?"label-stacked":"column"===g.layout?"label-column":"",y=u?q:$||q;return B`
|
||||
<div
|
||||
class="mode-item ${h} ${f} ${e===d?"active":""}"
|
||||
role="button"
|
||||
@@ -3217,7 +3237,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
@click=${()=>{v||s(c,e)}}
|
||||
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),v||s(c,e))}}
|
||||
>
|
||||
${((t,e=!1)=>t?!1===n?.icons||!1===m||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c)&&!0!==m&&!e?null:Oi(t):null)(i,o)}
|
||||
${((t,e=!1)=>t?!1===n?.icons||!1===m||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c)&&!0!==m&&!e?null:Oi(t):null)(i,a)}
|
||||
${((t,e)=>{if(!e)return null;const i=Ti(t,e,E);return"stacked"===i.layout?B`<span class="mode-label">
|
||||
${i.lines.map(t=>B`<span class="mode-label-line">${t}</span>`)}
|
||||
</span>`:B`<span class="mode-label"
|
||||
@@ -3226,16 +3246,16 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
</div>
|
||||
`})}
|
||||
</div>
|
||||
`}window.customIconsets=window.customIconsets||{},window.customIconsets.st||(window.customIconsets.st=async t=>{const e=Ri[`st:${t}`];return e?{path:`M13 19C13 17.59 13.5 16.3 14.3 15.28C14.17 14.97 14.03 14.65 13.86 14.34C14.26 14 14.57 13.59 14.77 13.11C15.26 13.21 15.78 13.39 16.25 13.67C17.07 13.25 18 13 19 13C20.05 13 21.03 13.27 21.89 13.74C21.95 13.37 22 12.96 22 12.5C22 8.92 18.03 8.13 14.33 10.13C14 9.73 13.59 9.42 13.11 9.22C13.3 8.29 13.74 7.24 14.73 6.75C17.09 5.57 17 2 12.5 2C8.93 2 8.14 5.96 10.13 9.65C9.72 9.97 9.4 10.39 9.21 10.87C8.28 10.68 7.23 10.25 6.73 9.26C5.56 6.89 2 7 2 11.5C2 15.07 5.95 15.85 9.64 13.87C9.96 14.27 10.39 14.59 10.88 14.79C10.68 15.71 10.24 16.75 9.26 17.24C6.9 18.42 7 22 11.5 22C12.31 22 13 21.78 13.5 21.41C13.19 20.67 13 19.86 13 19M12 13C11.43 13 11 12.55 11 12S11.43 11 12 11C12.54 11 13 11.45 13 12S12.54 13 12 13${e.path}`}:{path:""}});const Mi=t=>String(t).replace(/[^a-z0-9_-]/gi,"");function Pi({toggles:t,mainState:e,toggleFooterEntity:i,openEntityPopover:o}){const a=t.filter(t=>!(!0===t.hide_when_off&&e===De.OFF));return a.length?B`
|
||||
`}window.customIconsets=window.customIconsets||{},window.customIconsets.st||(window.customIconsets.st=async t=>{const e=Ri[`st:${t}`];return e?{path:`M13 19C13 17.59 13.5 16.3 14.3 15.28C14.17 14.97 14.03 14.65 13.86 14.34C14.26 14 14.57 13.59 14.77 13.11C15.26 13.21 15.78 13.39 16.25 13.67C17.07 13.25 18 13 19 13C20.05 13 21.03 13.27 21.89 13.74C21.95 13.37 22 12.96 22 12.5C22 8.92 18.03 8.13 14.33 10.13C14 9.73 13.59 9.42 13.11 9.22C13.3 8.29 13.74 7.24 14.73 6.75C17.09 5.57 17 2 12.5 2C8.93 2 8.14 5.96 10.13 9.65C9.72 9.97 9.4 10.39 9.21 10.87C8.28 10.68 7.23 10.25 6.73 9.26C5.56 6.89 2 7 2 11.5C2 15.07 5.95 15.85 9.64 13.87C9.96 14.27 10.39 14.59 10.88 14.79C10.68 15.71 10.24 16.75 9.26 17.24C6.9 18.42 7 22 11.5 22C12.31 22 13 21.78 13.5 21.41C13.19 20.67 13 19.86 13 19M12 13C11.43 13 11 12.55 11 12S11.43 11 12 11C12.54 11 13 11.45 13 12S12.54 13 12 13${e.path}`}:{path:""}});const Mi=t=>String(t).replace(/[^a-z0-9_-]/gi,"");function Pi({toggles:t,mainState:e,toggleFooterEntity:i,openEntityPopover:a}){const o=t.filter(t=>!(!0===t.hide_when_off&&e===De.OFF));return o.length?B`
|
||||
<section class="footer-controls controls">
|
||||
<div
|
||||
class="modes footer compact ${a.length>4?"dense":""}"
|
||||
class="modes footer compact ${o.length>4?"dense":""}"
|
||||
role="group"
|
||||
aria-label="Footer controls"
|
||||
>
|
||||
${a.map(t=>{const e=t.state.entity_id,a=String(t.state.state??""),n="on"===a,r=!be(t.state),s=!1!==t.name&&(t.name||t.state.attributes?.friendly_name||e),c=t.icon??t.state.attributes?.icon,l=e.split(".")[0];return B`
|
||||
${o.map(t=>{const e=t.state.entity_id,o=String(t.state.state??""),n="on"===o,r=!be(t.state),s=!1!==t.name&&(t.name||t.state.attributes?.friendly_name||e),c=t.icon??t.state.attributes?.icon,l=e.split(".")[0];return B`
|
||||
<div
|
||||
class="mode-item footer-toggle ${Mi(a)} domain-${Mi(l)} ${n?"active":""}"
|
||||
class="mode-item footer-toggle ${Mi(o)} domain-${Mi(l)} ${n?"active":""}"
|
||||
role="button"
|
||||
tabindex=${r?-1:0}
|
||||
aria-disabled=${String(r)}
|
||||
@@ -3244,7 +3264,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
title=${s||e}
|
||||
@click=${()=>{r||i(e,!n)}}
|
||||
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r||i(e,!n))}}
|
||||
@contextmenu=${t=>{t.preventDefault(),o(e)}}
|
||||
@contextmenu=${t=>{t.preventDefault(),a(e)}}
|
||||
>
|
||||
${c?Oi(c):q}
|
||||
${s?B`<span class="mode-label">${s}</span>`:q}
|
||||
@@ -3252,7 +3272,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
`})}
|
||||
</div>
|
||||
</section>
|
||||
`:q}const ji={target_temp_low:{field:"target_temp_high",caps:"max"},target_temp_high:{field:"target_temp_low",caps:"min"}},Fi=Object.values(yt),Ii="hass:chevron-up",Li="hass:chevron-down",Hi="mdi:plus",Vi="mdi:minus",Di={temperature:!1,state:!1},Ui=[yt.PRESET,yt.FAN,yt.HVAC,yt.SWING,yt.SWING_HORIZONTAL,yt.SWING_VERTICAL,yt.VANE_HORIZONTAL,yt.VANE_VERTICAL,yt.DIRECTION,yt.OSCILLATING,yt.STATE],Wi=["entity","hide_when_off","hide_off_when_off"];function Bi(t,e=1){if(null===t||""===t||"boolean"==typeof t)return e;const i=Number(t);return Number.isInteger(i)&&i>=0&&i<=100?i:e}function Gi(t,e,i){const o=Ki(String(e),i);if(Zi(o))return!1!==o.include;const a=Object.keys(i).some(t=>!t.startsWith("_")&&!Wi.includes(t)),n=t===yt.PRESET;return o??!(n&&a)}function qi(t){return t.toLowerCase().replace(/\s+/g,"_")}function Ki(t,e){const i=qi(t),o=e[t];if(void 0!==o)return o;if(void 0!==e[i])return e[i];const a=Object.entries(e).find(([t])=>!t.startsWith("_")&&!Wi.includes(t)&&qi(t)===i);return a?.[1]}function Zi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ji(t,e){const i=Array.isArray(e._order)?e._order.map(String):Object.keys(e).filter(t=>!t.startsWith("_")&&!Wi.includes(t));if(0===i.length)return t;const o=new Map;t.forEach(t=>{o.set(qi(String(t)),t)});const a=new Set,n=[];return i.forEach(t=>{const e=qi(t);o.has(e)&&!a.has(e)&&(n.push(o.get(e)),a.add(e))}),t.forEach(t=>{const e=qi(String(t));a.has(e)||(n.push(t),a.add(e))}),n}function Yi(t,e,i,o={}){let a=e[i.getModeAttribute(t)];return t===yt.STATE?a=["off","on"]:t===yt.DIRECTION&&e.direction?a=["forward","reverse"]:t===yt.OSCILLATING&&"boolean"==typeof e.oscillating&&(a=[!1,!0]),Array.isArray(a)?Ji(a,o).filter(e=>Gi(t,e,o)).map(e=>{const i=String(e),n=Ki(i,o),r=Zi(n)?n:{},{name:s,...c}=r,l=!0===r.hide_when_off||!0===o.hide_off_when_off&&"off"===qi(i),d=!1!==s&&("string"==typeof s?s:Ce(i));return{...c,hide_when_off:l||void 0,icon:r.icon??(t===yt.FAN?qe(i,a):void 0)??ze(i),iconConfigured:void 0!==r.icon,nameConfigured:void 0!==s,value:i,name:d}}):[]}function Xi(t){return"string"==typeof t?.entity_id&&t.entity_id.startsWith("select.")&&Array.isArray(t.attributes?.options)}function Qi(t,e={}){return Ji(t.attributes.options,e).filter(t=>Gi("select",t,e)).map(t=>{const i=String(t),o=Ki(i,e),a=Zi(o)?o:{},{name:n,...r}=a,s=!0===a.hide_when_off||!0===e.hide_off_when_off&&"off"===qi(i),c=!1!==n&&("string"==typeof n?n:Ce(i));return{...r,hide_when_off:s||void 0,icon:a.icon??ze(i),iconConfigured:void 0!==a.icon,nameConfigured:void 0!==n,value:i,name:c}})}function to(t,e,i,o){return Fi.includes(t)&&(t===yt.STATE?"fan"===e||"humidifier"===e:void 0!==i[o.getModeAttribute(t)])}function eo(t,e,i,o){return t.filter(t=>to(t,e,i,o)).map(t=>({type:t,hide_when_off:!1,list:Yi(t,i,o)}))}class io extends lt{constructor(){super(...arguments),this.modes=[],this._hass={},this.entities=[],this.footer=[],this.showEntities=!0,this.name="",this.stepSize=.5,this._values={},this._updatingValues=!1,this._hide=Di,this._updatingValuesTimeout=null,this._holdTimer=null,this._holdFired=!1,this._clickCount=0,this._clickTimer=null,this._setpointUpdateTimer=null,this._pendingSetpointUpdate=null,this._missingEntityTimer=null,this._stepRepeatDelayTimer=null,this._stepRepeatIntervalTimer=null,this._stepRepeatFired=!1,this._setpointDebounce=500,this.localize=(t,e="")=>{const i=`${e}${t}`;return this._hass.localize?.(i)||t},this.toggleEntityChanged=(t,e)=>{if(!this.header||!e)return;if(!be(this._hass?.states?.[e]))return;const i=t.target;this._callAction("homeassistant.turn_"+(i.checked?"on":"off"),{entity_id:e})},this.toggleFooterEntity=(t,e)=>{be(this._hass?.states?.[t])&&(this._callAction("homeassistant.turn_"+(e?"on":"off"),{entity_id:t}),_t(this,"haptic","light"))},this._stopSetpointRepeat=()=>{this._stepRepeatDelayTimer&&(clearTimeout(this._stepRepeatDelayTimer),this._stepRepeatDelayTimer=null),this._stepRepeatIntervalTimer&&(clearInterval(this._stepRepeatIntervalTimer),this._stepRepeatIntervalTimer=null)},this.setMode=(t,e)=>{if(t&&e){const i=kt(this.config.entity),o=this.modes.find(e=>e.type===t);if(o?.entity){const t=this._hass.states?.[o.entity];if(!Xi(t)||["unknown","unavailable"].includes(String(t.state))||!t.attributes.options.includes(e))return;return this._callAction("select.select_option",{entity_id:o.entity,option:e}),void _t(this,"haptic","light")}if(!be(this._hass?.states?.[this.config.entity]))return;if(t===yt.STATE)return this._callAction(`${i.getLocalizationDomain()}.turn_${e}`,{entity_id:this.config.entity}),void _t(this,"haptic","light");const a=i.transformModePayloadValue?.(t,e)??e;this._callAction(`${i.getLocalizationDomain()}.${i.getModeService(t)}`,{entity_id:this.config.entity,[i.getModePayloadKey(t)]:a}),_t(this,"haptic","light")}else _t(this,"haptic","failure")},this.openEntityPopover=(t=null)=>{_t(this,"hass-more-info",{entityId:t||this.config.entity})},this._onActionPointerDown=t=>{0!==t.button&&"mouse"===t.pointerType||(this._holdFired=!1,this._holdTimer&&c
Line truncated
|
||||
`:q}const ji={target_temp_low:{field:"target_temp_high",caps:"max"},target_temp_high:{field:"target_temp_low",caps:"min"}},Fi=Object.values(yt),Ii="hass:chevron-up",Li="hass:chevron-down",Hi="mdi:plus",Vi="mdi:minus",Di={temperature:!1,state:!1},Ui=[yt.PRESET,yt.FAN,yt.HVAC,yt.SWING,yt.SWING_HORIZONTAL,yt.SWING_VERTICAL,yt.VANE_HORIZONTAL,yt.VANE_VERTICAL,yt.DIRECTION,yt.OSCILLATING,yt.STATE],Wi=["entity","hide_when_off","hide_off_when_off"];function Bi(t,e=1){if(null===t||""===t||"boolean"==typeof t)return e;const i=Number(t);return Number.isInteger(i)&&i>=0&&i<=100?i:e}function Gi(t,e,i){const a=Ki(String(e),i);if(Zi(a))return!1!==a.include;const o=Object.keys(i).some(t=>!t.startsWith("_")&&!Wi.includes(t)),n=t===yt.PRESET;return a??!(n&&o)}function qi(t){return t.toLowerCase().replace(/\s+/g,"_")}function Ki(t,e){const i=qi(t),a=e[t];if(void 0!==a)return a;if(void 0!==e[i])return e[i];const o=Object.entries(e).find(([t])=>!t.startsWith("_")&&!Wi.includes(t)&&qi(t)===i);return o?.[1]}function Zi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ji(t,e){const i=Array.isArray(e._order)?e._order.map(String):Object.keys(e).filter(t=>!t.startsWith("_")&&!Wi.includes(t));if(0===i.length)return t;const a=new Map;t.forEach(t=>{a.set(qi(String(t)),t)});const o=new Set,n=[];return i.forEach(t=>{const e=qi(t);a.has(e)&&!o.has(e)&&(n.push(a.get(e)),o.add(e))}),t.forEach(t=>{const e=qi(String(t));o.has(e)||(n.push(t),o.add(e))}),n}function Yi(t,e,i,a={}){let o=e[i.getModeAttribute(t)];return t===yt.STATE?o=["off","on"]:t===yt.DIRECTION&&e.direction?o=["forward","reverse"]:t===yt.OSCILLATING&&"boolean"==typeof e.oscillating&&(o=[!1,!0]),Array.isArray(o)?Ji(o,a).filter(e=>Gi(t,e,a)).map(e=>{const i=String(e),n=Ki(i,a),r=Zi(n)?n:{},{name:s,...c}=r,l=!0===r.hide_when_off||!0===a.hide_off_when_off&&"off"===qi(i),d=!1!==s&&("string"==typeof s?s:Ce(i));return{...c,hide_when_off:l||void 0,icon:r.icon??(t===yt.FAN?qe(i,o):void 0)??ze(i),iconConfigured:void 0!==r.icon,nameConfigured:void 0!==s,value:i,name:d}}):[]}function Xi(t){return"string"==typeof t?.entity_id&&t.entity_id.startsWith("select.")&&Array.isArray(t.attributes?.options)}function Qi(t,e={}){return Ji(t.attributes.options,e).filter(t=>Gi("select",t,e)).map(t=>{const i=String(t),a=Ki(i,e),o=Zi(a)?a:{},{name:n,...r}=o,s=!0===o.hide_when_off||!0===e.hide_off_when_off&&"off"===qi(i),c=!1!==n&&("string"==typeof n?n:Ce(i));return{...r,hide_when_off:s||void 0,icon:o.icon??ze(i),iconConfigured:void 0!==o.icon,nameConfigured:void 0!==n,value:i,name:c}})}function ta(t,e,i,a){return Fi.includes(t)&&(t===yt.STATE?"fan"===e||"humidifier"===e:void 0!==i[a.getModeAttribute(t)])}function ea(t,e,i,a){return t.filter(t=>ta(t,e,i,a)).map(t=>({type:t,hide_when_off:!1,list:Yi(t,i,a)}))}class ia extends lt{constructor(){super(...arguments),this.modes=[],this._hass={},this.entities=[],this.footer=[],this.showEntities=!0,this.name="",this.stepSize=.5,this._values={},this._updatingValues=!1,this._hide=Di,this._updatingValuesTimeout=null,this._holdTimer=null,this._holdFired=!1,this._clickCount=0,this._clickTimer=null,this._setpointUpdateTimer=null,this._pendingSetpointUpdate=null,this._missingEntityTimer=null,this._stepRepeatDelayTimer=null,this._stepRepeatIntervalTimer=null,this._stepRepeatFired=!1,this._setpointDebounce=500,this.localize=(t,e="")=>{const i=`${e}${t}`;return this._hass.localize?.(i)||t},this.toggleEntityChanged=(t,e)=>{if(!this.header||!e)return;if(!be(this._hass?.states?.[e]))return;const i=t.target;this._callAction("homeassistant.turn_"+(i.checked?"on":"off"),{entity_id:e})},this.toggleFooterEntity=(t,e)=>{be(this._hass?.states?.[t])&&(this._callAction("homeassistant.turn_"+(e?"on":"off"),{entity_id:t}),_t(this,"haptic","light"))},this._stopSetpointRepeat=()=>{this._stepRepeatDelayTimer&&(clearTimeout(this._stepRepeatDelayTimer),this._stepRepeatDelayTimer=null),this._stepRepeatIntervalTimer&&(clearInterval(this._stepRepeatIntervalTimer),this._stepRepeatIntervalTimer=null)},this.setMode=(t,e)=>{if(t&&e){const i=kt(this.config.entity),a=this.modes.find(e=>e.type===t);if(a?.entity){const t=this._hass.states?.[a.entity];if(!Xi(t)||["unknown","unavailable"].includes(String(t.state))||!t.attributes.options.includes(e))return;return this._callAction("select.select_option",{entity_id:a.entity,option:e}),void _t(this,"haptic","light")}if(!be(this._hass?.states?.[this.config.entity]))return;if(t===yt.STATE)return this._callAction(`${i.getLocalizationDomain()}.turn_${e}`,{entity_id:this.config.entity}),void _t(this,"haptic","light");const o=i.transformModePayloadValue?.(t,e)??e;this._callAction(`${i.getLocalizationDomain()}.${i.getModeService(t)}`,{entity_id:this.config.entity,[i.getModePayloadKey(t)]:o}),_t(this,"haptic","light")}else _t(this,"haptic","failure")},this.openEntityPopover=(t=null)=>{_t(this,"hass-more-info",{entityId:t||this.config.entity})},this._onActionPointerDown=t=>{0!==t.button&&"mouse"===t.pointerType||(this._holdFired=!1,this._holdTimer&&c
Line truncated
|
||||
>Control entity unavailable or without options:
|
||||
${t.entity}</ha-alert
|
||||
>`)}),this.stepSize<1&&0===this.config.decimals&&n.push(B`
|
||||
@@ -3261,59 +3281,59 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
setpoint will likely not work. Change one of the settings to clear
|
||||
this warning.
|
||||
</ha-alert>
|
||||
`),!a&&!this._hass?.states)return B`<ha-card
|
||||
class="loading ${!1===o.enhanced_visuals?"standard-visuals":""}"
|
||||
></ha-card>`;if(!a)return B`
|
||||
`),!o&&!this._hass?.states)return B`<ha-card
|
||||
class="loading ${!1===a.enhanced_visuals?"standard-visuals":""}"
|
||||
></ha-card>`;if(!o)return B`
|
||||
<ha-card
|
||||
class="missing-entity ${!1===o.enhanced_visuals?"standard-visuals":""}"
|
||||
class="missing-entity ${!1===a.enhanced_visuals?"standard-visuals":""}"
|
||||
>
|
||||
<ha-alert alert-type="error">
|
||||
Entity not available: ${o.entity}
|
||||
Entity not available: ${a.entity}
|
||||
</ha-alert>
|
||||
</ha-card>
|
||||
`;const r=kt(o.entity),s=we(a),{min:c,max:l}=r.getRange(a.attributes),d=this.getUnit(),h=o.entity.split(".")[0],u=this.areSetpointsHidden()?0:Object.keys(e).length,p=this.config?.layout?.step,m=!p&&this.showEntities&&u>1,g=p??(!1===this.config.enhanced_visuals||m?"column":"row"),f="row"===g,v=["unavailable","unknown"].includes(a.state),y=t=>"string"==typeof t?t.replace(/[^a-z0-9_-]/gi,""):"",b=[!this.header&&"no-header",`domain-${y(h)}`,`state-${y(a.state)}`,!1===this.config.enhanced_visuals&&"standard-visuals",!0===this.config.embedded&&"embedded",y(s),v&&y(a.state)].filter(t=>!!t),_=["body",this.showEntities&&"has-entities",`step-${g}`,`setpoint-count-${u}`].filter(t=>!!t),w=!0===o.embedded,x=function(t,e){if("fan"!==t)return"";const i=Number(e?.percentage);if(Number.isNaN(i))return"";const o=Math.min(Math.max(i,0),100);return`--st-fan-spin-duration: ${Math.max(.9,3.2-o/100*2.1).toFixed(2)}s;`}(h,a.attributes),$=w?function(t){const e=t?.style,i="string"==typeof e?e:e&&"object"==typeof e?Object.entries(e).flatMap(([t,e])=>"string"!=typeof e?[]:"."===t?[e]:"ha-card"===t?[`ha-card { ${e} }`]:[]).join("\n"):"";return i.includes("{{")||i.includes("{%")?"":i}(o.card_mod):"",S=this.showEntities?zi({_hide:t,unit:d,hass:this._hass,entity:this.entity,entities:this.entities,config:this.config,adapter:r,localize:this.localize,openEntityPopover:this.openEntityPopover}):"",A=w?B`<div class="embedded-header-reserve" aria-hidden="true"></div>`:ei({header:this.header,hass:this._hass,toggleEntityChanged:this.toggleEntityChanged,entity:this.entity,openEntityPopover:this.openEntityPopover});return B`
|
||||
`;const r=kt(a.entity),s=we(o),{min:c,max:l}=r.getRange(o.attributes),d=this.getUnit(),h=a.entity.split(".")[0],u=this.areSetpointsHidden()?0:Object.keys(e).length,p=this.config?.layout?.step,m=!p&&this.showEntities&&u>1,g=p??(!1===this.config.enhanced_visuals||m?"column":"row"),f="row"===g,v=["unavailable","unknown"].includes(o.state),y=t=>"string"==typeof t?t.replace(/[^a-z0-9_-]/gi,""):"",b=[!this.header&&"no-header",`domain-${y(h)}`,`state-${y(o.state)}`,!1===this.config.enhanced_visuals&&"standard-visuals",!0===this.config.embedded&&"embedded",y(s),v&&y(o.state)].filter(t=>!!t),_=["body",this.showEntities&&"has-entities",`step-${g}`,`setpoint-count-${u}`].filter(t=>!!t),w=!0===a.embedded,x=function(t,e){if("fan"!==t)return"";const i=Number(e?.percentage);if(Number.isNaN(i))return"";const a=Math.min(Math.max(i,0),100);return`--st-fan-spin-duration: ${Math.max(.9,3.2-a/100*2.1).toFixed(2)}s;`}(h,o.attributes),$=w?function(t){const e=t?.style,i="string"==typeof e?e:e&&"object"==typeof e?Object.entries(e).flatMap(([t,e])=>"string"!=typeof e?[]:"."===t?[e]:"ha-card"===t?[`ha-card { ${e} }`]:[]).join("\n"):"";return i.includes("{{")||i.includes("{%")?"":i}(a.card_mod):"",S=this.showEntities?zi({_hide:t,unit:d,hass:this._hass,entity:this.entity,entities:this.entities,config:this.config,adapter:r,localize:this.localize,openEntityPopover:this.openEntityPopover}):"",A=w?B`<div class="embedded-header-reserve" aria-hidden="true"></div>`:ei({header:this.header,hass:this._hass,toggleEntityChanged:this.toggleEntityChanged,entity:this.entity,openEntityPopover:this.openEntityPopover});return B`
|
||||
<ha-card class="${b.join(" ")}" style=${x}>
|
||||
${$?B`<style>
|
||||
${$}
|
||||
</style>`:q}
|
||||
${o.styles?B`<style>
|
||||
${o.styles}
|
||||
${a.styles?B`<style>
|
||||
${a.styles}
|
||||
</style>`:q}
|
||||
${n} ${A}
|
||||
<section class="${_.join(" ")}">
|
||||
${S}
|
||||
${u?B`<div class="setpoints">
|
||||
${this.renderSetpoints({values:e,minValue:c,maxValue:l,unit:d,row:f,stepLayout:g,isOff:a.state===De.OFF,disableSteppers:!be(a)||!0===this.config.disable_setpoint_change||"climate"===h&&a.state===De.OFF&&!0===this.config.disable_setpoint_change_when_off})}
|
||||
${this.renderSetpoints({values:e,minValue:c,maxValue:l,unit:d,row:f,stepLayout:g,isOff:o.state===De.OFF,disableSteppers:!be(o)||!0===this.config.disable_setpoint_change||"climate"===h&&o.state===De.OFF&&!0===this.config.disable_setpoint_change_when_off})}
|
||||
</div>`:q}
|
||||
</section>
|
||||
|
||||
${this.modes.length?B`
|
||||
<section class="controls">
|
||||
${this.modes.map(t=>Ni({state:a.state,entity:a,hass:this._hass,mode:t,adapter:r,localize:this.localize,modeOptions:this.config?.layout?.mode??{},setMode:this.setMode}))}
|
||||
${this.modes.map(t=>Ni({state:o.state,entity:o,hass:this._hass,mode:t,adapter:r,localize:this.localize,modeOptions:this.config?.layout?.mode??{},setMode:this.setMode}))}
|
||||
</section>
|
||||
`:q}
|
||||
${Pi({toggles:this.footer,mainState:a.state,toggleFooterEntity:this.toggleFooterEntity,openEntityPopover:this.openEntityPopover})}
|
||||
${Pi({toggles:this.footer,mainState:o.state,toggleFooterEntity:this.toggleFooterEntity,openEntityPopover:this.openEntityPopover})}
|
||||
</ha-card>
|
||||
`}renderSetpoints({values:t,minValue:e,maxValue:i,unit:o,row:a,stepLayout:n,isOff:r,disableSteppers:s}){return!0===this.config.hide_setpoint||!0===this.config.hide_setpoint_when_off&&r||!0===this.config.hide?.setpoint_when_off&&r?q:Object.entries(t).map(([t,c])=>this.renderSetpointControl({field:t,value:c,minValue:e,maxValue:i,unit:o,row:a,stepLayout:n,isOff:r,disableSteppers:s}))}areSetpointsHidden(){return!0===this.config.hide_setpoint||(!0===this.config.hide_setpoint_when_off||!0===this.config.hide?.setpoint_when_off)&&this.entity?.state===De.OFF}renderSetpointControl(t){const{row:e,stepLayout:i}=t,o=this.renderSetpointStepper(t,"decrease"),a=this.renderSetpointValue(t),n=this.renderSetpointStepper(t,"increase"),r=this.renderSetpointLabel(t);return B`
|
||||
`}renderSetpoints({values:t,minValue:e,maxValue:i,unit:a,row:o,stepLayout:n,isOff:r,disableSteppers:s}){return!0===this.config.hide_setpoint||!0===this.config.hide_setpoint_when_off&&r||!0===this.config.hide?.setpoint_when_off&&r?q:Object.entries(t).map(([t,c])=>this.renderSetpointControl({field:t,value:c,minValue:e,maxValue:i,unit:a,row:o,stepLayout:n,isOff:r,disableSteppers:s}))}areSetpointsHidden(){return!0===this.config.hide_setpoint||(!0===this.config.hide_setpoint_when_off||!0===this.config.hide?.setpoint_when_off)&&this.entity?.state===De.OFF}renderSetpointControl(t){const{row:e,stepLayout:i}=t,a=this.renderSetpointStepper(t,"decrease"),o=this.renderSetpointValue(t),n=this.renderSetpointStepper(t,"increase"),r=this.renderSetpointLabel(t);return B`
|
||||
<div class="current-wrapper ${i}">
|
||||
${e?B`${o}${a}${n}`:B`${n}${a}${o}`}
|
||||
${e?B`${a}${o}${n}`:B`${n}${o}${a}`}
|
||||
${r}
|
||||
</div>
|
||||
`}renderSetpointLabel({field:t}){if(!0===this.config.hide?.setpoint_label)return q;const e=this._getSetpointLabel(t);return B`<div class="current--label">${e}</div>`}renderSetpointStepper({field:t,value:e,minValue:i,maxValue:o,row:a,disableSteppers:n},r){const s=this._setpointBounds(t,i,o),c=Number(e),l=!Number.isNaN(c),d="decrease"===r,h=n||(d?null===e||null!==s.min&&l&&c<=s.min:null===e&&null===s.min||null!==e&&null!==s.max&&l&&c>=s.max),u=d?a?Vi:Li:a?Hi:Ii,p=this._localizeFirst(d?["ui.common.decrease","ui.components.selectors.number.decrement"]:["ui.common.increase","ui.components.selectors.number.increment"],d?"Decrease":"Increase");return B`
|
||||
`}renderSetpointLabel({field:t}){if(!0===this.config.hide?.setpoint_label)return q;const e=this._getSetpointLabel(t);return B`<div class="current--label">${e}</div>`}renderSetpointStepper({field:t,value:e,minValue:i,maxValue:a,row:o,disableSteppers:n},r){const s=this._setpointBounds(t,i,a),c=Number(e),l=!Number.isNaN(c),d="decrease"===r,h=n||(d?null===e||null!==s.min&&l&&c<=s.min:null===e&&null===s.min||null!==e&&null!==s.max&&l&&c>=s.max),u=d?o?Vi:Li:o?Hi:Ii,p=this._localizeFirst(d?["ui.common.decrease","ui.components.selectors.number.decrement"]:["ui.common.increase","ui.components.selectors.number.increment"],d?"Decrease":"Increase");return B`
|
||||
<button
|
||||
type="button"
|
||||
?disabled=${h}
|
||||
class="thermostat-trigger ${r}"
|
||||
aria-label=${`${p} ${this._getSetpointLabel(t)}`}
|
||||
@pointerdown=${e=>this._startSetpointRepeat(e,t,d?-1:1,i,o)}
|
||||
@pointerdown=${e=>this._startSetpointRepeat(e,t,d?-1:1,i,a)}
|
||||
@pointerup=${this._stopSetpointRepeat}
|
||||
@pointercancel=${this._stopSetpointRepeat}
|
||||
@pointerleave=${this._stopSetpointRepeat}
|
||||
@click=${()=>{this._stepRepeatFired?this._stepRepeatFired=!1:this._stepSetpoint(t,d?-1:1,i,o)}}
|
||||
@click=${()=>{this._stepRepeatFired?this._stepRepeatFired=!1:this._stepSetpoint(t,d?-1:1,i,a)}}
|
||||
>
|
||||
<ha-icon .icon=${u}></ha-icon>
|
||||
</button>
|
||||
`}_setpointBounds(t,e,i){const o=ji[t];if(!o)return{min:e,max:i};const a=this._values[o.field];if(null==a)return{min:e,max:i};const n=Number(a);return Number.isFinite(n)?"max"===o.caps?{min:e,max:null===i?n:Math.min(i,n)}:{min:null===e?n:Math.max(e,n),max:i}:{min:e,max:i}}_stepSetpoint(t,e,i,o){if(!be(this._hass?.states?.[this.config.entity]))return!1;const{min:a,max:n}=this._setpointBounds(t,i,o),r=this._values[t];if(null==r)return e>0&&null!==a&&this.setTemperature(0,t,a),!1;const s=Number(r);if(!Number.isFinite(s))return!1;if(e>0&&null!==n&&s>=n)return!1;if(e<0&&null!==a&&s<=a)return!1;const c=s+e*this.stepSize,l=e>0&&null!==n?Math.min(c,n):e<0&&null!==a?Math.max(c,a):c;return this.setTemperature(0,t,l),!0}_startSetpointRepeat(t,e,i,o,a){"mouse"===t.pointerType&&0!==t.button||(this._stepRepeatFired=!1,!0===this.config.setpoint_hold_repeat&&(this._stopSetpointRepeat(),this._stepRepeatDelayTimer=setTimeout(()=>{this._stepRepeatDelayTimer=null,this._stepRepeatFired=this._stepSetpoint(e,i,o,a),this._stepRepeatFired&&(this._stepRepeatIntervalTimer=setInterval(()=>{this._stepSetpoint(e,i,o,a)||this._stopSetpointRepeat()},250))},500)))}_clearOptimisticSetpointState(){this._updatingValues=!1,this._updatingValuesTimeout&&(clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=null)}renderSetpointValue({field:t,value:e,unit:i,isOff:o}){const a=["string","number"].includes(typeof e)&&""!==e&&null!==e,n=!1!==i&&a,r=o&&!a,s=r?this._localizeFirst(["component.climate.entity_component._.state.off","component.climate.state._.off"],"OFF"):Ke(e,{...this.config,locale:this._hass.locale}),c=n&&"string"==typeof i?i:"",l="%"===c?"":" ",d=c&&s.endsWith(c)?s.slice(0,-c.length).trimEnd():s,h=c?`${d}${l}${c}`:s;return B`
|
||||
`}_setpointBounds(t,e,i){const a=ji[t];if(!a)return{min:e,max:i};const o=this._values[a.field];if(null==o)return{min:e,max:i};const n=Number(o);return Number.isFinite(n)?"max"===a.caps?{min:e,max:null===i?n:Math.min(i,n)}:{min:null===e?n:Math.max(e,n),max:i}:{min:e,max:i}}_stepSetpoint(t,e,i,a){if(!be(this._hass?.states?.[this.config.entity]))return!1;const{min:o,max:n}=this._setpointBounds(t,i,a),r=this._values[t];if(null==r)return e>0&&null!==o&&this.setTemperature(0,t,o),!1;const s=Number(r);if(!Number.isFinite(s))return!1;if(e>0&&null!==n&&s>=n)return!1;if(e<0&&null!==o&&s<=o)return!1;const c=s+e*this.stepSize,l=e>0&&null!==n?Math.min(c,n):e<0&&null!==o?Math.max(c,o):c;return this.setTemperature(0,t,l),!0}_startSetpointRepeat(t,e,i,a,o){"mouse"===t.pointerType&&0!==t.button||(this._stepRepeatFired=!1,!0===this.config.setpoint_hold_repeat&&(this._stopSetpointRepeat(),this._stepRepeatDelayTimer=setTimeout(()=>{this._stepRepeatDelayTimer=null,this._stepRepeatFired=this._stepSetpoint(e,i,a,o),this._stepRepeatFired&&(this._stepRepeatIntervalTimer=setInterval(()=>{this._stepSetpoint(e,i,a,o)||this._stopSetpointRepeat()},250))},500)))}_clearOptimisticSetpointState(){this._updatingValues=!1,this._updatingValuesTimeout&&(clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=null)}renderSetpointValue({field:t,value:e,unit:i,isOff:a}){const o=["string","number"].includes(typeof e)&&""!==e&&null!==e,n=!1!==i&&o,r=a&&!o,s=r?this._localizeFirst(["component.climate.entity_component._.state.off","component.climate.state._.off"],"OFF"):Ke(e,{...this.config,locale:this._hass.locale}),c=n&&"string"==typeof i?i:"",l="%"===c?"":" ",d=c&&s.endsWith(c)?s.slice(0,-c.length).trimEnd():s,h=c?`${d}${l}${c}`:s;return B`
|
||||
<h3
|
||||
@pointerdown=${this._onActionPointerDown}
|
||||
@pointerup=${this._onActionPointerUp}
|
||||
@@ -3329,4 +3349,4 @@ ha-card.standard-visuals .thermostat-trigger:active {
|
||||
>${c}</span
|
||||
>`:q}
|
||||
</h3>
|
||||
`}setTemperature(t,e,i){if(!be(this._hass?.states?.[this.config.entity]))return;this._updatingValues=!0,this._updatingValuesTimeout&&clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=setTimeout(()=>{this._updatingValues=!1,this._updatingValuesTimeout=null,this._hass?.states?.[this.config.entity]&&this.updateFromHass(this._hass)},1e4);const o=this._pendingSetpointUpdate?.entity===this.config.entity?this._pendingSetpointUpdate.values[e]:void 0,a=i??o??this._values[e],n=Number(a)+t;if(!Number.isFinite(n))return;const r=Bi(this.config.decimals);this._values={...this._values,[e]:+Ke(n,{decimals:r})},this._scheduleSetpointValues(this._values)}_dispatchSetpointTap(){this.config?.tap_action?this._dispatchAction("tap"):this.openEntityPopover(this.config.entity)}_dispatchAction(t){const e="tap"===t?"tap_action":"hold"===t?"hold_action":"double_tap_action",i=this.config?.[e]??("tap"===t?{action:"more-info"}:{action:"none"});_t(this,"hass-action",{config:this.config,action:i})}getCardSize(){if(!this.config)return 1;const t=!0===this.config.embedded||this.header?1:0,e=this.showEntities&&this.entities?.length?Math.max(1,Math.ceil(this.entities.length/2)):0,i=!0===this.config.hide_setpoint||!0===this.config.hide_setpoint_when_off&&this.entity?.state===De.OFF||!0===this.config.hide?.setpoint_when_off&&this.entity?.state===De.OFF?0:1,o=this.modes?.filter(t=>(!0!==t.hide_when_off||this.entity?.state!==De.OFF)&&(t.list??[]).some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===De.OFF))).length??0,a=this.footer?.some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===De.OFF))?1:0,n=this.stepSize<1&&0===this.config.decimals?1:0;return Math.max(1,t+e+i+o+a+n)}getUnit(){if(["boolean","string"].includes(typeof this.config.unit))return this.config?.unit;const t=this.config.entity.split(".")[0];return"fan"===t||"humidifier"===t?"%":this._hass.config?.unit_system?.temperature??!1}}io.HOLD_MS=500,io.DOUBLE_TAP_MS=250,i([pt()],io.prototype,"config",void 0),i([pt()],io.prototype,"header",void 0),i([pt()],io.prototype,"service",void 0),i([pt()],io.prototype,"modes",void 0),i([pt()],io.prototype,"entity",void 0),i([pt()],io.prototype,"entities",void 0),i([pt()],io.prototype,"footer",void 0),i([pt()],io.prototype,"showEntities",void 0),i([pt()],io.prototype,"name",void 0),i([pt({type:Object})],io.prototype,"_values",void 0),i([pt()],io.prototype,"_updatingValues",void 0),i([pt()],io.prototype,"_hide",void 0),customElements.get(t)||customElements.define(t,io),customElements.get(`${t}-editor`)||customElements.define(`${t}-editor`,ee),customElements.get(`${t}-group`)||customElements.define(`${t}-group`,Ve),customElements.get(`${t}-group-editor`)||customElements.define(`${t}-group-editor`,ye),console.info(`%c SIMPLE-THERMOSTAT %c v${e} `,"color: var(--text-primary-color); background: var(--primary-color); font-weight: 700; padding: 2px 6px; border-radius: 3px 0 0 3px;","color: var(--primary-color); background: var(--card-background-color); font-weight: 700; padding: 2px 6px; border-radius: 0 3px 3px 0;");const oo=window;oo.customCards=oo.customCards||[],oo.customCards.find(e=>e.type===t)||oo.customCards.push({type:t,name:"Simple Thermostat",preview:!0,description:"A different take on the thermostat card",documentationURL:"https://github.com/Wheemer/simple-thermostat"}),oo.customCards.find(e=>e.type===`${t}-group`)||oo.customCards.push({type:`${t}-group`,name:"Simple Thermostat Group",preview:!0,description:"Switch between multiple thermostat cards in one footprint",documentationURL:"https://github.com/Wheemer/simple-thermostat"});
|
||||
`}setTemperature(t,e,i){if(!be(this._hass?.states?.[this.config.entity]))return;this._updatingValues=!0,this._updatingValuesTimeout&&clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=setTimeout(()=>{this._updatingValues=!1,this._updatingValuesTimeout=null,this._hass?.states?.[this.config.entity]&&this.updateFromHass(this._hass)},1e4);const a=this._pendingSetpointUpdate?.entity===this.config.entity?this._pendingSetpointUpdate.values[e]:void 0,o=i??a??this._values[e],n=Number(o)+t;if(!Number.isFinite(n))return;const r=Bi(this.config.decimals);this._values={...this._values,[e]:+Ke(n,{decimals:r})},this._scheduleSetpointValues(this._values)}_dispatchSetpointTap(){this.config?.tap_action?this._dispatchAction("tap"):this.openEntityPopover(this.config.entity)}_dispatchAction(t){const e="tap"===t?"tap_action":"hold"===t?"hold_action":"double_tap_action",i=this.config?.[e]??("tap"===t?{action:"more-info"}:{action:"none"});_t(this,"hass-action",{config:this.config,action:i})}getCardSize(){if(!this.config)return 1;const t=!0===this.config.embedded||this.header?1:0,e=this.showEntities&&this.entities?.length?Math.max(1,Math.ceil(this.entities.length/2)):0,i=!0===this.config.hide_setpoint||!0===this.config.hide_setpoint_when_off&&this.entity?.state===De.OFF||!0===this.config.hide?.setpoint_when_off&&this.entity?.state===De.OFF?0:1,a=this.modes?.filter(t=>(!0!==t.hide_when_off||this.entity?.state!==De.OFF)&&(t.list??[]).some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===De.OFF))).length??0,o=this.footer?.some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===De.OFF))?1:0,n=this.stepSize<1&&0===this.config.decimals?1:0;return Math.max(1,t+e+i+a+o+n)}getUnit(){if(["boolean","string"].includes(typeof this.config.unit))return this.config?.unit;const t=this.config.entity.split(".")[0];return"fan"===t||"humidifier"===t?"%":this._hass.config?.unit_system?.temperature??!1}}ia.HOLD_MS=500,ia.DOUBLE_TAP_MS=250,i([pt()],ia.prototype,"config",void 0),i([pt()],ia.prototype,"header",void 0),i([pt()],ia.prototype,"service",void 0),i([pt()],ia.prototype,"modes",void 0),i([pt()],ia.prototype,"entity",void 0),i([pt()],ia.prototype,"entities",void 0),i([pt()],ia.prototype,"footer",void 0),i([pt()],ia.prototype,"showEntities",void 0),i([pt()],ia.prototype,"name",void 0),i([pt({type:Object})],ia.prototype,"_values",void 0),i([pt()],ia.prototype,"_updatingValues",void 0),i([pt()],ia.prototype,"_hide",void 0),customElements.get(t)||customElements.define(t,ia),customElements.get(`${t}-editor`)||customElements.define(`${t}-editor`,ee),customElements.get(`${t}-group`)||customElements.define(`${t}-group`,Ve),customElements.get(`${t}-group-editor`)||customElements.define(`${t}-group-editor`,ye),console.info(`%c SIMPLE-THERMOSTAT %c v${e} `,"color: var(--text-primary-color); background: var(--primary-color); font-weight: 700; padding: 2px 6px; border-radius: 3px 0 0 3px;","color: var(--primary-color); background: var(--card-background-color); font-weight: 700; padding: 2px 6px; border-radius: 0 3px 3px 0;");const aa=window;aa.customCards=aa.customCards||[],aa.customCards.find(e=>e.type===t)||aa.customCards.push({type:t,name:"Simple Thermostat",preview:!0,description:"A different take on the thermostat card",documentationURL:"https://github.com/Wheemer/simple-thermostat",getEntitySuggestion:(e,i)=>"climate"!==i.split(".")[0]?null:{config:{type:`custom:${t}`,entity:i}}}),aa.customCards.find(e=>e.type===`${t}-group`)||aa.customCards.push({type:`${t}-group`,name:"Simple Thermostat Group",preview:!0,description:"Switch between multiple thermostat cards in one footprint",documentationURL:"https://github.com/Wheemer/simple-thermostat"});
|
||||
Binary file not shown.
Reference in new issue
Block a user