This commit is contained in:
Home Assistant Version Control committed 2026-08-23 20:53:46 +00:00
1 parent abb5e27bd3
commit aee9b5ad91
7 files changed
+1406 -191

No files matched your search

@@ -1 +1 @@
!function(){"use strict";function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r,i,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={};function s(){if(i)return r;i=1;var e=function(e){return e&&e.Math===Math&&e};return r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof o&&o)||e("object"==typeof r&&r)||function(){return this}()||Function("return this")()}var c,l,u,h,d,f,m,g,p={};function v(){return l?c:(l=1,c=function(e){try{return!!e()}catch(e){return!0}})}function y(){if(h)return u;h=1;var e=v();return u=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function A(){if(f)return d;f=1;var e=v();return d=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function _(){if(g)return m;g=1;var e=A(),t=Function.prototype.call;return m=e?t.bind(t):function(){return t.apply(t,arguments)},m}var b,w,E,x,S,C,I,T,R,k,O,P,M,L,B,D,U,F,N,j,W,z,H,G,q,Y,V,X,$,J,Q,Z,K,ee,te,ne,re,ie,oe,ae,se,ce={};function le(){if(b)return ce;b=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return ce.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ce}function ue(){return E?w:(E=1,w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function he(){if(S)return x;S=1;var e=A(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return x=e?r:function(e){return function(){return n.apply(e,arguments)}},x}function de(){if(I)return C;I=1;var e=he(),t=e({}.toString),n=e("".slice);return C=function(e){return n(t(e),8,-1)}}function fe(){if(R)return T;R=1;var e=he(),t=v(),n=de(),r=Object,i=e("".split);return T=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?i(e,""):r(e)}:r}function me(){return O?k:(O=1,k=function(e){return null==e})}function ge(){if(M)return P;M=1;var e=me(),t=TypeError;return P=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function pe(){if(B)return L;B=1;var e=fe(),t=ge();return L=function(n){return e(t(n))}}function ve(){if(U)return D;U=1;var e="object"==typeof document&&document.all;return D=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function ye(){if(N)return F;N=1;var e=ve();return F=function(t){return"object"==typeof t?null!==t:e(t)}}function Ae(){if(W)return j;W=1;var e=s(),t=ve();return j=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},j}function _e(){if(H)return z;H=1;var e=he();return z=e({}.isPrototypeOf)}function be(){if(q)return G;q=1;var e=s().navigator,t=e&&e.userAgent;return G=t?String(t):""}function we(){if(V)return Y;V=1;var e,t,n=s(),r=be(),i=n.process,o=n.Deno,a=i&&i.versions||o&&o.version,c=a&&a.v8;return c&&(t=(e=c.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Y=t}function Ee(){if($)return X;$=1;var e=we(),t=v(),n=s().String;return X=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function xe(){if(Q)return J;Q=1;var e=Ee();return J=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Se(){if(K)return Z;K=1;var e=Ae(),t=ve(),n=_e(),r=xe(),i=Object;return Z=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function Ce(){if(te)return ee;te=1;var e=String;return ee=function(t){try{return e(t)}catch(e){return"Object"}}}function Ie(){if(re)return ne;re=1;var e=ve(),t=Ce(),n=TypeError;return ne=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Te(){if(oe)return ie;oe=1;var e=Ie(),t=me();return ie=function(n,r){var i=n[r];return t(i)?void 0:e(i)}}function Re(){if(se)return ae;se=1;var e=_(),t=ve(),n=ye(),r=TyLine truncated
!function(){"use strict";function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r,i,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={};function s(){if(i)return r;i=1;var e=function(e){return e&&e.Math===Math&&e};return r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof o&&o)||e("object"==typeof r&&r)||function(){return this}()||Function("return this")()}var c,l,u,h,d,f,m,g,p={};function v(){return l?c:(l=1,c=function(e){try{return!!e()}catch(e){return!0}})}function y(){if(h)return u;h=1;var e=v();return u=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function A(){if(f)return d;f=1;var e=v();return d=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function _(){if(g)return m;g=1;var e=A(),t=Function.prototype.call;return m=e?t.bind(t):function(){return t.apply(t,arguments)},m}var b,w,E,x,S,C,I,T,R,k,O,P,M,L,B,D,U,F,N,j,W,z,H,G,q,Y,V,X,$,J,Q,Z,K,ee,te,ne,re,ie,oe,ae,se,ce={};function le(){if(b)return ce;b=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return ce.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ce}function ue(){return E?w:(E=1,w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function he(){if(S)return x;S=1;var e=A(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return x=e?r:function(e){return function(){return n.apply(e,arguments)}},x}function de(){if(I)return C;I=1;var e=he(),t=e({}.toString),n=e("".slice);return C=function(e){return n(t(e),8,-1)}}function fe(){if(R)return T;R=1;var e=he(),t=v(),n=de(),r=Object,i=e("".split);return T=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?i(e,""):r(e)}:r}function me(){return O?k:(O=1,k=function(e){return null==e})}function ge(){if(M)return P;M=1;var e=me(),t=TypeError;return P=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function pe(){if(B)return L;B=1;var e=fe(),t=ge();return L=function(n){return e(t(n))}}function ve(){if(U)return D;U=1;var e="object"==typeof document&&document.all;return D=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function ye(){if(N)return F;N=1;var e=ve();return F=function(t){return"object"==typeof t?null!==t:e(t)}}function Ae(){if(W)return j;W=1;var e=s(),t=ve();return j=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},j}function _e(){if(H)return z;H=1;var e=he();return z=e({}.isPrototypeOf)}function be(){if(q)return G;q=1;var e=s().navigator,t=e&&e.userAgent;return G=t?String(t):""}function we(){if(V)return Y;V=1;var e,t,n=s(),r=be(),i=n.process,o=n.Deno,a=i&&i.versions||o&&o.version,c=a&&a.v8;return c&&(t=(e=c.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Y=t}function Ee(){if($)return X;$=1;var e=we(),t=v(),n=s().String;return X=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function xe(){if(Q)return J;Q=1;var e=Ee();return J=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Se(){if(K)return Z;K=1;var e=Ae(),t=ve(),n=_e(),r=xe(),i=Object;return Z=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function Ce(){if(te)return ee;te=1;var e=String;return ee=function(t){try{return e(t)}catch(e){return"Object"}}}function Ie(){if(re)return ne;re=1;var e=ve(),t=Ce(),n=TypeError;return ne=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Te(){if(oe)return ie;oe=1;var e=Ie(),t=me();return ie=function(n,r){var i=n[r];return t(i)?void 0:e(i)}}function Re(){if(se)return ae;se=1;var e=_(),t=ve(),n=ye(),r=TyLine truncated
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,4 @@
!function(){const t={DEBUG:!1,BUILD_TIME:"2026-08-05, 05:24 p.m."};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.2.0";function i(t,e,i,o){var a,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(r<3?a(n):r>3?a(e,i,n):a(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}"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,r=Symbol(),n=new WeakMap;let s=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)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=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.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,r)},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,r))(e)})(t):t,{is:d,defineProperty:h,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:m}=Object,f=globalThis,v=f.trustedTypes,y=v?v.emptyScript:"",_=f.reactiveElementPolyfillSupport,b=(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 r=o?.call(this);a?.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=m(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...p(t),...g(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.litNonce;Line truncated
!function(){const t={DEBUG:!1,BUILD_TIME:"2026-08-23, 12:22 p.m."};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.3.0";function i(t,e,i,o){var a,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(r<3?a(n):r>3?a(e,i,n):a(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}"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,r=Symbol(),n=new WeakMap;let s=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)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=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.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,r)},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,r))(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 r=o?.call(this);a?.call(this,e),this.requestUpdate(t,r,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.litNonce;Line truncated
display: block;
isolation: isolate;
max-width: 100%;
@@ -44,14 +44,14 @@ ha-card {
padding-bottom: calc(var(--st-spacing, var(--st-default-spacing)) * 2);
--auto-color: green;
--heat_cool-color: springgreen;
--cool-color: #2b9af9;
--heat-color: #ff8100;
--auto-color: var(--state-climate-auto-color, green);
--heat_cool-color: var(--state-climate-heat-cool-color, #efbd07);
--cool-color: var(--state-climate-cool-color, #2b9af9);
--heat-color: var(--state-climate-heat-color, #ff8100);
--manual-color: #44739e;
--on-color: var(--primary-color);
--off-color: #8a8a8a;
--dry-color: #efbd07;
--off-color: var(--state-inactive-color, #8a8a8a);
--dry-color: var(--state-climate-dry-color, #efbd07);
--st-mode-surface-background: color-mix(
in srgb,
var(--primary-text-color) 14%,
@@ -340,6 +340,66 @@ ha-card.loading {
justify-self: start;
text-align: left;
}
.entity-action {
grid-column: 1 / -1;
width: 100%;
min-width: 0;
min-height: 28px;
border: 0;
border-radius: var(--st-mode-border-radius, var(--st-default-mode-radius));
padding: var(--st-spacing, var(--st-default-spacing))
calc(var(--st-spacing, var(--st-default-spacing)) * 2);
display: inline-flex;
align-items: center;
justify-content: center;
gap: calc(var(--st-spacing, var(--st-default-spacing)) * 1.5);
color: var(--secondary-text-color);
background: var(--st-mode-background, var(--st-mode-surface-background));
font: inherit;
line-height: 1.2;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
transition:
background-color
var(--st-mode-transition, var(--st-default-mode-transition)), color var(--st-mode-transition, var(--st-default-mode-transition)), box-shadow var(--st-mode-transition, var(--st-default-mode-transition)), filter var(--st-mode-transition, var(--st-default-mode-transition));
}
.entity-action ha-icon {
--mdc-icon-size: var(--st-entity-action-icon-size, 20px);
width: 20px;
width: var(--st-entity-action-icon-size, 20px);
height: 20px;
height: var(--st-entity-action-icon-size, 20px);
flex: 0 0 auto;
}
.entity-action__label,
.entity-action__state {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.entity-action__state {
color: var(--secondary-text-color);
font-size: 0.9em;
}
.entity-action.display-chip {
width: auto;
justify-self: start;
border-radius: 999px;
padding-left: calc(var(--st-spacing, var(--st-default-spacing)) * 2.5);
padding-right: calc(var(--st-spacing, var(--st-default-spacing)) * 2.5);
}
.entity-action.active,
.entity-action.state-on {
color: var(--st-mode-active-color, var(--text-primary-color));
background: var(
--st-mode-active-background,
var(--st-toggle-color, var(--primary-color))
);
}
.entity-action:hover {
filter: brightness(1.08);
}
.entities:empty {
display: none;
@@ -463,6 +523,7 @@ ha-card.embedded .body {
);
will-change: opacity, transform;
}
@supports (color: color-mix(in lch, red, blue)) {
.header__icon-wrap::before {
background: radial-gradient(
@@ -809,6 +870,9 @@ ha-card.cooling .header__icon-wrap::before {
.modes.preset {
flex-wrap: nowrap;
}
.modes.footer {
flex-wrap: nowrap;
}
.mode-title {
padding: 0 16px;
align-self: center;
@@ -853,6 +917,11 @@ ha-card.cooling .header__icon-wrap::before {
var(--st-mode-color, var(--primary-color)) 68%,
var(--primary-text-color) 32%
);
--st-mode-computed-active-background: var(
--st-mode-color,
var(--primary-color)
);
--st-mode-computed-active-accent-color: var(--st-mode-accent-color);
--st-mode-active-icon-color: color-mix(
in srgb,
var(--st-mode-color, var(--primary-color)) 42%,
@@ -863,7 +932,6 @@ ha-card.cooling .header__icon-wrap::before {
currentColor 50%,
var(--st-mode-color, var(--primary-color)) 50%
);
--st-mode-active-accent-color: var(--st-mode-accent-color);
--st-mode-neutral-hover-background: color-mix(
in srgb,
var(--st-mode-background, var(--secondary-background-color)) 88%,
@@ -921,13 +989,16 @@ ha-card.cooling .header__icon-wrap::before {
.mode-item.active,.mode-item.active:hover {
background: var(
--st-mode-active-background,
var(--st-mode-color, var(--primary-color))
var(--st-mode-computed-active-background)
);
color: var(--st-mode-active-color, var(--text-primary-color));
box-shadow: inset 0 -2px 0
var(
--st-mode-active-accent-color,
color-mix(in srgb, var(--text-primary-color) 72%, transparent)
var(
--st-mode-computed-active-accent-color,
color-mix(in srgb, var(--text-primary-color) 72%, transparent)
)
);
filter: none;
transform: none;
@@ -951,7 +1022,10 @@ ha-card.cooling .header__icon-wrap::before {
.mode-item.active::after {
background: var(
--st-mode-active-accent-color,
color-mix(in srgb, var(--text-primary-color) 72%, transparent)
var(
--st-mode-computed-active-accent-color,
color-mix(in srgb, var(--text-primary-color) 72%, transparent)
)
);
opacity: 0.64;
opacity: var(--st-mode-active-accent-opacity, 0.64);
@@ -970,6 +1044,10 @@ ha-card:not(.standard-visuals) .mode-item.active .mode-icon {
line-height: 1;
}
.mode-label-line {
display: block;
}
ha-card:not(.standard-visuals) .header__toggle.on .toggle-label.clickable,
ha-card:not(.standard-visuals) .entity-heading.toggle-entity.state-on ha-icon {
color: var(--st-toggle-color, var(--primary-color));
@@ -1118,7 +1196,7 @@ ha-card:not(.standard-visuals)
ha-card.standard-visuals .mode-item.active:hover {
background: var(
--st-mode-active-background,
var(--st-mode-color, var(--primary-color))
var(--st-mode-computed-active-background)
);
color: var(--st-mode-active-color, var(--text-primary-color));
}
@@ -1189,11 +1267,42 @@ ha-card.drying {
padding-bottom: var(--st-spacing, var(--st-default-spacing));
}
.modes.hvac.sparse .mode-label,
.modes.state.sparse .mode-label {
.modes.hvac.sparse .mode-item:not(.label-stacked):not(.label-column) .mode-label,
.modes.state.sparse .mode-item:not(.label-stacked):not(.label-column) .mode-label {
white-space: nowrap;
}
.modes.hvac.sparse .mode-item.label-stacked,
.modes.state.sparse .mode-item.label-stacked {
align-items: center;
}
.modes.hvac.sparse .mode-item.label-stacked .mode-label,
.modes.state.sparse .mode-item.label-stacked .mode-label {
white-space: normal;
line-height: 1.1;
text-align: left;
}
.modes.hvac.sparse .mode-item.label-stacked .mode-label-line + .mode-label-line,
.modes.state.sparse .mode-item.label-stacked .mode-label-line + .mode-label-line {
margin-top: 1px;
}
.modes.hvac.sparse .mode-item.label-column,
.modes.state.sparse .mode-item.label-column {
flex-direction: column;
gap: 4px;
min-height: calc(var(--st-control-icon-size) + 24px);
}
.modes.hvac.sparse .mode-item.label-column .mode-label,
.modes.state.sparse .mode-item.label-column .mode-label {
white-space: normal;
text-align: center;
line-height: 1.1;
}
@media (max-width: 560px) {
.modes.hvac .mode-item,
.modes.state .mode-item {
@@ -1210,6 +1319,12 @@ ha-card.drying {
gap: var(--st-sparse-control-gap, 2px);
min-width: 0;
}
ha-card:not(.standard-visuals) .modes.hvac.sparse .mode-item.label-column,
ha-card:not(.standard-visuals) .modes.state.sparse .mode-item.label-column {
flex-direction: column;
gap: 4px;
}
}
.modes.dense {
display: grid;
@@ -1312,7 +1427,8 @@ ha-card.drying {
.modes.swing_horizontal .mode-item,
.modes.swing_vertical .mode-item,
.modes.vane_horizontal .mode-item,
.modes.vane_vertical .mode-item {
.modes.vane_vertical .mode-item,
.modes.footer .mode-item {
--st-mode-min-width: 58px;
flex-direction: row;
align-items: center;
@@ -1496,7 +1612,8 @@ ha-card.standard-visuals .modes.swing,
ha-card.standard-visuals .modes.swing_horizontal,
ha-card.standard-visuals .modes.swing_vertical,
ha-card.standard-visuals .modes.vane_horizontal,
ha-card.standard-visuals .modes.vane_vertical {
ha-card.standard-visuals .modes.vane_vertical,
ha-card.standard-visuals .modes.footer {
display: grid;
grid-template-columns: none;
grid-auto-columns: minmax(0, 1fr);
@@ -1517,7 +1634,8 @@ ha-card.standard-visuals .modes.swing .mode-item,
ha-card.standard-visuals .modes.swing_horizontal .mode-item,
ha-card.standard-visuals .modes.swing_vertical .mode-item,
ha-card.standard-visuals .modes.vane_horizontal .mode-item,
ha-card.standard-visuals .modes.vane_vertical .mode-item {
ha-card.standard-visuals .modes.vane_vertical .mode-item,
ha-card.standard-visuals .modes.footer .mode-item {
display: flex;
flex: initial;
flex-direction: column;
@@ -1573,72 +1691,65 @@ ha-card.standard-visuals .mode-item.active {
ha-card .mode-item.active.off,
ha-card .mode-item.active.off:hover {
background: var(--off-color);
--st-mode-active-background: var(--off-color);
--st-mode-computed-active-background: var(--off-color);
}
ha-card .mode-item.active.heat,
ha-card .mode-item.active.heat:hover {
background: var(--heat-color);
--st-mode-active-background: var(--heat-color);
--st-mode-computed-active-background: var(--heat-color);
}
ha-card .mode-item.active.cool,
ha-card .mode-item.active.cool:hover {
background: var(--cool-color);
--st-mode-active-background: var(--cool-color);
--st-mode-computed-active-background: var(--cool-color);
}
ha-card .mode-item.active.heat_cool,
ha-card .mode-item.active.heat_cool:hover {
background: var(--heat_cool-color);
--st-mode-active-background: var(--heat_cool-color);
--st-mode-computed-active-background: var(--heat_cool-color);
}
ha-card .mode-item.active.auto,
ha-card .mode-item.active.auto:hover {
background: var(--auto-color);
--st-mode-active-background: var(--auto-color);
--st-mode-computed-active-background: var(--auto-color);
}
ha-card .mode-item.active.dry,
ha-card .mode-item.active.dry:hover {
background: var(--dry-color);
--st-mode-active-background: var(--dry-color);
--st-mode-computed-active-background: var(--dry-color);
}
ha-card .mode-item.active.fan_only,
ha-card .mode-item.active.fan_only:hover {
background: var(--fan_only-color);
--st-mode-active-background: var(--fan_only-color);
--st-mode-computed-active-background: var(--fan_only-color);
}
ha-card.standard-visuals .mode-item.active.off {
background: var(--off-color);
--st-mode-computed-active-background: var(--off-color);
}
ha-card.standard-visuals .mode-item.active.heat {
background: var(--heat-color);
--st-mode-computed-active-background: var(--heat-color);
}
ha-card.standard-visuals .mode-item.active.cool {
background: var(--cool-color);
--st-mode-computed-active-background: var(--cool-color);
}
ha-card.standard-visuals .mode-item.active.heat_cool {
background: var(--heat_cool-color);
--st-mode-computed-active-background: var(--heat_cool-color);
}
ha-card.standard-visuals .mode-item.active.auto {
background: var(--auto-color);
--st-mode-computed-active-background: var(--auto-color);
}
ha-card.standard-visuals .mode-item.active.dry {
background: var(--dry-color);
--st-mode-computed-active-background: var(--dry-color);
}
ha-card.standard-visuals .mode-item.active.fan_only {
background: var(--fan_only-color);
--st-mode-computed-active-background: var(--fan_only-color);
}
ha-card.standard-visuals .mode-item:active,
@@ -1721,7 +1832,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
font-size: 12px;
font-size: var(--ha-font-size-s, 12px);
}
`;function vt(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 yt(t){return Array.isArray(t)?t.map(t=>{const{label:e,...i}=t;return!i.name&&e&&(i.name=e),i}):t}function _t(t){const e={...t,layout:t.layout?{...t.layout}:void 0};return 3===e.version&&!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=yt(e)}(e),e.entities=yt(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))}}(ft),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"}(mt||(mt={}));const bt="dual";const wt={getSetpoints:t=>function(t){return"number"==typeof t.target_temp_high&&"number"==typeof t.target_temp_low?bt:"single"}(t)===bt?{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"},xt={climate:wt,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 $t(t){if(!t)return wt;const e=t.split(".")[0];return xt[e]??wt}const St=process.env.BUILD_TIME,At=["climate","fan","humidifier"],kt=[mt.HVAC,mt.FAN,mt.STATE,mt.PRESET,mt.SWING,mt.SWING_HORIZONTAL,mt.SWING_VERTICAL,mt.VANE_HORIZONTAL,mt.VANE_VERTICAL,mt.DIRECTION,mt.OSCILLATING,mt.MODE],Ct=Object.values(mt),Et={[mt.HVAC]:"HVAC modes",[mt.FAN]:"Fan modes",[mt.STATE]:"On/off state",[mt.PRESET]:"Preset modes",[mt.SWING]:"Swing modes",[mt.SWING_HORIZONTAL]:"Horizontal swing",[mt.SWING_VERTICAL]:"Vertical swing",[mt.VANE_HORIZONTAL]:"Horizontal Line truncated
`;function vt(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 yt(t){return Array.isArray(t)?t.map(t=>{const{label:e,...i}=t;return!i.name&&e&&(i.name=e),i}):t}function bt(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=yt(e)}(e),e.entities=yt(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))}}(ft),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"}(gt||(gt={}));const _t="dual";const wt={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"},xt={climate:wt,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 $t(t){if(!t)return wt;const e=t.split(".")[0];return xt[e]??wt}const St=process.env.BUILD_TIME,At=["climate","fan","humidifier"],kt=[gt.HVAC,gt.FAN,gt.STATE,gt.PRESET,gt.SWING,gt.SWING_HORIZONTAL,gt.SWING_VERTICAL,gt.VANE_HORIZONTAL,gt.VANE_VERTICAL,gt.DIRECTION,gt.OSCILLATING,gt.MODE],Ct=Object.values(gt),Et={[gt.HVAC]:"HVAC modes",[gt.FAN]:"Fan modes",[gt.STATE]:"On/off state",[gt.PRESET]:"Preset modes",[gt.SWING]:"Swing modes",[gt.SWING_HORIZONTAL]:"Horizontal swing",[gt.SWING Line truncated
<section class="editor-extra-entities">
<div class="editor-extra-entities__header">
<div>
@@ -1751,23 +1862,75 @@ ha-card.standard-visuals .thermostat-trigger:active {
.value=${t.icon??""}
@value-changed=${t=>this._updateEntityRow(e,"icon",t.detail.value)}
></ha-icon-picker>
<ha-select
label="Display"
clearable
.value=${t.display??""}
@value-changed=${t=>this._updateEntityRow(e,"display",Bt(t))}
@selected=${t=>this._updateEntityRow(e,"display",Bt(t))}
@change=${t=>this._updateEntityRow(e,"display",Bt(t))}
>
<mwc-list-item value="">Default</mwc-list-item>
${Ft.map(t=>B`
<mwc-list-item value=${t.value}>
${t.label}
</mwc-list-item>
`)}
</ha-select>
<ha-button @click=${()=>this._removeEntityRow(e)}>
Remove
</ha-button>
</div>
`)}
</section>
`}_renderFooterRows(){const t=this._getFooterRows();return B`
<section class="editor-extra-entities">
<div class="editor-extra-entities__header">
<div>
<h3>Footer controls</h3>
<p>Add switch-style controls shown below the mode rows.</p>
</div>
<ha-button @click=${this._addFooterRow}>Add control</ha-button>
</div>
${0===t.length?B`<p class="editor-extra-entities__empty">
No footer controls configured.
</p>`:t.map((t,e)=>B`
<div class="editor-entity-row">
<ha-entity-picker
.hass=${this.hass}
.value=${t.entity??""}
allow-custom-entity
@value-changed=${t=>this._updateFooterRow(e,"entity",t.detail.value)}
></ha-entity-picker>
<ha-textfield
label="Name override"
.value=${t.name??""}
@input=${t=>this._updateFooterRow(e,"name",t.target.value)}
></ha-textfield>
<ha-icon-picker
.hass=${this.hass}
.value=${t.icon??""}
@value-changed=${t=>this._updateFooterRow(e,"icon",t.detail.value)}
></ha-icon-picker>
<ha-button @click=${()=>this._removeFooterRow(e)}>
Remove
</ha-button>
</div>
`)}
</section>
`}render(){return this.hass&&this.config?B`
<div class="card-config">
<ha-form
.hass=${this.hass}
.data=${this._buildFormData()}
.schema=${function(t,e){const i=Ut(t,e),o=t.entity?.split(".")[0],a=$t(t.entity),r=t.entity?e?.states?.[t.entity]:void 0,n=!0===t.hide_setpoint||!r||Object.keys(a.getSetpoints(r.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:{}}},...n?[{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:At}}},{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:{}}}))}]}]:[],...n?[{type:"expandable",title:"Target",schema:[{type:"grid",schema:[{name:"layout.step",selector:{select:{mode:"dropdown",options:Rt}}},{name:"step_size",selector:{select:{mode:"dropdown",options:jt}}}]},{type:"grid",column_min_width:"160px",schema:[{name:"hide_setpoint",selector:{boolean:{}}},{name:"hide_setpoint_when_off",selector:{boolean:{}}},{name:"hide.setpoint_label",selector:{boolean:{}}},{name:"disable_setpoint_change_when_off",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:Pt}}},{name:"layout.entities.labels",selector:{boolean:{}}},{name:"layout.entities.separator",selector:{boolean:{}}},{name:"layout.entities.alignment",selector:{select:{mode:"dropdown",options:Ht}}}]}]},{type:"expandable",title:"Appearance",schema:[{name:"enhanced_visuals",selector:{boolean:{}}},{type:"grid",column_min_width:"160px",schema:l}].filter(Nt)},{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:Mt}}},{name:"hold_action.action",selector:{select:{mode:"dropdown",options:Mt}}},{name:"double_tap_action.action",selector:{select:{mode:"dropdown",options:Mt}}}]}].filter(Nt)}]}(this.config,this.hass)}
.schema=${function(t,e){const i=qt(t,e),o=t.entity?.split(".")[0],a=$t(t.entity),r=t.entity?e?.states?.[t.entity]:void 0,n=!0===t.hide_setpoint||!r||Object.keys(a.getSetpoints(r.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:{}}},...n?[{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:At}}},{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:{}}}))}]}]:[],...n?[{type:"expandable",title:"Target",schema:[{type:"grid",schema:[{name:"layout.step",selector:{select:{mode:"dropdown",options:Mt}}},{name:"step_size",selector:{select:{mode:"dropdown",options:jt}}}]},{type:"grid",column_min_width:"160px",schema:[{name:"hide_setpoint",selector:{boolean:{}}},{name:"hide_setpoint_when_off",selector:{boolean:{}}},{name:"hide.setpoint_label",selector:{boolean:{}}},{name:"disable_setpoint_change_when_off",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:Pt}}},{name:"layout.entities.display",selector:{select:{mode:"dropdown",options:Ht}}},{name:"layout.entities.labels",selector:{boolean:{}}},{name:"layout.entities.separator",selector:{boolean:{}}},{name:"layout.entities.alignment",selector:{select:{mode:"dropdown",options:Vt}}}]}]},{type:"expandable",title:"Appearance",schema:[{name:"enhanced_visuals",selector:{boolean:{}}},{type:"grid",column_min_width:"160px",schema:l}].filter(Rt)},{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:Nt}}},{name:"hold_action.action",selector:{select:{mode:"dropdown",options:Nt}}},{name:"double_tap_action.action",selector:{select:{mode:"dropdown",options:Nt}}}]}].filter(Rt)}]}(this.config,this.hass)}
.computeLabel=${this._computeLabel}
@value-changed=${this._valueChanged}
></ha-form>
${this._renderExtraEntityRows()}
${this._renderFooterRows()}
<div class="editor-footer">
<ha-button @click=${this._openLink}>
@@ -1782,7 +1945,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
>
</div>
</div>
`:B``}}i([gt()],Kt.prototype,"config",void 0),i([pt({attribute:!1})],Kt.prototype,"hass",void 0);const Zt=2,Jt=t=>(...e)=>({_$litDirective$:t,values:e});class Yt{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 Xt=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),Xt(t,e);return!0},Qt=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},te=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),oe(e)}};function ee(t){void 0!==this._$AN?(Qt(this),this._$AM=t,te(this)):this._$AM=t}function ie(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++)Xt(o[t],!1),Qt(o[t]);else null!=o&&(Xt(o,!1),Qt(o));else Xt(this,t)}const oe=t=>{t.type==Zt&&(t._$AP??=ie,t._$AQ??=ee)};class ae extends Yt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),te(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Xt(this,t),Qt(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 re=new WeakMap,ne=Jt(class extends ae{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=re.get(e);void 0===i&&(i=new WeakMap,re.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?re.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),se=["climate","fan","humidifier"],ce={icons:!0,names:!0,states:!1};function le(t){if("string"==typeof t)return{entity:t};const e=t?.header&&"object"==typeof t.header?t.header:{};return{...t,entity:t?.entity??"",name:t?.name??e.name,icon:t?.icon??e.icon}}class de extends lt{constructor(){super(...arguments),this.config={entities:[]},this.expandedTargetIndex=null,this.editorConfigKeys=new WeakMap}static get styles(){return c`
`:B``}}i([mt()],Xt.prototype,"config",void 0),i([pt({attribute:!1})],Xt.prototype,"hass",void 0);const Qt=2,te=t=>(...e)=>({_$litDirective$:t,values:e});class ee{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 ie=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),ie(t,e);return!0},oe=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},ae=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),se(e)}};function re(t){void 0!==this._$AN?(oe(this),this._$AM=t,ae(this)):this._$AM=t}function ne(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++)ie(o[t],!1),oe(o[t]);else null!=o&&(ie(o,!1),oe(o));else ie(this,t)}const se=t=>{t.type==Qt&&(t._$AP??=ne,t._$AQ??=re)};class ce extends ee{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ae(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ie(this,t),oe(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 le=new WeakMap,de=te(class extends ce{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=le.get(e);void 0===i&&(i=new WeakMap,le.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?le.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),he=["climate","fan","humidifier"],ue={style:"header",icons:!0,names:!0,states:!1};function pe(t){if("string"==typeof t)return{entity:t};const e=t?.header&&"object"==typeof t.header?t.header:{};return{...t,entity:t?.entity??"",name:t?.name??e.name,icon:t?.icon??e.icon}}class me extends lt{constructor(){super(...arguments),this.config={entities:[]},this.expandedTargetIndex=null,this.editorConfigKeys=new WeakMap}static get styles(){return c`
:host {
display: block;
}
@@ -1862,6 +2025,25 @@ ha-card.standard-visuals .thermostat-trigger:active {
gap: 8px;
}
.selector-style-row {
display: grid;
gap: 6px;
}
.selector-style-actions {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.selector-style-actions ha-button {
width: 100%;
}
.selector-style-actions ha-button.selected {
--mdc-theme-primary: var(--primary-color);
}
.option-row {
display: flex;
align-items: center;
@@ -1905,11 +2087,19 @@ 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,vt(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(le);return e.length?e:[{entity:""},{entity:""}]}(this.config)}updateTarget(t,e){const i=this.getTargets();i[t]={...i[t],...e},this.commitTargets(i)}cleanTargets(t){return t.map(t=>{const e=t.entity?.trim()??"",i=t.name?.trim(),o=t.icon?.trim(),{name:a,icon:r,entity:n,...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.commitTargets(e.length?e:[{entity:""}])}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===ce[t]?delete i[t]:i[t]=o,this.commit({...this.config,selector:i})}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,r=a.header&&"object"==typeof a.header?{...a.header}:{};return i&&!1!==a.header&&void 0===r.name&&(r.name=i),o&&!1!==a.header&&void 0===r.icon&&(r.icon=o),{type:a.type??`custom:${t}`,...a,...!1===a.header?{header:!1}:{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();i[t]=le(e.detail.config),this.commitTargets(i)}toggleTargetEditor(t){this.expandedTargetIndex=this.expandedTargetIndex===t?null:t}renderEntityPicker(t,e){return B`
`}setConfig(t){this.config={...t}}commit(t){const e=this.cleanConfig(t);this.config=e,vt(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(pe);return e.length?e:[{entity:""},{entity:""}]}(this.config)}updateTarget(t,e){const i=this.getTargets();i[t]={...i[t],...e},this.commitTargets(i)}cleanTargets(t){return t.map(t=>{const e=t.entity?.trim()??"",i=t.name?.trim(),o=t.icon?.trim(),{name:a,icon:r,entity:n,...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.commitTargets(e.length?e:[{entity:""}])}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===ue[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===ue.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"}
@click=${()=>this.updateSelectorStyle(e)}
>
${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,r=a.header&&"object"==typeof a.header?{...a.header}:{};return i&&!1!==a.header&&void 0===r.name&&(r.name=i),o&&!1!==a.header&&void 0===r.icon&&(r.icon=o),{type:a.type??`custom:${t}`,...a,...!1===a.header?{header:!1}:{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();i[t]=pe(e.detail.config),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}
.includeDomains=${se}
.includeDomains=${he}
allow-custom-entity
label="Entity"
@value-changed=${t=>this.updateTarget(e,{entity:t.detail.value})}
@@ -1948,7 +2138,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
<div class="target-editor">
<simple-thermostat-editor
.hass=${this.hass}
${ne(e=>this.configureNestedEditor(e,t))}
${de(e=>this.configureNestedEditor(e,t))}
@config-changed=${t=>this.updateTargetCardConfig(e,t)}
></simple-thermostat-editor>
</div>
@@ -1972,6 +2162,19 @@ ha-card.standard-visuals .thermostat-trigger:active {
<p>Control how the group chooses and labels the active card.</p>
</div>
<div class="selector-options">
<div class="selector-style-row">
<div class="option-text">
<span class="option-title">Selector style</span>
<span class="option-description"
>Choose the normal arrow/menu header or visible tab
buttons.</span
>
</div>
<div class="selector-style-actions">
${this.renderSelectorStyleOption("Header navigation","header","header"===(t.style??ue.style))}
${this.renderSelectorStyleOption("Tabbed buttons","tabs","tabs"===t.style)}
</div>
</div>
${this.renderOption("Follow active device","Switch to a card when its mode or on/off activity changes.",this.isAutoSelectEnabled(),t=>this.updateAutoSelect(t))}
${this.renderOption("Remember selection","Keep the last selected card after the dashboard reloads.",!1!==this.config.remember_selection,t=>this.updateRememberSelection(t))}
${this.renderOption("Show icons","Show each card icon in the selector and menu.",!1!==t.icons,t=>this.updateSelector("icons",t))}
@@ -1995,7 +2198,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
@change=${t=>o(t.currentTarget.checked)}
></ha-switch>
</div>
`}}function he(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 ue(t){const e=he(t),i=e?t.attributes?.[e]:void 0;return"string"==typeof i&&i?i:void 0}function pe(t,e,i){if("string"!=typeof t.entity_id)return void 0===t.state?"":String(t.state);const[o]=t.entity_id.split("."),a=ue(t),r=he(t);if(a)return"function"==typeof e.formatEntityAttributeValue&&r?e.formatEntityAttributeValue(t,r):i(a,function(t){if("string"!=typeof t.entity_id)return"";const[e]=t.entity_id.split("."),i=he(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`${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})],de.prototype,"hass",void 0),i([gt()],de.prototype,"config",void 0),i([gt()],de.prototype,"expandedTargetIndex",void 0);const ge={auto:"mdi:radiator",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:radiator-disabled",on:"mdi:power",off:"mdi:radiator-off"},me={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"},fe={...ge,auto:"mdi:radiator",idle:ge.idle,off:"mdi:radiator"},ve={fan:{on:"mdi:fan",off:"mdi:fan-off"},humidifier:{on:"mdi:air-humidifier",off:"mdi:air-humidifier-off"}},ye={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",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 _e(t){const e=String(t),i=e.toLowerCase().replace(/\s+/g,"_");return ye[e]??ye[i]}function be(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 we(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 r=o?function(t){const[e]=t.entity_id.split("."),i=ue(t),o=i?Se(t):void 0;return o??t.attributes.icon??Se(t)??ve[e]?.[t.state]??(i?ge:ye)}(e):function(t){return ue(t)?ge:ye}(e);return void 0!==t?.icon&&(r=t.icon),{name:a,icon:r,slashOffIcon:o&&Ae(e,r),toggle:t?.toggle?xe(t.toggle,i):null,toggles:$e(t,i),faults:ke(t?.faults,i)}}function xe(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 $e(t,e){return[...t?.toggle?[t.toggle]:[],...Array.isArray(t?.toggles)?t.toggles:[]].map(t=>xe(t,e)).filter(t=>!!t)}function Se(t){const[e]=t.entity_id.split(".");if("climate"!==e)return;const i=Array.isArray(t.attributes?.hvac_modes)?t.attributes.hvac_modes:[],o=ue(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)?me:fe}function Ae(t,e){if("off"!==t.state)return!1;const i="object"==typeof e?e[ue(t)||t.state]??!1:e;if("string"!=typeof i)return!1;const[o]=t.entity_id.split("."),a="climate"===o?ge.off:ve[o]?.off;return Boolean(a)&&i!==a&&!i.endsWith("-off")}function ke(t,e){return Array.isArray(t)?t.filter(({entity:t})=>Boolean(e.states?.[t])).map(({entity:t,...i})=>({...i,state:e.states[t],entity:t})):[]}const Ce= Line truncated
`}}function ge(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 fe(t){const e=ge(t),i=e?t.attributes?.[e]:void 0;return"string"==typeof i&&i?i:void 0}function ve(t,e,i){if("string"!=typeof t.entity_id)return void 0===t.state?"":String(t.state);const[o]=t.entity_id.split("."),a=fe(t),r=ge(t);if(a)return"function"==typeof e.formatEntityAttributeValue&&r?e.formatEntityAttributeValue(t,r):i(a,function(t){if("string"!=typeof t.entity_id)return"";const[e]=t.entity_id.split("."),i=ge(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`${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})],me.prototype,"hass",void 0),i([mt()],me.prototype,"config",void 0),i([mt()],me.prototype,"expandedTargetIndex",void 0);const ye={auto:"mdi:radiator",cooling:"mdi:snowflake",fan:"mdi:fan",heating:"mdi:radiator",idle:"mdi:radiator-disabled",on:"mdi:power",off:"mdi:radiator-off"},be={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"},_e={...ye,auto:"mdi:radiator",idle:ye.idle,off:"mdi:radiator"},we={fan:{on:"mdi:fan",off:"mdi:fan-off"},humidifier:{on:"mdi:air-humidifier",off:"mdi:air-humidifier-off"}},xe={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",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 $e(t){const e=String(t),i=e.toLowerCase().replace(/\s+/g,"_");return xe[e]??xe[i]}function Se(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 Ae(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 r=o?function(t){const[e]=t.entity_id.split("."),i=fe(t),o=i?Ee(t):void 0;return o??t.attributes.icon??Ee(t)??we[e]?.[t.state]??(i?ye:xe)}(e):function(t){return fe(t)?ye:xe}(e);return void 0!==t?.icon&&(r=t.icon),{name:a,icon:r,slashOffIcon:o&&ze(e,r),toggle:t?.toggle?ke(t.toggle,i):null,toggles:Ce(t,i),faults:Te(t?.faults,i)}}function ke(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 Ce(t,e){return[...t?.toggle?[t.toggle]:[],...Array.isArray(t?.toggles)?t.toggles:[]].map(t=>ke(t,e)).filter(t=>!!t)}function Ee(t){const[e]=t.entity_id.split(".");if("climate"!==e)return;const i=Array.isArray(t.attributes?.hvac_modes)?t.attributes.hvac_modes:[],o=fe(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)?be:_e}function ze(t,e){if("off"!==t.state)return!1;const i="object"==typeof e?e[fe(t)||t.state]??!1:e;if("string"!=typeof i)return!1;const[o]=t.entity_id.split("."),a="climate"===o?ye.off:we[o]?.off;return Boolean(a)&&i!==a&&!i.endsWith("-off")}function Te(t,e){return Array.isArray(t)?t.filter(({entity:t})=>Boolean(e.states?.[t])).map(({entity:t,...i})=>({...i,state:e.states[t],entity:t})):[]}const Oe= Line truncated
:host {
display: block;
}
@@ -2033,6 +2236,171 @@ ha-card.standard-visuals .thermostat-trigger:active {
transform: translateY(var(--st-group-header-top-buffer, 2px));
}
.group-selector.tabs {
display: block;
padding: calc(var(--st-spacing, var(--st-default-spacing, 4px)) * 3)
calc(var(--st-spacing, var(--st-default-spacing, 4px)) * 3) 0;
height: auto;
transform: translateY(var(--st-group-header-top-buffer, 2px));
}
.group-tabs {
display: grid;
grid-template-columns: repeat(
auto-fit,
minmax(var(--st-group-tab-min-width, 120px), 1fr)
);
gap: calc(var(--st-spacing, var(--st-default-spacing, 4px)) * 2);
min-width: 0;
}
.group-tab {
appearance: none;
border: 0;
border-radius: var(--st-group-tab-radius, 10px);
min-width: 0;
min-height: var(--st-group-tab-height, 46px);
padding: 7px 12px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--st-group-tab-color, var(--primary-text-color));
background: var(
--st-group-tab-background,
color-mix(in srgb, var(--primary-text-color) 12%, transparent)
);
font: inherit;
font-weight: 600;
line-height: 1.15;
cursor: pointer;
transition:
background 160ms var(--st-motion-ease, ease),
color 160ms var(--st-motion-ease, ease),
opacity 160ms var(--st-motion-ease, ease);
}
.group-tab:hover,
.group-tab:focus-visible {
background: var(
--st-group-tab-hover-background,
color-mix(in srgb, currentColor 22%, transparent)
);
}
.group-tab:focus-visible {
outline: 2px solid var(--primary-color);
outline-offset: 2px;
}
.group-tab.selected {
color: var(--st-group-tab-selected-color, #fff);
background: var(
--st-group-tab-selected-background,
var(--primary-color)
);
}
.group-tab ha-icon {
--mdc-icon-size: 21px;
--iron-icon-width: 21px;
--iron-icon-height: 21px;
flex: 0 0 auto;
}
.group-tab-labels {
display: grid;
min-width: 0;
gap: 1px;
text-align: center;
}
.group-tab-name,
.group-tab-state {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.group-tab-state {
color: currentColor;
opacity: 0.78;
font-size: var(--ha-font-size-xs, 11px);
font-weight: 500;
}
.group-tab.state-off {
--st-group-tab-background: color-mix(
in srgb,
var(--state-icon-color, var(--secondary-text-color)) 20%,
transparent
);
--st-group-tab-color: var(--secondary-text-color);
}
.group-tab.cooling,
.group-tab.state-cool {
--st-group-tab-background: color-mix(
in srgb,
var(--state-climate-cool-color, var(--cool-color, #2b9af9)) 22%,
transparent
);
--st-group-tab-color: var(
--state-climate-cool-color,
var(--cool-color, #2b9af9)
);
--st-group-tab-selected-background: var(
--state-climate-cool-color,
var(--cool-color, #2b9af9)
);
}
.group-tab.heating,
.group-tab.state-heat {
--st-group-tab-background: color-mix(
in srgb,
var(--state-climate-heat-color, var(--heat-color, #ff8100)) 22%,
transparent
);
--st-group-tab-color: var(
--state-climate-heat-color,
var(--heat-color, #ff8100)
);
--st-group-tab-selected-background: var(
--state-climate-heat-color,
var(--heat-color, #ff8100)
);
}
.group-tab.drying,
.group-tab.state-dry {
--st-group-tab-background: color-mix(
in srgb,
var(--state-climate-dry-color, var(--dry-color, #efbd07)) 24%,
transparent
);
--st-group-tab-color: var(
--state-climate-dry-color,
var(--dry-color, #efbd07)
);
--st-group-tab-selected-background: var(
--state-climate-dry-color,
var(--dry-color, #efbd07)
);
}
.group-tab.domain-fan:not(.state-off),
.group-tab.humidifying {
--st-group-tab-background: color-mix(
in srgb,
var(--primary-color) 22%,
transparent
);
--st-group-tab-color: var(--primary-color);
--st-group-tab-selected-background: var(--primary-color);
}
.group-title {
flex: 1 1 auto;
min-width: 0;
@@ -2469,7 +2837,7 @@ 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=>Ee.includes(ze(t))).slice(0,2),card:{}}}setConfig(t){this.clearAutoSelectResumeTimer();const e=(t.cards??t.entities??[]).map(Oe).filter(Boolean);if(!e.length)throw new Error("Simple Thermostat Group requires at least one card");this.config={...t,selector:{...Ce,...t.selector??{}}},this.targets=e,this.selectedEntity=this.getInitialSelection(t,e),this.activitySignatures.clear(),this.activitySignaturesInitialized=!1,this.persistedActivityApplied=!1}updated(){this.syncAutoSelectRecentActivity(),this.syncEmbeddedCard(),this.syncOutsideClickListener(),this.syncTitleFit()}getCardSize(){if(!this.config||!this.targets.length)return 1;const t=this.getSelectedTarget(),e=this.getTargetCardConfig(t),i=Array.isArray(e.entities)?e.entities.length:0,o=i?Math.max(1,Math.ceil(i/2)):0,a=this.getConfiguredModeRowCount(e),r=!0===e.hide_setpoint?0:1;return Math.max(2,1+o+r+a)}disconnectedCallback(){this.clearOutsideClickListener(),this.clearAutoSelectResumeTimer(),super.disconnectedCallback()}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)}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&&vt(this,"hass-more-info",{entityId:t.entity})}onSelectorHeaderKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.openSelectedPopover())}getGroupCardClasses(){const t=this.getSelectedState();if(!t)return"group-card group-shell";const e=ze(t.entity_id),i=ue(t),o=["unavailable","unknown"].includes(String(t.state));return["group-card","group-shell",`domain-${Te(e)}`,`state-${Te(t.state)}`,Te(i),o&&Te(t.state)].filter(Boolean).join(" ")}getGroupCardStyle(){const t=this.getSelectedState();return t?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;`}(ze(t.entity_id),t.attributes):""}getSelectedIndex(){const t=this.targets.findIndex(t=>t.entity===this.selectedEntity);return-1===t?0:t}isRecentActivityAutoSelectEnabled(){const t=this.config?.auto_select;return!!t&&(!0===t||"recent_activity"===t||"object"==typeof t&&"recent_activity"===t.mode)}getAutoSelectManualPauseMs(){const t=this.config?.auto_select;if(t&&"object"==typeof t){const e=Number(t.manual_pause_ms??t.cooldown_ms);if(Number.isFinite(e)&&e>=0)return e}return 3e4}pauseAutoSelectAfterManualSelection(){this.lastManualSelectionAt=Date.now(),this.clearAutoSelectResumeTimer(),this.isRecentActivityAutoSelectEnabled()&&(this.autoSelectResumeTimer=window.setTimeout(()=>{this.autoSelectResumeTimer=void 0,this.lastManualSelectionAt=0,this.isRecentActivityAutoSelectEnabled()&&!this.menuOpen&&this.selectMostRecentStateActivity()},this.getAutoSelectManualPauseMs()))}getActivitySignature(t){const e=this.hass?.states?.[t.entity];if(!e)return"";const i=ze(t.entity),o=e.attributes??{},a=ue(e)??"",r="climate"===i?["hvac_action","temperature","t Line truncated
`}static getConfigElement(){return window.document.createElement(`${t}-group-editor`)}static getStubConfig(t){return{entities:Object.keys(t?.states??{}).filter(t=>Re.includes(Ne(t))).slice(0,2),card:{}}}setConfig(t){this.clearAutoSelectResumeTimer();const e=(t.cards??t.entities??[]).map(je).filter(Boolean);if(!e.length)throw new Error("Simple Thermostat Group requires at least one card");this.config={...t,selector:{...Oe,...t.selector??{}}},this.targets=e,this.selectedEntity=this.getInitialSelection(t,e),this.activitySignatures.clear(),this.activitySignaturesInitialized=!1,this.persistedActivityApplied=!1}updated(){this.syncAutoSelectRecentActivity(),this.syncEmbeddedCard(),this.syncOutsideClickListener(),this.syncTitleFit()}getCardSize(){if(!this.config||!this.targets.length)return 1;const t=this.getSelectedTarget(),e=this.getTargetCardConfig(t),i=Array.isArray(e.entities)?e.entities.length:0,o=i?Math.max(1,Math.ceil(i/2)):0,a=this.getConfiguredModeRowCount(e),r=!0===e.hide_setpoint?0:1;return Math.max(2,1+o+r+a)}disconnectedCallback(){this.clearOutsideClickListener(),this.clearAutoSelectResumeTimer(),super.disconnectedCallback()}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)}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&&vt(this,"hass-more-info",{entityId:t.entity})}onSelectorHeaderKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.openSelectedPopover())}getGroupCardClasses(){const t=this.getSelectedState();if(!t)return"group-card group-shell";const e=Ne(t.entity_id),i=fe(t),o=["unavailable","unknown"].includes(String(t.state));return["group-card","group-shell",`domain-${Me(e)}`,`state-${Me(t.state)}`,Me(i),o&&Me(t.state)].filter(Boolean).join(" ")}getTargetClasses(t){const e=this.hass?.states?.[t.entity];if(!e)return"";const i=Ne(e.entity_id),o=fe(e);return[`domain-${Me(i)}`,`state-${Me(e.state)}`,Me(o)].filter(Boolean).join(" ")}getGroupCardStyle(){const t=this.getSelectedState();return t?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;`}(Ne(t.entity_id),t.attributes):""}getSelectedIndex(){const t=this.targets.findIndex(t=>t.entity===this.selectedEntity);return-1===t?0:t}isRecentActivityAutoSelectEnabled(){const t=this.config?.auto_select;return!!t&&(!0===t||"recent_activity"===t||"object"==typeof t&&"recent_activity"===t.mode)}getAutoSelectManualPauseMs(){const t=this.config?.auto_select;if(t&&"object"==typeof t){const e=Number(t.manual_pause_ms??t.cooldown_ms);if(Number.isFinite(e)&&e>=0)return e}return 3e4}pauseAutoSelectAfterManualSelection(){this.lastManualSelectionAt=Date.now(),this.clearAutoSelectResumeTimer(),this.isRecentActivityAutoSelectEnabled()&&(this.autoSelectResumeTimer=window.setTimeout(()=>{this.autoSelectResumeTimer=void 0,this.lastManualSelectionAt=0,this.isRecentActivityAutoSelectEnabled()&&!this.menuOpen&&this.selectMostRecentStateActivity()},this.getAutoSelectManualPa 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`
<div class="group-toggle">
@@ -2502,7 +2870,7 @@ 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=ue(e)||String(e.state),a="object"==typeof i.icon?i.icon?.[o]??!1:i.icon;if(!a)return q;const r=o&&o!==e.state?` ${Te(o)}`:"",n=Te(e.state);return B`
`:q}renderHeaderIcon(t){const e=this.hass?.states?.[t.entity],i=this.getTargetHeaderData(t);if(!e||!i||!i.icon)return q;const o=fe(e)||String(e.state),a="object"==typeof i.icon?i.icon?.[o]??!1:i.icon;if(!a)return q;const r=o&&o!==e.state?` ${Me(o)}`:"",n=Me(e.state);return B`
<span
class="header__icon-wrap ${n}${r} ${i.slashOffIcon?"slash-off":""}"
>
@@ -2511,7 +2879,32 @@ ha-card.standard-visuals .thermostat-trigger:active {
.icon=${a}
></ha-icon>
</span>
`}renderSelector(){const t=this.getSelectedTarget(),e=this.getTargetLabel(t);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??Oe;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,r=t.states?this.getTargetStateLabel(e):"";return B`
<button
class=${["group-tab",this.getTargetClasses(e),a&&"selected"].filter(Boolean).join(" ")}
type="button"
role="tab"
aria-selected=${a?"true":"false"}
title=${i}
@click=${()=>this.selectEntity(e.entity)}
>
${o?B`<ha-icon icon=${o}></ha-icon>`:q}
${!1!==t.names?B`
<span class="group-tab-labels">
<span class="group-tab-name">${i}</span>
${r?B`<span class="group-tab-state"
>${r}</span
>`:q}
</span>
`:q}
</button>
`})}
</div>
</div>
`}renderSelector(){if("tabs"===this.config?.selector?.style)return this.renderTabSelector();const t=this.getSelectedTarget(),e=this.getTargetLabel(t);return B`
<div class="group-selector">
<div class="group-header-content">
<div
@@ -2569,7 +2962,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
class=${"embedded-card-host"+(this.cardFading?" fading":"")}
></div>
</div>
`:B`<ha-card></ha-card>`}}var Me;i([pt({attribute:!1})],Ne.prototype,"hass",void 0),i([gt()],Ne.prototype,"config",void 0),i([gt()],Ne.prototype,"targets",void 0),i([gt()],Ne.prototype,"selectedEntity",void 0),i([gt()],Ne.prototype,"menuOpen",void 0),i([gt()],Ne.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"}(Me||(Me={}));const Re=["auto","silent","quiet","low","mid","medium","high","max","turbo","full"];const je=["mdi:fan-speed-1","mdi:fan-speed-2","mdi:fan-speed-3","st:fan-speed-4","st:fan-speed-5"],Pe=t=>String(t).toLowerCase().replace(/\s+/g,"_"),He={low:1,medlow:2,medium_low:2,mid:2,medium:2,medium_high:3,medhigh:3,max:5,turbo:5,full:5};function Ie(t,e){const i=Pe(t),o=function(t){if(!/^\d+$/.test(t))return;const e=Number(t);return e>=1&&e<=je.length?e:void 0}(i);if(o)return je[o-1];const a=function(t,e){if("high"===t){const t=new Set(e.map(Pe));return t.has("medium_high")||t.has("medhigh")||t.has("max")||t.has("turbo")||t.has("full")?4:3}return He[t]}(i,e);return a?je[a-1]:void 0}function Ve(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);return Number.isNaN(a)?i:o?"decimal_comma"===o.number_format||"space_comma"===o.number_format?a.toFixed(e).replace(".",","):"comma_decimal"===o.number_format||"none"===o.number_format?a.toFixed(e):new Intl.NumberFormat("system"===o.number_format?void 0:o.language,{minimumFractionDigits:e,maximumFractionDigits:e}).format(a):a.toFixed(e)}const Fe=[["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/]],Le={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 De(t,e){const i=t.toLowerCase().replace(/[.:]/g," "),o=function(t){return"function"!=typeof t?.localize?[]:Object.entries(Le).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=Fe.find(([,t])=>t.test(i));return a?.[0]??""}function Ue(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=De(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 We({icon:t,label:e,entity:i,hass:o}){const a=Ue(t);if(a)return a;const r=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(r)return r;return De([e,i?.entity_id,i?.attributes?.friendly_name].filter(Boolean).join(" "),o)}function Be(t){return t?`toggle-${t}`:""}function Ge({header:t,toggleEntityChanged:e,entity:i,hass:o,openEntityPopover:a}){if(!1===t)return q;const r=ue(i)||i.state;let n=t.icon;"object"==typeof t.icon&&(n=n?.[r]??!1);const s=Boolean(t.slashOffIcon),c=t?.name??!1;return B`
`:B`<ha-card></ha-card>`}}var Fe;i([pt({attribute:!1})],Pe.prototype,"hass",void 0),i([mt()],Pe.prototype,"config",void 0),i([mt()],Pe.prototype,"targets",void 0),i([mt()],Pe.prototype,"selectedEntity",void 0),i([mt()],Pe.prototype,"menuOpen",void 0),i([mt()],Pe.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"}(Fe||(Fe={}));const He=["auto","silent","quiet","low","mid","medium","high","max","turbo","full"];const Ie=["mdi:fan-speed-1","mdi:fan-speed-2","mdi:fan-speed-3","st:fan-speed-4","st:fan-speed-5"],Ve=t=>String(t).toLowerCase().replace(/\s+/g,"_"),Le={low:1,medlow:2,medium_low:2,mid:2,medium:2,medium_high:3,medhigh:3,max:5,turbo:5,full:5};function De(t,e){const i=Ve(t),o=function(t){if(!/^\d+$/.test(t))return;const e=Number(t);return e>=1&&e<=Ie.length?e:void 0}(i);if(o)return Ie[o-1];const a=function(t,e){if("high"===t){const t=new Set(e.map(Ve));return t.has("medium_high")||t.has("medhigh")||t.has("max")||t.has("turbo")||t.has("full")?4:3}return Le[t]}(i,e);return a?Ie[a-1]:void 0}function Ue(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);return Number.isNaN(a)?i:o?"decimal_comma"===o.number_format||"space_comma"===o.number_format?a.toFixed(e).replace(".",","):"comma_decimal"===o.number_format||"none"===o.number_format?a.toFixed(e):new Intl.NumberFormat("system"===o.number_format?void 0:o.language,{minimumFractionDigits:e,maximumFractionDigits:e}).format(a):a.toFixed(e)}const We=[["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/]],Be={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 Ge(t,e){const i=t.toLowerCase().replace(/[.:]/g," "),o=function(t){return"function"!=typeof t?.localize?[]:Object.entries(Be).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=We.find(([,t])=>t.test(i));return a?.[0]??""}function qe(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=Ge(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 Ke({icon:t,label:e,entity:i,hass:o}){const a=qe(t);if(a)return a;const r=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(r)return r;return Ge([e,i?.entity_id,i?.attributes?.friendly_name].filter(Boolean).join(" "),o)}function Ze(t){return t?`toggle-${t}`:""}function Je({header:t,toggleEntityChanged:e,entity:i,hass:o,openEntityPopover:a}){if(!1===t)return q;const r=fe(i)||i.state;let n=t.icon;"object"==typeof t.icon&&(n=n?.[r]??!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`
@@ -2591,7 +2984,7 @@ ha-card.standard-visuals .thermostat-trigger:active {
></ha-icon>`:q);return B` <div class="faults">${i}</div>`}(t.faults,a)}
${function(t,e,i,o,a){return t?.length?B`
<div class="header__toggles">
${t.map(t=>{if(!0===t.hide_when_off&&"off"===a?.state)return q;const r=t.entity?.entity_id,n=t.entity?.state,s="string"==typeof r?r.split(".")[0]:"",c=Be(We({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"===a?.state)return q;const r=t.entity?.entity_id,n=t.entity?.state,s="string"==typeof r?r.split(".")[0]:"",c=Ze(Ke({icon:"string"==typeof t.icon?t.icon:t.entity?.attributes?.icon,label:t.label,entity:t.entity,hass:o}));return B`
<div
class="header__toggle ${n||""} ${s?`domain-${s}`:""} ${c}"
>
@@ -2610,84 +3003,126 @@ ha-card.standard-visuals .thermostat-trigger:active {
</div>
`:q}(t.toggles,a,e,o,i)}
</header>
`}class qe extends Yt{constructor(t){if(super(t),this.it=q,t.type!==Zt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===q||null==t)return this._t=void 0,this.it=t;if(t===G)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}qe.directiveName="unsafeHTML",qe.resultType=1;const Ke=Jt(qe);function Ze(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(t,e,i){if(!e||"string"!=typeof e)return String(t);const o=String(t);return new RegExp(`${Ze(e)}$`).test(o)?o:`${o}${function(t,e){if(e){const i=e.match(new RegExp(`(\\s*)${Ze(t)}$`));if(i)return i[1]??""}return"%"===t?"":" "}(e,i)}${e}`}var Ye,Xe={exports:{}};function Qe(){return Ye||(Ye=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/),r=a.length,n=a[r-1].length+1;throw e(t+=" at line "+r+" col "+n+":\n\n "+i.split(/\n/)[r-1]+"\n "+Array(n).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 r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function n(t,e,i){for(var o in e)r(e,o)&&(null==e[o]||"object"!=typeof e[o]||"storage"!==o&&"prefixes"!==o||i?t[o]=e[o]:t[o]=n({},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,r=[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},""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+u(o.tags[1])+")","g"),h=new RegExp("([^]*?)"+u(o.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),p=0,g=!1;function m(e,a){var r,u={f:[]},m=0,f="c";function v(e){var a=t.slice(p,e),r=a.trim();if("f"===f)"safe"===r?u.raw=!0:o.async&&s.test(r)?(r=r.replace(s,""),u.f.push([r,"",!0])):u.f.push([r,""]);else if("fp"===f)u.f[u.f.length-1][1]+=r;else if("err"===f){if(r){var n=a.search(/\S/);i("invalid syntax",t,p+n)}}else u[f]=r;p=e+1}for("h"===a||"b"===a||"c"===a?f="n":"r"===a&&(u.raw=!0,a="i"),n.lastIndex=p;null!==(r=n.exec(t));){var y=r[1],_=r[2],b=r[3],w=r[4],x=r[5],$=r.index;if(y)"("===y?(0===m&&("n"===f?(v($),f="p"):"f"===f&&(v($),f="fp")),m++):")"===y?0===--m&&"c"!==f&&(v($),f="err"):0===m&&"|"===y?(v($),f="f"):"=>"===y&&(v($),p+=1,f="res");else if(_)if("/*"===_){var S=t.indexOf("*/",n.lastIndex);-1===S&&i("unclosed comment",t,r.index),n.lastIndex=S+2}else"'"===_?(l.lastIndex=r.index,l.exec(t)?n.lastIndex=l.lastIndex:i("unclosed string",t,r.index)):'"'===_?(d.lastIndex=r.index,d.exec(t)?n.lastIndex=d.lastIndex:i("unclosed string",t,r.index)):"`"===_&&(c.lastIndex=r.index,c.exec(t)?n.lastIndex=c.lastIndex:i("unclosed string",t,r.index));else if(b)return v($),p=$+r[0].length,h.lastIndex=p,g=x,w&&"h"===a&&(a="s"),u.t=a,u}return i("unclosed tag",t,e),u}var f=function r(n,c){n.b=[],n.d=[];var l,d=!1,u=[];function f(t,e){t&&(t=function(t,e,i,o){var a,r;return"string"==typeof e.autoTrim?a=r=e.autoTrim:Array.isArray(e.autoTrim)&&(a=e.autoTrim[1],r=e.autoTrim[0]),(i||!1===i)&&(a=i),(o||!1===o)&&(r=o),"slurp"===a&&"slurp"===r?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)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,o,g,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],_=l[2],b=l[3]||"";for(var w in a)if(a[w]===b){v=w;break}f(y,_),p=l.index+l[0].length,v||i("unrecognized tag type: "+b,t,p);var x=m(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=r(x),u.push(x)}else if("c"===$){if(n.n===x.n)return d?(d.d=u,n.b.push(d)):n.d=u,n;i("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===$){d?(d.d=u,n.b.push(d)):n.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 "'+n.n+'"');return f(t.slice(p,t.length),!1),n.d=u,n}({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 g(tLine truncated
class="entity-value ${x?"clickable":""}"
title=${$}
@click="${x?()=>r(w):null}"
`}class Ye extends ee{constructor(t){if(super(t),this.it=q,t.type!==Qt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===q||null==t)return this._t=void 0,this.it=t;if(t===G)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Ye.directiveName="unsafeHTML",Ye.resultType=1;const Xe=te(Ye);function Qe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ti(t,e,i){if(!e||"string"!=typeof e)return String(t);const o=String(t);return new RegExp(`${Qe(e)}$`).test(o)?o:`${o}${function(t,e){if(e){const i=e.match(new RegExp(`(\\s*)${Qe(t)}$`));if(i)return i[1]??""}return"%"===t?"":" "}(e,i)}${e}`}var ei,ii={exports:{}};function oi(){return ei||(ei=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/),r=a.length,n=a[r-1].length+1;throw e(t+=" at line "+r+" col "+n+":\n\n "+i.split(/\n/)[r-1]+"\n "+Array(n).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 r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function n(t,e,i){for(var o in e)r(e,o)&&(null==e[o]||"object"!=typeof e[o]||"storage"!==o&&"prefixes"!==o||i?t[o]=e[o]:t[o]=n({},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,r=[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},""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+u(o.tags[1])+")","g"),h=new RegExp("([^]*?)"+u(o.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),p=0,m=!1;function g(e,a){var r,u={f:[]},g=0,f="c";function v(e){var a=t.slice(p,e),r=a.trim();if("f"===f)"safe"===r?u.raw=!0:o.async&&s.test(r)?(r=r.replace(s,""),u.f.push([r,"",!0])):u.f.push([r,""]);else if("fp"===f)u.f[u.f.length-1][1]+=r;else if("err"===f){if(r){var n=a.search(/\S/);i("invalid syntax",t,p+n)}}else u[f]=r;p=e+1}for("h"===a||"b"===a||"c"===a?f="n":"r"===a&&(u.raw=!0,a="i"),n.lastIndex=p;null!==(r=n.exec(t));){var y=r[1],b=r[2],_=r[3],w=r[4],x=r[5],$=r.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("*/",n.lastIndex);-1===S&&i("unclosed comment",t,r.index),n.lastIndex=S+2}else"'"===b?(l.lastIndex=r.index,l.exec(t)?n.lastIndex=l.lastIndex:i("unclosed string",t,r.index)):'"'===b?(d.lastIndex=r.index,d.exec(t)?n.lastIndex=d.lastIndex:i("unclosed string",t,r.index)):"`"===b&&(c.lastIndex=r.index,c.exec(t)?n.lastIndex=c.lastIndex:i("unclosed string",t,r.index));else if(_)return v($),p=$+r[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 r(n,c){n.b=[],n.d=[];var l,d=!1,u=[];function f(t,e){t&&(t=function(t,e,i,o){var a,r;return"string"==typeof e.autoTrim?a=r=e.autoTrim:Array.isArray(e.autoTrim)&&(a=e.autoTrim[1],r=e.autoTrim[0]),(i||!1===i)&&(a=i),(o||!1===o)&&(r=o),"slurp"===a&&"slurp"===r?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)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(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=r(x),u.push(x)}else if("c"===$){if(n.n===x.n)return d?(d.d=u,n.b.push(d)):n.d=u,n;i("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===$){d?(d.d=u,n.b.push(d)):n.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 "'+n.n+'"');return f(t.slice(p,t.length),!1),n.d=u,n}({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(tLine truncated
class="entity-value ${$?"clickable":""}"
title=${S}
@click="${$?()=>r(x):null}"
>
${Ke(Je(t,!!b&&l))}
</div>`}else if("relativetime"===n)S=B`
${Xe(ti(t,!!w&&l))}
</div>`}else if("relativetime"===n)A=B`
<div class="entity-value">
<ha-relative-time .datetime=${i} .hass=${e}></ha-relative-time>
</div>
`;else if("object"==typeof i){const[t]=i.entity_id.split(".");A=t,k=i.state,C=ci.includes(t);const o=[C&&"toggle-entity",A&&`domain-${li(A)}`,k&&`state-${li(k)}`,C&&Be(We({icon:y||i.attributes?.icon,label:s||i.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" ");if("timer"===t)S=B`
`;else if("object"==typeof i){const[t]=i.entity_id.split(".");k=t,C=i.state,E=ui.includes(t);const o=function(t,e){return"string"==typeof t&&mi.includes(t)?"auto"!==t?t:ui.includes(e)?"toggle":pi.includes(e)?"button":"chip":"row"}(y,t),n=[E&&"toggle-entity",k&&`domain-${fi(k)}`,C&&`state-${fi(C)}`,"row"!==o&&`display-${o}`,E&&Ze(Ke({icon:b||i.attributes?.icon,label:s||i.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" ");if("row"!==o){z=!0;const c=E||pi.includes(t),l="on"===i.state,d="string"==typeof s?s:i.attributes?.friendly_name||i.entity_id,h=b||i.attributes?.icon||(E?"mdi:toggle-switch":pi.includes(t)?"mdi:gesture-tap-button":void 0),u=function({state:t,domain:e,hass:i,localize:o}){return"timer"===e?B`<simple-thermostat-timer-remaining
.stateObj=${t}
.hass=${i}
></simple-thermostat-timer-remaining>`:"function"==typeof i.formatEntityState?i.formatEntityState(t):o?o(t.state,`component.${e}.state._.`):String(t.state)}({state:i,domain:t,hass:e,localize:a});A=B`
<button
class="entity-action ${n} ${l?"active":""}"
type="button"
title=${S}
aria-pressed=${E?String(l):q}
@click=${()=>c?function(t,e,i){if(ui.includes(i))return void gi(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):$?r(i.entity_id):void 0}
>
${h?B`<ha-icon .icon=${h}></ha-icon>`:""}
<span class="entity-action__label">${d}</span>
${"chip"===o||"toggle"===o?B`<span class="entity-action__state">${u}</span>`:""}
</button>
`}else if("timer"===t)A=B`
<div
class="entity-value ${x?"clickable":""}"
title=${$}
@click="${x?()=>r(i.entity_id):null}"
class="entity-value ${$?"clickable":""}"
title=${S}
@click="${$?()=>r(i.entity_id):null}"
>
<simple-thermostat-timer-remaining
.stateObj=${i}
.hass=${e}
></simple-thermostat-timer-remaining>
</div>
`;else if(C)S=B`
<div class="entity-value ${o}">
`;else if(E)A=B`
<div class="entity-value ${n}">
<ha-switch
.checked=${"on"===i.state}
@change=${t=>function(t,e,i){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})}(e,i.entity_id,t.target.checked)}
@change=${t=>gi(e,i.entity_id,t.target.checked)}
></ha-switch>
</div>
`;else{const o=["component",t,"state",i.attributes?.device_class??"_",""].join(".");let n="function"==typeof e.formatEntityState?e.formatEntityState(i):a(i.state,o);"number"==typeof d&&(n=Ve(i.state,{decimals:d,locale:e.locale}));const s=i.attributes.unit_of_measurement??"",h="humidity"===i.attributes?.device_class||i.entity_id?.includes("humidity")||"mdi:water-percent"===c?"%":"";S=B`
`;else{const o=["component",t,"state",i.attributes?.device_class??"_",""].join(".");let n="function"==typeof e.formatEntityState?e.formatEntityState(i):a(i.state,o);"number"==typeof d&&(n=Ue(i.state,{decimals:d,locale:e.locale}));const s=i.attributes.unit_of_measurement??"",h="humidity"===i.attributes?.device_class||i.entity_id?.includes("humidity")||"mdi:water-percent"===c?"%":"";A=B`
<div
class="entity-value ${x?"clickable":""}"
title=${$}
@click="${x?()=>r(i.entity_id):null}"
class="entity-value ${$?"clickable":""}"
title=${S}
@click="${$?()=>r(i.entity_id):null}"
>
${Je(n,b?l:s||h,n)}
${ti(n,w?l:s||h,n)}
</div>
`}}else{let t="number"==typeof d?Ve(i,{decimals:d,locale:e.locale}):i;S=B`<div
class="entity-value ${x?"clickable":""}"
title=${$||q}
@click=${x?()=>r(w):null}
`}}else{let t="number"==typeof d?Ue(i,{decimals:d,locale:e.locale}):i;A=B`<div
class="entity-value ${$?"clickable":""}"
title=${S||q}
@click=${$?()=>r(x):null}
>
${Je(t,!!b&&l)}
</div>`}if(!1===s)return S;const E=s||$,z=["entity-heading",x&&"clickable",C&&"toggle-entity",A&&`domain-${li(A)}`,k&&`state-${li(k)}`,C&&Be(We({icon:y||i?.attributes?.icon,label:"string"==typeof s?s:i?.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" "),T=y?B`
${ti(t,!!w&&l)}
</div>`}if(z)return A;if(!1===s)return A;const T=s||S,O=["entity-heading",$&&"clickable",E&&"toggle-entity",k&&`domain-${fi(k)}`,C&&`state-${fi(C)}`,E&&Ze(Ke({icon:b||i?.attributes?.icon,label:"string"==typeof s?s:i?.attributes?.friendly_name,entity:i,hass:e}))].filter(Boolean).join(" "),R=b?B`
<ha-icon
icon="${y}"
title=${E}
@click=${x?()=>r(w):null}
icon="${b}"
title=${T}
@click=${$?()=>r(x):null}
></ha-icon>
`:"string"==typeof _?B`${Ke(_)}`:` ${s}${!1===v?"":":"} `;return[B`<div
class=${z}
title=${y?E:q}
@click=${x?()=>r(w):null}
`:"string"==typeof _?B`${Xe(_)}`:` ${s}${!1===v?"":":"} `;return[B`<div
class=${O}
title=${b?T:q}
@click=${$?()=>r(x):null}
>
${T}
</div>`,S]}function hi({_hide:t,entity:e,unit:i,hass:o,entities:a,config:r,localize:n,openEntityPopover:s,adapter:c}){const l=r.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=r?.layout?.entities?.labels??!0,g=!1!==r?.layout?.entities?.separator,m=r?.state_labels?.[e.state]??pe(e,o,n),f=(!0===r?.hide_current_value_when_off||!0===r?.hide?.current_value_when_off||!0===r?.hide?.temperature_when_off)&&e.state===Me.OFF,v=[di({hide:t.temperature||f||null==h,state:Je(Ve(h,{...r,locale:o.locale}),u),hass:o,openEntityPopover:s,details:{heading:!!p&&(r?.label?.temperature??n("ui.card.climate.currently")),tooltip:d?.attributes?.friendly_name??l,entity:l??r.entity,separator:g}}),di({hide:t.state,state:m,hass:o,openEntityPopover:s,details:{heading:!!p&&(r?.label?.state??n("ui.panel.lovelace.editor.card.generic.state")),entity:r.entity,separator:g}}),...(a??[]).map(({name:t,state:i,show:a,_hide_when_off:c,hide_when_off:l,...d})=>di({hide:!1===a||(!0===c||!0===l)&&e.state===Me.OFF,state:i,hass:o,localize:n,openEntityPopover:s,details:{...d,heading:p&&t,tooltip:t,config:r,variables:r.variables,separator:g}}))||null].filter(t=>null!==t);return function(t,e){const{type:i="table",labels:o=!0,alignment:a}=t?.layout?.entities??{},r=[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 ${r.join(" ")}">${e}</div> `}(r,v)}const ui={"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 pi({state:t,entity:e,hass:i,mode:o,adapter:a,modeOptions:r,localize:n,setMode:s}){const{type:c,hide_when_off:l,mode:d="none",list:h,name:u,heading:p,icons:g}=o;if(0===h.length||l&&t===Me.OFF)return null;const m="hvac"===c?null:a.getModePayloadKey(c);let f=m?`state_attributes.${a.getLocalizationDomain()}.${m}.`:"";"hvac"===c?f="component.climate.state._.":"vane_horizontal"===c||"vane_vertical"===c?f="":"direction"!==c&&"oscillating"!==c&&"mode"!==c||(f="");const v=(t,e=!1)=>t?!1===r?.icons||!1===g||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c)&&!0!==g&&!e?null:function(t){return t?B` <ha-icon class="mode-icon" .icon=${t}></ha-icon> `:null}(t):null,y=(t,e)=>{const i=n(t);return i&&i!==t?i:e},_="hvac"==c?"operation":`${c}_mode`;let b;b="vane_horizontal"===c?"Vane Horizontal":"vane_vertical"===c?"Vane Vertical":"swing_horizontal"===c?y("ui.card.climate.swing_horizontal_mode","Swing Horizontal"):"swing_vertical"===c?y("ui.card.climate.swing_vertical_mode","Swing Vertical"):"direction"===c?"Direction":"oscillating"===c?"Oscillating":"mode"===c?"Mode":"preset"===c?!0===p&&y(`ui.card.${a.getLocalizationDomain()}.${_}`,"Preset"):"state"===c?!0===p&&"State":y(`ui.card.${a.getLocalizationDomain()}.${_}`,"hvac"===c?"Operation":"Mode");const w=!1!==u&&(u||b),x="fan"===c||"preset"===c&&"fan"===a.getLocalizationDomain()?"Fan speed":"swing"===c?"Swing mode":"swing_horizontal"===c?y("ui.card.climate.swing_horizontal_mode","Horizontal swing"):"swing_vertical"===c?y("ui.card.climate.swing_vertical_mode","Vertical swing"):"vane_horizontal"===c?"Horizontal vane":"vane_vertical"===c?"Vertical vane":"",$=(!0===r?.headings||!0===p)&&!1!==w,S="preset"===c&&"fan"===a.getLocalizationDomain(),A=("hvac"===c||"state"===c||"fan"===c)&&h.length<=4,k="preset"===c&&h.length<=4||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c),C=h.length>4||"hvac"===c&&h.length>4||"fan"===c&&h.length>4;return B`
${R}
</div>`,A]}function yi({_hide:t,entity:e,unit:i,hass:o,entities:a,config:r,localize:n,openEntityPopover:s,adapter:c}){const l=r.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=r?.layout?.entities?.labels??!0,m=!1!==r?.layout?.entities?.separator,g=r?.state_labels?.[e.state]??ve(e,o,n),f=(!0===r?.hide_current_value_when_off||!0===r?.hide?.current_value_when_off||!0===r?.hide?.temperature_when_off)&&e.state===Fe.OFF,v=[vi({hide:t.temperature||f||null==h,state:ti(Ue(h,{...r,locale:o.locale}),u),hass:o,openEntityPopover:s,details:{heading:!!p&&(r?.label?.temperature??n("ui.card.climate.currently")),tooltip:d?.attributes?.friendly_name??l,entity:l??r.entity,separator:m}}),vi({hide:t.state,state:g,hass:o,openEntityPopover:s,details:{heading:!!p&&(r?.label?.state??n("ui.panel.lovelace.editor.card.generic.state")),entity:r.entity,separator:m}}),...(a??[]).map(({name:t,state:i,show:a,display:c,_hide_when_off:l,hide_when_off:d,...h})=>vi({hide:!1===a||(!0===l||!0===d)&&e.state===Fe.OFF,state:i,hass:o,localize:n,openEntityPopover:s,details:{...h,heading:p&&t,tooltip:t,config:r,variables:r.variables,separator:m,display:c??r?.layout?.entities?.display}}))||null].filter(t=>null!==t);return function(t,e){const{type:i="table",labels:o=!0,alignment:a}=t?.layout?.entities??{},r=[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 ${r.join(" ")}">${e}</div> `}(r,v)}const bi=new Set(["heat_cool","fan_only"]);function _i(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 bi.has(t)&&o.length>10?{layout:"column",lines:[o]}:{layout:"inline",lines:[o]}}const wi={"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 xi(t){return t?B` <ha-icon class="mode-icon" .icon=${t}></ha-icon> `:null}function $i({state:t,entity:e,hass:i,mode:o,adapter:a,modeOptions:r,localize:n,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===Fe.OFF)return null;const g="hvac"===c?null:a.getModePayloadKey(c);let f=g?`state_attributes.${a.getLocalizationDomain()}.${g}.`:"";"hvac"===c?f="component.climate.state._.":"vane_horizontal"===c||"vane_vertical"===c?f="":"direction"!==c&&"oscillating"!==c&&"mode"!==c||(f="");const v=(t,e)=>{const i=n(t);return i&&i!==t?i:e},y="hvac"==c?"operation":`${c}_mode`;let b;b="vane_horizontal"===c?"Vane Horizontal":"vane_vertical"===c?"Vane Vertical":"swing_horizontal"===c?v("ui.card.climate.swing_horizontal_mode","Swing Horizontal"):"swing_vertical"===c?v("ui.card.climate.swing_vertical_mode","Swing Vertical"):"direction"===c?"Direction":"oscillating"===c?"Oscillating":"mode"===c?"Mode":"preset"===c?!0===p&&v(`ui.card.${a.getLocalizationDomain()}.${y}`,"Preset"):"state"===c?!0===p&&"State":v(`ui.card.${a.getLocalizationDomain()}.${y}`,"hvac"===c?"Operation":"Mode");const _=!1!==u&&(u||b),w="fan"===c||"preset"===c&&"fan"===a.getLocalizationDomain()?"Fan speed":"swing"===c?"Swing mode":"swing_horizontal"===c?v("ui.card.climate.swing_horizontal_mode","Horizontal swing"):"swing_vertical"===c?v("ui.card.climate.swing_vertical_mode","Vertical swing"):"vane_horizontal"===c?"Horizontal vane":"vane_vertical"===c?"Vertical vane":"",x=(!0===r?.headings||!0===p)&&!1!==_,$="preset"===c&&"fan"===a.getLocalizationDomain(),S=("hvac"===c||"state"===c||"fan"===c)&&h.length<=4,A="preset"===c&&h.length<=4||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c),k=h.length>4||"hvac"===c&&h.length>4||"fan"===c&&h.length>4;return B`
<div
class="modes ${c} ${S?"fan-preset":""} ${$?"heading":""} ${k?"compact":""} ${C?"dense":""} ${A?"sparse":""}"
class="modes ${c} ${$?"fan-preset":""} ${x?"heading":""} ${A?"compact":""} ${k?"dense":""} ${S?"sparse":""}"
role="group"
aria-label=${w||c}
aria-label=${_||c}
>
${$?B` <div class="mode-title">${w}</div> `:""}
${h.map(({value:o,icon:a,iconConfigured:l,name:h,hide_when_off:u})=>{if(!0===u&&t===Me.OFF)return q;const p=(t=>String(t).replace(/[^a-z0-9_-]/gi,""))(o),g=((t,o)=>!1===t||!1===r?.names?null:t!==o?f?n(t,f):t:"hvac"!==c&&"state"!==c||"function"!=typeof i?.formatEntityState?m&&e&&"function"==typeof i?.formatEntityAttributeValue?i.formatEntityAttributeValue(e,m,o):f?n(t,f):t:i.formatEntityState({...e,state:o}))(h,o);return B`
${x?B` <div class="mode-title">${_}</div> `:""}
${h.map(({value:o,icon:a,iconConfigured:l,name:h,hide_when_off:u})=>{if(!0===u&&t===Fe.OFF)return q;const p=(t=>String(t).replace(/[^a-z0-9_-]/gi,""))(o),v=((t,o)=>!1===t||!1===r?.names?null:t!==o?f?n(t,f):t:"hvac"!==c&&"state"!==c||"function"!=typeof i?.formatEntityState?g&&e&&"function"==typeof i?.formatEntityAttributeValue?i.formatEntityAttributeValue(e,g,o):f?n(t,f):t:i.formatEntityState({...e,state:o}))(h,o),y=_i(String(o),v,S),b="stacked"===y.layout?"label-stacked":"column"===y.layout?"label-column":"";return B`
<div
class="mode-item ${p} ${o===d?"active":""}"
class="mode-item ${p} ${b} ${o===d?"active":""}"
role="button"
tabindex="0"
aria-pressed=${o===d?"true":"false"}
aria-label=${h||o}
title=${g?q:x||q}
title=${v?q:w||q}
@click=${()=>s(c,o)}
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),s(c,o))}}
>
${v(a,l)}
${g?B`<span class="mode-label">${g}</span>`:null}
${((t,e=!1)=>t?!1===r?.icons||!1===m||["swing","swing_horizontal","swing_vertical","vane_horizontal","vane_vertical"].includes(c)&&!0!==m&&!e?null:xi(t):null)(a,l)}
${((t,e)=>{if(!e)return null;const i=_i(t,e,S);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">${i.lines[0]??e}</span>`})(String(o),v)}
</div>
`})}
</div>
`}window.customIconsets=window.customIconsets||{},window.customIconsets.st||(window.customIconsets.st=async t=>{const e=ui[`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 gi=Object.values(mt),mi="hass:chevron-up",fi="hass:chevron-down",vi="mdi:plus",yi="mdi:minus",_i={temperature:!1,state:!1},bi=[mt.PRESET,mt.FAN,mt.HVAC,mt.SWING,mt.SWING_HORIZONTAL,mt.SWING_VERTICAL,mt.VANE_HORIZONTAL,mt.VANE_VERTICAL,mt.DIRECTION,mt.OSCILLATING,mt.STATE],wi=["entity","hide_when_off","hide_off_when_off"];function xi(t,e,i){const o=Si(String(e),i);if(Ai(o))return!1!==o.include;const a=Object.keys(i).some(t=>!t.startsWith("_")),r=t===mt.PRESET;return o??!(r&&a)}function $i(t){return t.toLowerCase().replace(/\s+/g,"_")}function Si(t,e){const i=$i(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)&&$i(t)===i);return a?.[1]}function Ai(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ki(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($i(String(t)),t)});const a=new Set,r=[];return i.forEach(t=>{const e=$i(t);o.has(e)&&!a.has(e)&&(r.push(o.get(e)),a.add(e))}),t.forEach(t=>{const e=$i(String(t));a.has(e)||(r.push(t),a.add(e))}),r}function Ci(t,e,i,o={}){let a=e[i.getModeAttribute(t)];return t===mt.STATE?a=["off","on"]:t===mt.DIRECTION&&e.direction?a=["forward","reverse"]:t===mt.OSCILLATING&&"boolean"==typeof e.oscillating&&(a=[!1,!0]),Array.isArray(a)?ki(a,o).filter(e=>xi(t,e,o)).map(e=>{const i=String(e),r=Si(i,o),n=Ai(r)?r:{},{name:s,...c}=n,l=!0===n.hide_when_off||!0===o.hide_off_when_off&&"off"===$i(i),d=!1!==s&&("string"==typeof s?s:be(i));return{...c,hide_when_off:l||void 0,icon:n.icon??(t===mt.FAN?Ie(i,a):void 0)??_e(i),iconConfigured:void 0!==n.icon,value:i,name:d}}):[]}function Ei(t){return"string"==typeof t?.entity_id&&t.entity_id.startsWith("select.")&&Array.isArray(t.attributes?.options)}function zi(t,e={}){return ki(t.attributes.options,e).filter(t=>xi("select",t,e)).map(t=>{const i=String(t),o=Si(i,e),a=Ai(o)?o:{},{name:r,...n}=a,s=!0===a.hide_when_off||!0===e.hide_off_when_off&&"off"===$i(i),c=!1!==r&&("string"==typeof r?r:be(i));return{...n,hide_when_off:s||void 0,icon:a.icon??_e(i),iconConfigured:void 0!==a.icon,value:i,name:c}})}function Ti(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;`}function Oi(t){const e=t?.style;if("object"==typeof e&&e){const t=e["ha-card"];if("string"==typeof t)return t.trim();const i=e["."];if("string"==typeof i){const t=i.match(/ha-card\s*\{([\s\S]*?)\}/);return(t?.[1]??"").trim()}}if("string"!=typeof e)return"";const i=e.match(/ha-card\s*\{([\s\S]*?)\}/);return(i?.[1]??"").trim()}function Ni(t,e,i,o){return gi.includes(t)&&(t===mt.STATE?"fan"===e||"humidifier"===e:void 0!==i[o.getModeAttribute(t)])}function Mi(t,e,i,o){return t.filter(t=>Ni(t,e,i,o)).map(t=>({type:t,hide_when_off:!1,list:Ci(t,i,o)}))}class Ri extends lt{constructor(){super(...arguments),this.modes=[],this._hass={},this.entities=[],this.showEntities=!0,this.name="",this.stepSize=.5,this._values={},this._updatingValues=!1,this._hide=_i,this._updatingValuesTimeout=null,this._holdTimer=null,this._holdFired=!1,this._clickCount=0,this._clickTimer=null,this._setpointUpdateTimer=null,this._pendingSetpointValues=null,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;const i=t.target;this._callAction("homeassistant.turn_"+(i.checked?"on":"off"),{entity_id:e})},this.setMode=(t,e)=>{if(t&&e){const i=$t(this.config.entity);if(t===mt.STATE)return this._callAction(`${i.getLocalizationDomain()}.turn_${e}`,{entity_id:this.config.entity}),void vt(this,"haptic","light");const o=this.modes.find(e=>e.type===t);if(o?.entity)return this._callAction("select.select_option",{entity_id:o.entity,option:e}),void vt(this,"haptic","light");const a=i.transformModePayloadValue?.(t,e)??e;this._callAction(`${i.getLocalizationDomain()}.${i.getModeLine truncated
`}window.customIconsets=window.customIconsets||{},window.customIconsets.st||(window.customIconsets.st=async t=>{const e=wi[`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 Si=t=>String(t).replace(/[^a-z0-9_-]/gi,"");function Ai({toggles:t,mainState:e,toggleFooterEntity:i,openEntityPopover:o}){const a=t.filter(t=>!(!0===t.hide_when_off&&e===Fe.OFF));return a.length?B`
<section class="footer-controls controls">
<div
class="modes footer compact ${a.length>4?"dense":""}"
role="group"
aria-label="Footer controls"
>
${a.map(t=>{const e=t.state.entity_id,a=String(t.state.state??""),r="on"===a,n=!1!==t.name&&(t.name||t.state.attributes?.friendly_name||e),s=t.icon??t.state.attributes?.icon,c=e.split(".")[0];return B`
<div
class="mode-item footer-toggle ${Si(a)} domain-${Si(c)} ${r?"active":""}"
role="button"
tabindex="0"
aria-pressed=${r?"true":"false"}
aria-label=${n||e}
title=${n||e}
@click=${()=>i(e,!r)}
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),i(e,!r))}}
@contextmenu=${t=>{t.preventDefault(),o(e)}}
>
${s?xi(s):q}
${n?B`<span class="mode-label">${n}</span>`:q}
</div>
`})}
</div>
</section>
`:q}const ki=Object.values(gt),Ci="hass:chevron-up",Ei="hass:chevron-down",zi="mdi:plus",Ti="mdi:minus",Oi={temperature:!1,state:!1},Ri=[gt.PRESET,gt.FAN,gt.HVAC,gt.SWING,gt.SWING_HORIZONTAL,gt.SWING_VERTICAL,gt.VANE_HORIZONTAL,gt.VANE_VERTICAL,gt.DIRECTION,gt.OSCILLATING,gt.STATE],Ni=["entity","hide_when_off","hide_off_when_off"];function Mi(t,e,i){const o=Pi(String(e),i);if(Fi(o))return!1!==o.include;const a=Object.keys(i).some(t=>!t.startsWith("_")),r=t===gt.PRESET;return o??!(r&&a)}function ji(t){return t.toLowerCase().replace(/\s+/g,"_")}function Pi(t,e){const i=ji(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("_")&&!Ni.includes(t)&&ji(t)===i);return a?.[1]}function Fi(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Hi(t,e){const i=Array.isArray(e._order)?e._order.map(String):Object.keys(e).filter(t=>!t.startsWith("_")&&!Ni.includes(t));if(0===i.length)return t;const o=new Map;t.forEach(t=>{o.set(ji(String(t)),t)});const a=new Set,r=[];return i.forEach(t=>{const e=ji(t);o.has(e)&&!a.has(e)&&(r.push(o.get(e)),a.add(e))}),t.forEach(t=>{const e=ji(String(t));a.has(e)||(r.push(t),a.add(e))}),r}function Ii(t,e,i,o={}){let a=e[i.getModeAttribute(t)];return t===gt.STATE?a=["off","on"]:t===gt.DIRECTION&&e.direction?a=["forward","reverse"]:t===gt.OSCILLATING&&"boolean"==typeof e.oscillating&&(a=[!1,!0]),Array.isArray(a)?Hi(a,o).filter(e=>Mi(t,e,o)).map(e=>{const i=String(e),r=Pi(i,o),n=Fi(r)?r:{},{name:s,...c}=n,l=!0===n.hide_when_off||!0===o.hide_off_when_off&&"off"===ji(i),d=!1!==s&&("string"==typeof s?s:Se(i));return{...c,hide_when_off:l||void 0,icon:n.icon??(t===gt.FAN?De(i,a):void 0)??$e(i),iconConfigured:void 0!==n.icon,value:i,name:d}}):[]}function Vi(t){return"string"==typeof t?.entity_id&&t.entity_id.startsWith("select.")&&Array.isArray(t.attributes?.options)}function Li(t,e={}){return Hi(t.attributes.options,e).filter(t=>Mi("select",t,e)).map(t=>{const i=String(t),o=Pi(i,e),a=Fi(o)?o:{},{name:r,...n}=a,s=!0===a.hide_when_off||!0===e.hide_off_when_off&&"off"===ji(i),c=!1!==r&&("string"==typeof r?r:Se(i));return{...n,hide_when_off:s||void 0,icon:a.icon??$e(i),iconConfigured:void 0!==a.icon,value:i,name:c}})}function Di(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;`}function Ui(t){const e=t?.style;if("object"==typeof e&&e){const t=e["ha-card"];if("string"==typeof t)return t.trim();const i=e["."];if("string"==typeof i){const t=i.match(/ha-card\s*\{([\s\S]*?)\}/);return(t?.[1]??"").trim()}}if("string"!=typeof e)return"";const i=e.match(/ha-card\s*\{([\s\S]*?)\}/);return(i?.[1]??"").trim()}function Wi(t,e,i,o){return ki.includes(t)&&(t===gt.STATE?"fan"===e||"humidifier"===e:void 0!==i[o.getModeAttribute(t)])}function Bi(t,e,i,o){return t.filter(t=>Wi(t,e,i,o)).map(t=>({type:t,hide_when_off:!1,list:Ii(t,i,o)}))}class Gi 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=Oi,this._updatingValuesTimeout=null,this._holdTimer=null,this._holdFired=!1,this._clickCount=0,this._clickTimer=null,this._setpointUpdateTimer=null,this._pendingSetpointValues=null,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;const i=t.target;this._callAction("homeassistant.turn_"+(i.checked?"on":"off"),{entity_id:e})},this.toggleFooterEntity=(t,e)=>{this._callAction("homeassistant.turn_"+(e?"on":"off"),{entity_id:t}),vt(this,"haptic","light")},this.setMode=(t,e)=>{if(t&&e){const i=$t(this.config.entity);if(t===gt.STATE)return this._callAction(`${i.getLocalizationDomain()}.turn_${e}`,{entity_id:this.config.entity}),void vt(this,"haptic","light");const o=this.modes.find(e=>e.type===t);if(o?.entity)return this._callAction("select.select_option",{entity_id:o.entity,option:e}),void vt(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}),vt(this,"haptic","light")}else vt(this,"haptic","failure")},this.openEntityPopover=(t=null)=>{vt(this,"hass-more-info",{entityId:t||this.config.entity})},this._onActionPointerDown=t=>{0!==t.button&&"mouse"===t.pointerType||(this._holdFired=!1,this._holdTimer&&clearTimeout(this._holdTimer),this._holdTimer=setTimeout(()=>{this._holdFired=!0,this._holdTimer=null,this._dispatchAction("hold")},Gi.HOLD_MS))},this._onActionPointerUp=()=>{this._holdTimer&&(clearTimeout(this._holdTimer),this._holdTimer=null)},this._onActionClick=t=>{t.preventDefault(),this._holdFired?this._holdFired=!1:(this._clickCount+=1,1===this._clickCount?(this._clickTimer&&clearTimeout(this._clickTime Line truncated
<ha-alert alert-type="warning">
Decimals is set to 0 and step_size is lower than 1. Decrementing a
setpoint will likely not work. Change one of the settings to clear
@@ -2703,23 +3138,24 @@ ha-card.standard-visuals .thermostat-trigger:active {
Entity not available: ${o.entity}
</ha-alert>
</ha-card>
`;const n=$t(o.entity),s=ue(a),{min:c,max:l}=n.getRange(a.attributes),d=this.getUnit(),h=o.entity.split(".")[0],u=Object.keys(e).length,p=!1===this.config.enhanced_visuals?this.config?.layout?.step??"column":this.config?.layout?.step??"row",g="row"===p,m=["unavailable","unknown"].includes(a.state),f=t=>"string"==typeof t?t.replace(/[^a-z0-9_-]/gi,""):"",v=[!this.header&&"no-header",`domain-${f(h)}`,`state-${f(a.state)}`,!1===this.config.enhanced_visuals&&"standard-visuals",!0===this.config.embedded&&"embedded",f(s),m&&f(a.state)].filter(t=>!!t),y=["body",this.showEntities&&"has-entities",`step-${p}`,`setpoint-count-${u}`].filter(t=>!!t),_=!0===o.embedded,b=_?function(t,e,i){return[Oi(t.card_mod),Ti(e,i)].filter(t=>!!t).join("; ")}(o,h,a.attributes):Ti(h,a.attributes),w=this.showEntities?hi({_hide:t,unit:d,hass:this._hass,entity:this.entity,entities:this.entities,config:this.config,adapter:n,localize:this.localize,openEntityPopover:this.openEntityPopover}):"",x=_?B`<div class="embedded-header-reserve" aria-hidden="true"></div>`:Ge({header:this.header,hass:this._hass,toggleEntityChanged:this.toggleEntityChanged,entity:this.entity,openEntityPopover:this.openEntityPopover});return B`
<ha-card class="${v.join(" ")}" style=${b}>
`;const n=$t(o.entity),s=fe(a),{min:c,max:l}=n.getRange(a.attributes),d=this.getUnit(),h=o.entity.split(".")[0],u=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=w?function(t,e,i){return[Ui(t.card_mod),Di(e,i)].filter(t=>!!t).join("; ")}(o,h,a.attributes):Di(h,a.attributes),$=this.showEntities?yi({_hide:t,unit:d,hass:this._hass,entity:this.entity,entities:this.entities,config:this.config,adapter:n,localize:this.localize,openEntityPopover:this.openEntityPopover}):"",S=w?B`<div class="embedded-header-reserve" aria-hidden="true"></div>`:Je({header:this.header,hass:this._hass,toggleEntityChanged:this.toggleEntityChanged,entity:this.entity,openEntityPopover:this.openEntityPopover});return B`
<ha-card class="${b.join(" ")}" style=${x}>
${o.styles?B`<style>
${o.styles}
</style>`:q}
${r}
${x}
<section class="${y.join(" ")}">
${w}
${this.renderSetpoints({values:e,minValue:c,maxValue:l,unit:d,row:g,stepLayout:p,isOff:a.state===Me.OFF,disableSteppers:"climate"===h&&a.state===Me.OFF&&!0===this.config.disable_setpoint_change_when_off})}
${S}
<section class="${_.join(" ")}">
${$}
${this.renderSetpoints({values:e,minValue:c,maxValue:l,unit:d,row:f,stepLayout:g,isOff:a.state===Fe.OFF,disableSteppers:"climate"===h&&a.state===Fe.OFF&&!0===this.config.disable_setpoint_change_when_off})}
</section>
${this.modes.length?B`
<section class="controls">
${this.modes.map(t=>pi({state:a.state,entity:a,hass:this._hass,mode:t,adapter:n,localize:this.localize,modeOptions:this.config?.layout?.mode??{},setMode:this.setMode}))}
${this.modes.map(t=>$i({state:a.state,entity:a,hass:this._hass,mode:t,adapter:n,localize:this.localize,modeOptions:this.config?.layout?.mode??{},setMode:this.setMode}))}
</section>
`:q}
${Ai({toggles:this.footer,mainState:a.state,toggleFooterEntity:this.toggleFooterEntity,openEntityPopover:this.openEntityPopover})}
</ha-card>
`}renderSetpoints({values:t,minValue:e,maxValue:i,unit:o,row:a,stepLayout:r,isOff:n,disableSteppers:s}){return!0===this.config.hide_setpoint||!0===this.config.hide_setpoint_when_off&&n||!0===this.config.hide?.setpoint_when_off&&n?q:Object.entries(t).map(([t,c])=>this.renderSetpointControl({field:t,value:c,minValue:e,maxValue:i,unit:o,row:a,stepLayout:r,isOff:n,disableSteppers:s}))}renderSetpointControl(t){const{row:e,stepLayout:i}=t,o=this.renderSetpointStepper(t,"decrease"),a=this.renderSetpointValue(t),r=this.renderSetpointStepper(t,"increase"),n=this.renderSetpointLabel(t);return B`
<div class="current-wrapper ${i}">
@@ -2734,9 +3170,9 @@ ha-card.standard-visuals .thermostat-trigger:active {
aria-label=${`${l?"Decrease":"Increase"} ${t}`}
@click="${()=>l?this.setTemperature(-this.stepSize,t):null===e&&null!==i?this.setTemperature(0,t,i):this.setTemperature(this.stepSize,t)}"
>
<ha-icon .icon=${l?a?yi:fi:a?vi:mi}></ha-icon>
<ha-icon .icon=${l?a?Ti:Ei:a?zi:Ci}></ha-icon>
</button>
`}renderSetpointValue({field:t,value:e,unit:i,isOff:o}){const a=["string","number"].includes(typeof e)&&""!==e&&null!==e,r=!1!==i&&a,n=o&&!a,s=n?"OFF":Ve(e,{...this.config,locale:this._hass.locale}),c=r&&"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`
`}renderSetpointValue({field:t,value:e,unit:i,isOff:o}){const a=["string","number"].includes(typeof e)&&""!==e&&null!==e,r=!1!==i&&a,n=o&&!a,s=n?"OFF":Ue(e,{...this.config,locale:this._hass.locale}),c=r&&"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}
@@ -2750,4 +3186,4 @@ ha-card.standard-visuals .thermostat-trigger:active {
>
${d}${c?B`${l}<span class="current--unit">${c}</span>`:q}
</h3>
`}setTemperature(t,e,i){this._updatingValues=!0,this._updatingValuesTimeout&&clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=setTimeout(()=>{this._updatingValues=!1,this._updatingValuesTimeout=null},1e4);const o=i??this._values[e],a=Number(o)+t,{decimals:r}=this.config;this._values={...this._values,[e]:+Ve(a,{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"});vt(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===Me.OFF||!0===this.config.hide?.setpoint_when_off&&this.entity?.state===Me.OFF?0:1,o=this.modes?.filter(t=>(!0!==t.hide_when_off||this.entity?.state!==Me.OFF)&&(t.list??[]).some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===Me.OFF))).length??0,a=this.stepSize<1&&0===this.config.decimals?1:0;return Math.max(1,t+e+i+o+a)}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}}Ri.HOLD_MS=500,Ri.DOUBLE_TAP_MS=250,i([pt()],Ri.prototype,"config",void 0),i([pt()],Ri.prototype,"header",void 0),i([pt()],Ri.prototype,"service",void 0),i([pt()],Ri.prototype,"modes",void 0),i([pt()],Ri.prototype,"entity",void 0),i([pt()],Ri.prototype,"entities",void 0),i([pt()],Ri.prototype,"showEntities",void 0),i([pt()],Ri.prototype,"name",void 0),i([pt({type:Object})],Ri.prototype,"_values",void 0),i([pt()],Ri.prototype,"_updatingValues",void 0),i([pt()],Ri.prototype,"_hide",void 0),customElements.get(t)||customElements.define(t,Ri),customElements.get(`${t}-editor`)||customElements.define(`${t}-editor`,Kt),customElements.get(`${t}-group`)||customElements.define(`${t}-group`,Ne),customElements.get(`${t}-group-editor`)||customElements.define(`${t}-group-editor`,de),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 ji=window;ji.customCards=ji.customCards||[],ji.customCards.find(e=>e.type===t)||ji.customCards.push({type:t,name:"Simple Thermostat",preview:!0,description:"A different take on the thermostat card",documentationURL:"https://github.com/Wheemer/simple-thermostat"}),ji.customCards.find(e=>e.type===`${t}-group`)||ji.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){this._updatingValues=!0,this._updatingValuesTimeout&&clearTimeout(this._updatingValuesTimeout),this._updatingValuesTimeout=setTimeout(()=>{this._updatingValues=!1,this._updatingValuesTimeout=null},1e4);const o=i??this._values[e],a=Number(o)+t,{decimals:r}=this.config;this._values={...this._values,[e]:+Ue(a,{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"});vt(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===Fe.OFF||!0===this.config.hide?.setpoint_when_off&&this.entity?.state===Fe.OFF?0:1,o=this.modes?.filter(t=>(!0!==t.hide_when_off||this.entity?.state!==Fe.OFF)&&(t.list??[]).some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===Fe.OFF))).length??0,a=this.footer?.some(({hide_when_off:t})=>!(!0===t&&this.entity?.state===Fe.OFF))?1:0,r=this.stepSize<1&&0===this.config.decimals?1:0;return Math.max(1,t+e+i+o+a+r)}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}}Gi.HOLD_MS=500,Gi.DOUBLE_TAP_MS=250,i([pt()],Gi.prototype,"config",void 0),i([pt()],Gi.prototype,"header",void 0),i([pt()],Gi.prototype,"service",void 0),i([pt()],Gi.prototype,"modes",void 0),i([pt()],Gi.prototype,"entity",void 0),i([pt()],Gi.prototype,"entities",void 0),i([pt()],Gi.prototype,"footer",void 0),i([pt()],Gi.prototype,"showEntities",void 0),i([pt()],Gi.prototype,"name",void 0),i([pt({type:Object})],Gi.prototype,"_values",void 0),i([pt()],Gi.prototype,"_updatingValues",void 0),i([pt()],Gi.prototype,"_hide",void 0),customElements.get(t)||customElements.define(t,Gi),customElements.get(`${t}-editor`)||customElements.define(`${t}-editor`,Xt),customElements.get(`${t}-group`)||customElements.define(`${t}-group`,Pe),customElements.get(`${t}-group-editor`)||customElements.define(`${t}-group-editor`,me),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 qi=window;qi.customCards=qi.customCards||[],qi.customCards.find(e=>e.type===t)||qi.customCards.push({type:t,name:"Simple Thermostat",preview:!0,description:"A different take on the thermostat card",documentationURL:"https://github.com/Wheemer/simple-thermostat"}),qi.customCards.find(e=>e.type===`${t}-group`)||qi.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"});