This commit is contained in:
Home Assistant Version Control committed 2026-08-07 23:51:13 +00:00
1 parent 6956167bd7
commit 832b4b2b73
3 files changed
+100 -92

No files matched your search

@@ -1,4 +1,4 @@
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let n=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const a=this.t;if(t&&void 0===e){const t=void 0!==a&&1===a.length;t&&(e=i.get(a)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&i.set(a,e))}return e}toString(){return this.cssText}};const o=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,a,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[i+1]),e[0]);return new n(i,e,a)},r=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return(e=>new n("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:s,defineProperty:l,getOwnPropertyDescriptor:d,getOwnPropertyNames:_,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,h=globalThis,m=h.trustedTypes,g=m?m.emptyScript:"",p=h.reactiveElementPolyfillSupport,f=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let a=e;switch(t){case Boolean:a=null!==e;break;case Number:a=null===e?null:Number(e);break;case Object:case Array:try{a=JSON.parse(e)}catch(e){a=null}}return a}},v=(e,t)=>!s(e,t),k={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=k){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),i=this.getPropertyDescriptor(e,a,t);void 0!==i&&l(this.prototype,e,i)}}static getPropertyDescriptor(e,t,a){const{get:i,set:n}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const o=i?.call(this);n?.call(this,t),this.requestUpdate(e,o,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const e=this.properties,t=[..._(e),...c(e)];for(const a of t)this.createProperty(a,e[a])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,a]of t)this.elementProperties.set(e,a)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const a=this._$Eu(e,t);void 0!==a&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const e of a)t.unshift(r(e))}else void 0!==e&&t.push(r(e));return t}static _$Eu(e,t){const a=t.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((a,i)=>{if(t)a.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of i){const i=document.createElement("style"),n=e.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,a.appendChild(i)}})(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$ET(e,t){const a=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,a);if(void 0!==i&&!0===a.reflect){const n=(void 0!==a.converter?.toAttribute?a.converter:y).toAttribute(t,a.type);this._$Em=e,null==n?thisLine truncated const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),i=new WeakMap;let n=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const a=this.t;if(t&&void 0===e){const t=void 0!==a&&1===a.length;t&&(e=i.get(a)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&i.set(a,e))}return e}toString(){return this.cssText}};const o=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,a,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[i+1]),e[0]);return new n(i,e,a)},r=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return(e=>new n("string"==typeof e?e:e+"",void 0,a))(t)})(e):e,{is:s,defineProperty:l,getOwnPropertyDescriptor:d,getOwnPropertyNames:_,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,m=globalThis,h=m.trustedTypes,p=h?h.emptyScript:"",g=m.reactiveElementPolyfillSupport,y=(e,t)=>e,v={toAttribute(e,t){switch(t){case Boolean:e=e?p:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let a=e;switch(t){case Boolean:a=null!==e;break;case Number:a=null===e?null:Number(e);break;case Object:case Array:try{a=JSON.parse(e)}catch(e){a=null}}return a}},f=(e,t)=>!s(e,t),k={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let w=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=k){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),i=this.getPropertyDescriptor(e,a,t);void 0!==i&&l(this.prototype,e,i)}}static getPropertyDescriptor(e,t,a){const{get:i,set:n}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const o=i?.call(this);n?.call(this,t),this.requestUpdate(e,o,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[..._(e),...c(e)];for(const a of t)this.createProperty(a,e[a])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,a]of t)this.elementProperties.set(e,a)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const a=this._$Eu(e,t);void 0!==a&&this._$Eh.set(a,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const e of a)t.unshift(r(e))}else void 0!==e&&t.push(r(e));return t}static _$Eu(e,t){const a=t.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((a,i)=>{if(t)a.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of i){const i=document.createElement("style"),n=e.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,a.appendChild(i)}})(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$ET(e,t){const a=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,a);if(void 0!==i&&!0===a.reflect){const n=(void 0!==a.converter?.toAttribute?a.converter:v).toAttribute(t,a.type);this._$Em=e,null==n?thisLine truncated
/* ===== CORE CONTAINER STYLES ===== */ /* ===== CORE CONTAINER STYLES ===== */
:host { :host {
@@ -600,7 +600,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
`;function Ti(e){e.style.opacity="0",e.style.transition=`opacity ${ve}ms ease-out`,setTimeout((()=>{e.parentNode&&(e.parentNode.removeChild(e),Ie("Removed hold indicator"))}),ve)}const zi=1,Di=2,$i=e=>(...t)=>({_$litDirective$:e,values:t});let xi=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,a){this._$Ct=e,this._$AM=t,this._$Ci=a}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const Si=$i(class extends xi{constructor(e){if(super(e),e.type!==zi||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const a=e.element.classList;for(const e of this.st)e in t||(a.remove(e),this.st.delete(e));for(const e in t){const i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(a.add(e),this.st.add(e)):(a.remove(e),this.st.delete(e)))}return N}}),ji="important",Yi=" !"+ji,Li=$i(class extends xi{constructor(e){if(super(e),e.type!==zi||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,a)=>{const i=e[a];return null==i?t:t+`${a=a.includes("-")?a:a.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:a}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?a.removeProperty(e):a[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(Yi);e.includes("-")||t?a.setProperty(e,t?i.slice(0,-11):i,t?ji:""):a[e]=i}}return N}}),{I:Ei}=ae,Ai=()=>document.createComment(""),Hi=(e,t,a)=>{const i=e._$AA.parentNode,n=void 0===t?e._$AB:t._$AA;if(void 0===a){const t=i.insertBefore(Ai(),n),o=i.insertBefore(Ai(),n);a=new Ei(t,o,e,e.options)}else{const t=a._$AB.nextSibling,o=a._$AM,r=o!==e;if(r){let t;a._$AQ?.(e),a._$AM=e,void 0!==a._$AP&&(t=e._$AU)!==o._$AU&&a._$AP(t)}if(t!==n||r){let e=a._$AA;for(;e!==t;){const t=e.nextSibling;i.insertBefore(e,n),e=t}}}return a},Ci=(e,t,a=e)=>(e._$AI(t,a),e),Pi={},Vi=(e,t=Pi)=>e._$AH=t,Oi=e=>{e._$AR(),e._$AA.remove()},Fi=(e,t,a)=>{const i=new Map;for(let n=t;n<=a;n++)i.set(e[n],n);return i},Ii=$i(class extends xi{constructor(e){if(super(e),e.type!==Di)throw Error("repeat() can only be used in text expressions")}dt(e,t,a){let i;void 0===a?a=t:void 0!==t&&(i=t);const n=[],o=[];let r=0;for(const t of e)n[r]=i?i(t,r):r,o[r]=a(t,r),r++;return{values:o,keys:n}}render(e,t,a){return this.dt(e,t,a).values}update(e,[t,a,i]){const n=(e=>e._$AH)(e),{values:o,keys:r}=this.dt(t,a,i);if(!Array.isArray(n))return this.ut=r,o;const s=this.ut??=[],l=[];let d,_,c=0,u=n.length-1,h=0,m=o.length-1;for(;c<=u&&h<=m;)if(null===n[c])c++;else if(null===n[u])u--;else if(s[c]===r[h])l[h]=Ci(n[c],o[h]),c++,h++;else if(s[u]===r[m])l[m]=Ci(n[u],o[m]),u--,m--;else if(s[c]===r[m])l[m]=Ci(n[c],o[m]),Hi(e,l[m+1],n[c]),c++,m--;else if(s[u]===r[h])l[h]=Ci(n[u],o[h]),Hi(e,n[c],n[u]),u--,h++;else if(void 0===d&&(d=Fi(r,h,m),_=Fi(s,c,u)),d.has(s[c]))if(d.has(s[u])){const t=_.get(r[h]),a=void 0!==t?n[t]:null;if(null===a){const t=Hi(e,n[c]);Ci(t,o[h]),l[h]=t}else l[h]=Ci(a,o[h]),Hi(e,n[c],a),n[t]=null;h++}else Oi(n[u]),u--;else Oi(n[c]),c++;for(;h<=m;){const t=Hi(e,l[m+1]);Ci(t,o[h]),l[h++]=t}for(;c<=u;){const e=n[c++];null!==e&&Oi(e)}return this.ut=r,Vi(e,l),N}});function Ni(e,t){const a={};return e&&Array.isArray(e)?(e.forEach((e=>{if(!e.datetime)return;let i,n,o;"hourly"===t?(o=new Date(e.datetime),n=o.getHours(),i=`${Ra(o)}_${n}`):(o=new Date(e.datetime),i=Ra(o));const r=function(e,t){const a=void 0!==t&&(t>=18||t<6);if(a&&Ki[e])return Ki[e];return Wi[e]||"mdi:weather-cloudy-alert"}(e.condition,n);a[i]={icon:r,condition:e.condition,temperature:Math.round(e.temperature),templow:void 0!==e.templow?Math.round(e.templow):void 0,datetime:e.datetime,hour:n,precipitation:e.precipitation,precipitation_probability:e.precipitation_probability,uv_index:void 0!==e.uv_index?Math.round(e.uv_index):void 0}})),a):a}const Wi={"clear-night":"mdi:weather-night",cloudy:"mdi:weather-cloudy",fog:"mdi:weather-fog",hail:"mdi:weather-hail",lightning:"mdi:weather-lightning","lightning-rainy":"mdi:weather-lightning-rainy",partlycloudy:"mdi:weather-partly-cloudy",pouring:"mdi:weather-pouring",rainy:"mdi:weather-rainy",snowy:"mdi:weather-snowy","snowy-rainy":"mdi:weather-snowy-rainy",sunny:"mdi:weather-sunny",windy:"mdi:weather-windy","windy-variant":"mdi:weather-windy-variant",exceptional:"mdi:weather-cloudy-alert"},Ki={sunny:"mdi:weather-night",partlycloudy:"mdi:weather-night-partly-cloudy","lightning-rainy":"mdi Line truncated `;function $i(e){e.style.opacity="0",e.style.transition=`opacity ${fe}ms ease-out`,setTimeout((()=>{e.parentNode&&(e.parentNode.removeChild(e),Ie("Removed hold indicator"))}),fe)}const ji=1,xi=2,Yi=e=>(...t)=>({_$litDirective$:e,values:t});let Li=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,a){this._$Ct=e,this._$AM=t,this._$Ci=a}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const Ei=Yi(class extends Li{constructor(e){if(super(e),e.type!==ji||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const a=e.element.classList;for(const e of this.st)e in t||(a.remove(e),this.st.delete(e));for(const e in t){const i=!!t[e];i===this.st.has(e)||this.nt?.has(e)||(i?(a.add(e),this.st.add(e)):(a.remove(e),this.st.delete(e)))}return N}}),Ai="important",Ci=" !"+Ai,Hi=Yi(class extends Li{constructor(e){if(super(e),e.type!==ji||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,a)=>{const i=e[a];return null==i?t:t+`${a=a.includes("-")?a:a.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:a}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?a.removeProperty(e):a[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(Ci);e.includes("-")||t?a.setProperty(e,t?i.slice(0,-11):i,t?Ai:""):a[e]=i}}return N}}),{I:Pi}=ae,Vi=()=>document.createComment(""),Fi=(e,t,a)=>{const i=e._$AA.parentNode,n=void 0===t?e._$AB:t._$AA;if(void 0===a){const t=i.insertBefore(Vi(),n),o=i.insertBefore(Vi(),n);a=new Pi(t,o,e,e.options)}else{const t=a._$AB.nextSibling,o=a._$AM,r=o!==e;if(r){let t;a._$AQ?.(e),a._$AM=e,void 0!==a._$AP&&(t=e._$AU)!==o._$AU&&a._$AP(t)}if(t!==n||r){let e=a._$AA;for(;e!==t;){const t=e.nextSibling;i.insertBefore(e,n),e=t}}}return a},Oi=(e,t,a=e)=>(e._$AI(t,a),e),Ii={},Ni=(e,t=Ii)=>e._$AH=t,Wi=e=>{e._$AR(),e._$AA.remove()},Ki=(e,t,a)=>{const i=new Map;for(let n=t;n<=a;n++)i.set(e[n],n);return i},Ri=Yi(class extends Li{constructor(e){if(super(e),e.type!==xi)throw Error("repeat() can only be used in text expressions")}dt(e,t,a){let i;void 0===a?a=t:void 0!==t&&(i=t);const n=[],o=[];let r=0;for(const t of e)n[r]=i?i(t,r):r,o[r]=a(t,r),r++;return{values:o,keys:n}}render(e,t,a){return this.dt(e,t,a).values}update(e,[t,a,i]){const n=(e=>e._$AH)(e),{values:o,keys:r}=this.dt(t,a,i);if(!Array.isArray(n))return this.ut=r,o;const s=this.ut??=[],l=[];let d,_,c=0,u=n.length-1,m=0,h=o.length-1;for(;c<=u&&m<=h;)if(null===n[c])c++;else if(null===n[u])u--;else if(s[c]===r[m])l[m]=Oi(n[c],o[m]),c++,m++;else if(s[u]===r[h])l[h]=Oi(n[u],o[h]),u--,h--;else if(s[c]===r[h])l[h]=Oi(n[c],o[h]),Fi(e,l[h+1],n[c]),c++,h--;else if(s[u]===r[m])l[m]=Oi(n[u],o[m]),Fi(e,n[c],n[u]),u--,m++;else if(void 0===d&&(d=Ki(r,m,h),_=Ki(s,c,u)),d.has(s[c]))if(d.has(s[u])){const t=_.get(r[m]),a=void 0!==t?n[t]:null;if(null===a){const t=Fi(e,n[c]);Oi(t,o[m]),l[m]=t}else l[m]=Oi(a,o[m]),Fi(e,n[c],a),n[t]=null;m++}else Wi(n[u]),u--;else Wi(n[c]),c++;for(;m<=h;){const t=Fi(e,l[h+1]);Oi(t,o[m]),l[m++]=t}for(;c<=u;){const e=n[c++];null!==e&&Wi(e)}return this.ut=r,Ni(e,l),N}});function Ui(e,t){const a={};return e&&Array.isArray(e)?(e.forEach((e=>{if(!e.datetime)return;let i,n,o;"hourly"===t?(o=new Date(e.datetime),n=o.getHours(),i=`${Ga(o)}_${n}`):(o=new Date(e.datetime),i=Ga(o));const r=function(e,t){const a=void 0!==t&&(t>=18||t<6);if(a&&Ji[e])return Ji[e];return Bi[e]||"mdi:weather-cloudy-alert"}(e.condition,n);a[i]={icon:r,condition:e.condition,temperature:Math.round(e.temperature),templow:void 0!==e.templow?Math.round(e.templow):void 0,datetime:e.datetime,hour:n,precipitation:e.precipitation,precipitation_probability:e.precipitation_probability,uv_index:void 0!==e.uv_index?Math.round(e.uv_index):void 0}})),a):a}const Bi={"clear-night":"mdi:weather-night",cloudy:"mdi:weather-cloudy",fog:"mdi:weather-fog",hail:"mdi:weather-hail",lightning:"mdi:weather-lightning","lightning-rainy":"mdi:weather-lightning-rainy",partlycloudy:"mdi:weather-partly-cloudy",pouring:"mdi:weather-pouring",rainy:"mdi:weather-rainy",snowy:"mdi:weather-snowy","snowy-rainy":"mdi:weather-snowy-rainy",sunny:"mdi:weather-sunny",windy:"mdi:weather-windy","windy-variant":"mdi:weather-windy-variant",exceptional:"mdi:weather-cloudy-alert"},Ji={sunny:"mdi:weather-night",partlycloudy:"mdi:weather-night-partly-cloudy","lightning-rainy":"mdi Line truncated
<div class="calendar-card"> <div class="calendar-card">
<div class="loading">${a.loading}</div> <div class="loading">${a.loading}</div>
</div> </div>
@@ -608,24 +608,24 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
<div class="calendar-card"> <div class="calendar-card">
<div class="error">${a.error}</div> <div class="error">${a.error}</div>
</div> </div>
`}function Bi(e,t,a,i="day"){const n=parseFloat(a.day_spacing);if("day"===i)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:`${n}px`};let o=we.WEEK;"month"===i&&(o=we.MONTH);const r=n*o;return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:`${r}px`,marginBottom:`${r}px`}}function Ji(e,t,a,i,n=!1,o="day"){if("0px"===e||n)return W;const r=Bi(e,t,i,o);return I`<div class="${a}" style=${Li(r)}></div>`}function Zi(e){return Ji(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function Gi(e,t=!1){return Ji(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function qi(e,t){if(!e.today_indicator||!t)return W;const a=e.today_indicator,i=function(e){if(void 0===e||!1===e)return"none";if(!0===e)return"dot";if("string"==typeof e)return"pulse"===e||"glow"===e?e:mt(e)?"mdi":e.startsWith("/")||e.includes(".png")||e.includes(".jpg")||e.includes(".svg")||e.includes(".webp")||e.includes(".gif")?"image":/[\p{Emoji}]/u.test(e)?"emoji":"dot";return"none"}(a);if("none"===i)return W;const n=function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},a=e.trim().split(/\s+/);return a.length>=1&&(t.left=a[0]),a.length>=2?t.top=a[1]:t.top="50%",t}(e.today_indicator_position);return I` `}function qi(e,t,a,i="day"){const n=parseFloat(a.day_spacing);if("day"===i)return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:"0px",marginBottom:`${n}px`};let o=we.WEEK;"month"===i&&(o=we.MONTH);const r=n*o;return{borderTopWidth:e,borderTopColor:t,borderTopStyle:"solid",marginTop:`${r}px`,marginBottom:`${r}px`}}function Qi(e,t,a,i,n=!1,o="day"){if("0px"===e||n)return W;const r=qi(e,t,i,o);return I`<div class="${a}" style=${Hi(r)}></div>`}function Xi(e){return Qi(e.month_separator_width,e.month_separator_color,"month-separator",e,!1,"month")}function en(e,t=!1){return Qi(e.week_separator_width,e.week_separator_color,"week-separator",e,t,"week")}function tn(e,t){if(!e.today_indicator||!t)return W;const a=e.today_indicator,i=function(e){if(void 0===e||!1===e)return"none";if(!0===e)return"dot";if("string"==typeof e)return"pulse"===e||"glow"===e?e:gt(e)?"mdi":e.startsWith("/")||e.includes(".png")||e.includes(".jpg")||e.includes(".svg")||e.includes(".webp")||e.includes(".gif")?"image":/[\p{Emoji}]/u.test(e)?"emoji":"dot";return"none"}(a);if("none"===i)return W;const n=function(e){const t={position:"absolute",transform:"translate(-50%, -50%)"},a=e.trim().split(/\s+/);return a.length>=1&&(t.left=a[0]),a.length>=2?t.top=a[1]:t.top="50%",t}(e.today_indicator_position);return I`
<div class="today-indicator-container"> <div class="today-indicator-container">
${function(e,t,a){let i="";switch(e){case"dot":case"pulse":case"glow":i="mdi:circle";break;case"mdi":i="string"==typeof t?t:"mdi:circle";break;case"image":return"string"==typeof t?I` ${function(e,t,a){let i="";switch(e){case"dot":case"pulse":case"glow":i="mdi:circle";break;case"mdi":i="string"==typeof t?t:"mdi:circle";break;case"image":return"string"==typeof t?I`
<img <img
src="${t}" src="${t}"
class="today-indicator image" class="today-indicator image"
style=${Li(a)} style=${Hi(a)}
alt="Today"> alt="Today">
</img>`:W;case"emoji":return"string"==typeof t?I` <span class="today-indicator emoji" style=${Li(a)}> </img>`:W;case"emoji":return"string"==typeof t?I` <span class="today-indicator emoji" style=${Hi(a)}>
${t} ${t}
</span>`:W;default:return W}if(i)return I` <ha-icon </span>`:W;default:return W}if(i)return I` <ha-icon
icon="${i}" icon="${i}"
class="today-indicator ${e}" class="today-indicator ${e}"
style=${Li(a)} style=${Hi(a)}
> >
</ha-icon>`;return W}(i,a,n)} </ha-icon>`;return W}(i,a,n)}
</div> </div>
`}function Qi(e,t,a,i,n){var o,r,s,l,d;const _=0===e.getDay()||6===e.getDay();let c=t.weekday_color,u=t.day_color,h=t.month_color;_&&(c=t.weekend_weekday_color||c,u=t.weekend_day_color||u,h=t.weekend_month_color||h),i&&(c=t.today_weekday_color||c,u=t.today_day_color||u,h=t.today_month_color||h);const m=ut(a),g=m.daysOfWeek[e.getDay()],p=e.getDate(),f=m.months[e.getMonth()],y=("date"===(null==(o=t.weather)?void 0:o.position)||"both"===(null==(r=t.weather)?void 0:r.position))&&(null==(s=t.weather)?void 0:s.entity);let v=W;if(y&&(null==n?void 0:n.daily)){const a=function(e,t){if(!t)return;return t[Ra(e)]}(e,n.daily);if(a){const e=(null==(l=t.weather)?void 0:l.date)||{},i=!1!==e.show_conditions,n=!1!==e.show_high_temp,o=!0===e.show_uv_index&&void 0!==a.uv_index&&a.uv_index>=(null!=(d=e.uv_index_threshold)?d:0),r=!0===e.show_low_temp&&!o&&void 0!==a.templow,s=e.icon_size||"14px",_=e.font_size||"12px",c=e.color||"var(--primary-text-color)";v=I` `}function an(e,t,a,i,n){var o,r,s,l,d;const _=0===e.getDay()||6===e.getDay();let c=t.weekday_color,u=t.day_color,m=t.month_color;_&&(c=t.weekend_weekday_color||c,u=t.weekend_day_color||u,m=t.weekend_month_color||m),i&&(c=t.today_weekday_color||c,u=t.today_day_color||u,m=t.today_month_color||m);const h=ht(a),p=h.daysOfWeek[e.getDay()],g=e.getDate(),y=h.months[e.getMonth()],v=("date"===(null==(o=t.weather)?void 0:o.position)||"both"===(null==(r=t.weather)?void 0:r.position))&&(null==(s=t.weather)?void 0:s.entity);let f=W;if(v&&(null==n?void 0:n.daily)){const a=function(e,t){if(!t)return;return t[Ga(e)]}(e,n.daily);if(a){const e=(null==(l=t.weather)?void 0:l.date)||{},i=!1!==e.show_conditions,n=!1!==e.show_high_temp,o=!0===e.show_uv_index&&void 0!==a.uv_index&&a.uv_index>=(null!=(d=e.uv_index_threshold)?d:0),r=!0===e.show_low_temp&&!o&&void 0!==a.templow,s=e.icon_size||"14px",_=e.font_size||"12px",c=e.color||"var(--primary-text-color)";f=I`
<div class="weather" style="font-size: ${_}; color: ${c};"> <div class="weather" style="font-size: ${_}; color: ${c};">
${i?I` ${i?I`
<ha-icon <ha-icon
@@ -640,31 +640,31 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
`}}return I` `}}return I`
<div <div
class="weekday" class="weekday"
style=${Li({"font-size":t.weekday_font_size,color:c})} style=${Hi({"font-size":t.weekday_font_size,color:c})}
> >
${g} ${p}
</div> </div>
<div <div
class="day" class="day"
style=${Li({"font-size":t.day_font_size,color:u})} style=${Hi({"font-size":t.day_font_size,color:u})}
> >
${p} ${g}
</div> </div>
${t.show_month?I` ${t.show_month?I`
<div <div
class="month" class="month"
style=${Li({"font-size":t.month_font_size,color:h})} style=${Hi({"font-size":t.month_font_size,color:m})}
> >
${f} ${y}
</div> </div>
`:W} `:W}
${v} ${f}
`}function Xi(e,t,a,i,n,o,r){const s=new Date,l=new Date(s.getFullYear(),s.getMonth(),s.getDate()),d=new Date(e.timestamp).toDateString(),_=d===l.toDateString(),c=new Date(l);c.setDate(c.getDate()+1);const u=d===c.toDateString();let h=W;const m=(null==n?void 0:n.isNewMonth)||!1,g=(null==n?void 0:n.isNewWeek)||!1,p=m&&"0px"!==t.month_separator_width,f=g&&(null!==t.show_week_numbers||"0px"!==t.week_separator_width),y=t.day_separator_width,v=t.day_separator_color;if(i&&"0px"!==y&&!p&&!f){const e=Bi(y,v,t,"day");h=I`<div class="separator" style=${Li(e)}></div>`}return I` `}function nn(e,t,a,i,n,o,r){const s=new Date,l=new Date(s.getFullYear(),s.getMonth(),s.getDate()),d=new Date(e.timestamp).toDateString(),_=d===l.toDateString(),c=new Date(l);c.setDate(c.getDate()+1);const u=d===c.toDateString();let m=W;const h=(null==n?void 0:n.isNewMonth)||!1,p=(null==n?void 0:n.isNewWeek)||!1,g=h&&"0px"!==t.month_separator_width,y=p&&(null!==t.show_week_numbers||"0px"!==t.week_separator_width),v=t.day_separator_width,f=t.day_separator_color;if(i&&"0px"!==v&&!g&&!y){const e=qi(v,f,t,"day");m=I`<div class="separator" style=${Hi(e)}></div>`}return I`
${h} ${m}
<table <table
class=${Si({"day-table":!0,today:_,tomorrow:u,"future-day":!_})} class=${Ei({"day-table":!0,today:_,tomorrow:u,"future-day":!_})}
> >
${Ii(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((i,n)=>function(e,t,a,i,n,o,r,s){var l;const d=Boolean(e._isEmptyDay),_=new Date(t.timestamp),c=function(e){const t=e.getDay();return 0===t||6===t}(_),u=new Date,h=new Date(u.getFullYear(),u.getMonth(),u.getDate()),m=new Date(h);m.setDate(m.getDate()+1);let g=!1;if(!d){if(!e.start.dateTime){let t=e.end.date?Ua(e.end.date):null;if(t){const e=new Date(t);e.setDate(e.getDate()-1),t=e}g=null!==t&&h>t}else{const t=e.end.dateTime?new Date(e.end.dateTime):null;g=null!==t&&u>t}}const p=hi(e._entityId,i,void 0,e),f=i.event_background_opacity>0?i.event_background_opacity:0,y=f>0?hi(e._entityId,i,f,e):"",v=null!=(l=gi(e._entityId,"show_time",i,e))?l:i.show_time,k=!e.start.dateTime,w=k&&e.time&&(e.time.includes(ut(n).multiDay)||e.time.includes(ut(n).endsTomorrow)||e.time.includes(ut(n).endsToday)),b=v&&!(k&&!w&&!i.show_single_allday_time)&&!d;let M=null;!i.show_countdown||d||g||(M=Ia(e,n));const T=pi(e),z=T&&i.show_progress_bar?function(e){if(!pi(e))return null;const t=new Date,a=new Date(e.start.dateTime),i=new Date(e.end.dateTime).getTime()-a.getTime(),n=t.getTime()-a.getTime();return Math.min(100,Math.max(0,Math.floor(n/i*100)))}(e):null,D=Fa(e,i,n,s),$=e.location||"",x=e.description||"",S=0===a,j=a===t.events.length-1,Y={event:!0,"event-first":S,"event-middle":!S&&!j,"event-last":j,"past-event":g};return I` ${Ri(e.events,((e,t)=>`${e._entityId}-${e.summary}-${t}`),((i,n)=>function(e,t,a,i,n,o,r,s){var l;const d=Boolean(e._isEmptyDay),_=new Date(t.timestamp),c=function(e){const t=e.getDay();return 0===t||6===t}(_),u=new Date,m=new Date(u.getFullYear(),u.getMonth(),u.getDate()),h=new Date(m);h.setDate(h.getDate()+1);let p=!1;if(!d){if(!e.start.dateTime){let t=e.end.date?Za(e.end.date):null;if(t){const e=new Date(t);e.setDate(e.getDate()-1),t=e}p=null!==t&&m>t}else{const t=e.end.dateTime?new Date(e.end.dateTime):null;p=null!==t&&u>t}}const g=yi(e._entityId,i,void 0,e),y=i.event_background_opacity>0?i.event_background_opacity:0,v=y>0?yi(e._entityId,i,y,e):"",f=null!=(l=fi(e._entityId,"show_time",i,e))?l:i.show_time,k=!e.start.dateTime,w=k&&e.time&&(e.time.includes(ht(n).multiDay)||e.time.includes(ht(n).endsTomorrow)||e.time.includes(ht(n).endsToday)),b=f&&!(k&&!w&&!i.show_single_allday_time)&&!d;let M=null;!i.show_countdown||d||p||(M=Ra(e,n));const z=ki(e),T=z&&i.show_progress_bar?function(e){if(!ki(e))return null;const t=new Date,a=new Date(e.start.dateTime),i=new Date(e.end.dateTime).getTime()-a.getTime(),n=t.getTime()-a.getTime();return Math.min(100,Math.max(0,Math.floor(n/i*100)))}(e):null,D=Ka(e,i,n,s),S=e.location||"",$=e.description||"",j=0===a,x=a===t.events.length-1,Y={event:!0,"event-first":j,"event-middle":!j&&!x,"event-last":x,"past-event":p};return I`
<tr> <tr>
${0===a?I` ${0===a?I`
<td <td
@@ -672,19 +672,19 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
rowspan="${t.events.length}" rowspan="${t.events.length}"
style="position: relative;" style="position: relative;"
> >
${Qi(_,i,n,o,r)} ${an(_,i,n,o,r)}
${qi(i,o)} ${tn(i,o)}
</td> </td>
`:""} `:""}
<td <td
class=${Si(Y)} class=${Ei(Y)}
style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${p}; background-color: ${y};" style="border-inline-start: var(--calendar-card-line-width-vertical) solid ${g}; background-color: ${v};"
> >
<div class="event-content"> <div class="event-content">
${function(e,t,a){var i,n;const o=!!e._isEmptyDay,r=o?"var(--calendar-card-empty-day-color)":(null==(i=e._matchedConfig)?void 0:i.color)||t.event_color,s=mi(e._entityId,t,e),l=null==(n=e._matchedConfig)?void 0:n.label_icon_color;return I` ${function(e,t,a){var i,n;const o=!!e._isEmptyDay,r=o?"var(--calendar-card-empty-day-color)":(null==(i=e._matchedConfig)?void 0:i.color)||t.event_color,s=vi(e._entityId,t,e),l=null==(n=e._matchedConfig)?void 0:n.label_icon_color;return I`
<div class="summary-row"> <div class="summary-row">
<div class="summary"> <div class="summary">
${s?function(e,t){if(!e)return W;const a=t?`color: ${t};`:W;return mt(e)?I`<ha-icon icon="${e}" class="label-icon" style=${a}></ha-icon>`:e.startsWith("/local/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(e)?I`<img src="${e}" class="label-image"></img>`:I`<span class="calendar-label">${e}</span>`}(s,l):W} ${s?function(e,t){if(!e)return W;const a=t?`color: ${t};`:W;return gt(e)?I`<ha-icon icon="${e}" class="label-icon" style=${a}></ha-icon>`:e.startsWith("/local/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(e)?I`<img src="${e}" class="label-image"></img>`:I`<span class="calendar-label">${e}</span>`}(s,l):W}
<span <span
class="event-title ${o?"empty-day-title":""}" class="event-title ${o?"empty-day-title":""}"
style="color: ${r}" style="color: ${r}"
@@ -692,13 +692,13 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
${o?`✓ ${e.summary}`:e.summary} ${o?`✓ ${e.summary}`:e.summary}
</span> </span>
</div> </div>
${function(e,t,a){var i,n,o,r;const s=(null==(i=t.weather)?void 0:i.entity)&&("event"===t.weather.position||"both"===t.weather.position);if(!s||!(null==a?void 0:a.hourly))return I``;if(null==(n=e.end)?void 0:n.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return I``}const l=function(e,t,a){if(e.start.date&&!e.start.dateTime&&a)return a[Ra(Ua(e.start.date))];if(!e.start.dateTime||!t)return;const i=new Date(e.start.dateTime),n=Ra(i),o=i.getHours(),r=t[`${n}_${o}`];if(r)return r;let s=-1,l=24;return Object.keys(t).forEach((e=>{if(e.startsWith(n)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<l&&(l=e,s=a)}}})),s>=0?t[`${n}_${s}`]:void 0}(e,a.hourly,a.daily);if(!l)return I``;const d=(null==(o=t.weather)?void 0:o.event)||{},_=!1!==d.show_conditions,c=!1!==d.show_temp,u=!0===d.show_uv_index&&void 0!==l.uv_index&&l.uv_index>=(null!=(r=d.uv_index_threshold)?r:0),h=d.icon_size||"14px",m=d.font_size||"12px",g=d.color||"var(--secondary-text-color)";return I` ${function(e,t,a){var i,n,o,r;const s=(null==(i=t.weather)?void 0:i.entity)&&("event"===t.weather.position||"both"===t.weather.position);if(!s||!(null==a?void 0:a.hourly))return I``;if(null==(n=e.end)?void 0:n.dateTime){const t=new Date;if(new Date(e.end.dateTime)<t)return I``}const l=function(e,t,a){if(e.start.date&&!e.start.dateTime&&a)return a[Ga(Za(e.start.date))];if(!e.start.dateTime||!t)return;const i=new Date(e.start.dateTime),n=Ga(i),o=i.getHours(),r=t[`${n}_${o}`];if(r)return r;let s=-1,l=24;return Object.keys(t).forEach((e=>{if(e.startsWith(n)){const t=e.split("_")[1],a=parseInt(t);if(!isNaN(a)){const e=Math.abs(a-o);e<l&&(l=e,s=a)}}})),s>=0?t[`${n}_${s}`]:void 0}(e,a.hourly,a.daily);if(!l)return I``;const d=(null==(o=t.weather)?void 0:o.event)||{},_=!1!==d.show_conditions,c=!1!==d.show_temp,u=!0===d.show_uv_index&&void 0!==l.uv_index&&l.uv_index>=(null!=(r=d.uv_index_threshold)?r:0),m=d.icon_size||"14px",h=d.font_size||"12px",p=d.color||"var(--secondary-text-color)";return I`
<div class="event-weather"> <div class="event-weather">
${_?I`<ha-icon .icon=${l.icon} style="--mdc-icon-size: ${h};"></ha-icon>`:W} ${_?I`<ha-icon .icon=${l.icon} style="--mdc-icon-size: ${m};"></ha-icon>`:W}
${c?I`<span style="font-size: ${m}; color: ${g};"> ${c?I`<span style="font-size: ${h}; color: ${p};">
${l.temperature}° ${l.temperature}°
</span>`:W} </span>`:W}
${u?I`<span class="weather-uv-index" style="font-size: ${m}; color: ${g};"> ${u?I`<span class="weather-uv-index" style="font-size: ${h}; color: ${p};">
UV${l.uv_index} UV${l.uv_index}
</span>`:W} </span>`:W}
</div> </div>
@@ -712,11 +712,11 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
<ha-icon icon="mdi:clock-outline"></ha-icon> <ha-icon icon="mdi:clock-outline"></ha-icon>
<span>${D}</span> <span>${D}</span>
</div> </div>
${M?I`<div class="time-countdown">${M}</div>`:null!==z&&i.show_progress_bar?I` ${M?I`<div class="time-countdown">${M}</div>`:null!==T&&i.show_progress_bar?I`
<div class="progress-bar"> <div class="progress-bar">
<div <div
class="progress-bar-filled" class="progress-bar-filled"
style="width: ${z}%" style="width: ${T}%"
></div> ></div>
</div> </div>
`:W} `:W}
@@ -726,27 +726,27 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
<div class="time-actual"></div> <div class="time-actual"></div>
<div class="time-countdown">${M}</div> <div class="time-countdown">${M}</div>
</div> </div>
`:null!==z&&i.show_progress_bar?I` `:null!==T&&i.show_progress_bar?I`
<div class="time"> <div class="time">
<div class="time-actual"></div> <div class="time-actual"></div>
<div class="progress-bar"> <div class="progress-bar">
<div <div
class="progress-bar-filled" class="progress-bar-filled"
style="width: ${z}%" style="width: ${T}%"
></div> ></div>
</div> </div>
</div> </div>
`:W} `:W}
${$?I` ${S?I`
<div class="location"> <div class="location">
<ha-icon icon="mdi:map-marker-outline"></ha-icon> <ha-icon icon="mdi:map-marker-outline"></ha-icon>
<span>${$}</span> <span>${S}</span>
</div> </div>
`:""} `:""}
${x?I` ${$?I`
<div class="description"> <div class="description">
<ha-icon icon="mdi:information-outline"></ha-icon> <ha-icon icon="mdi:information-outline"></ha-icon>
<span>${x}</span> <span>${$}</span>
</div> </div>
`:""} `:""}
</div> </div>
@@ -755,23 +755,23 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
</tr> </tr>
`}(i,e,n,t,a,_,o,r)))} `}(i,e,n,t,a,_,o,r)))}
</table> </table>
`}function en(e,t,a,i,n){return I` `}function on(e,t,a,i,n){return I`
${e.map(((o,r)=>{var s;const l=r>0?e[r-1]:void 0,d=null!=(s=o.weekNumber)?s:null;let _=!1;if(l){_=o.weekNumber!==l.weekNumber}else _=!0;const c=l&&o.monthNumber!==l.monthNumber,u=0===r,h={isNewWeek:_,isNewMonth:Boolean(c)};let m=W;return!c||"0px"===t.month_separator_width||_&&null!==t.show_week_numbers?_&&(m=u&&null!==t.show_week_numbers&&!t.show_current_week_number?c?Zi(t):Gi(t,u):null!==t.show_week_numbers?function(e,t,a,i=!1){if(null===e)return W;const n=parseFloat(a.day_spacing),o=n*(t?we.MONTH:we.WEEK)/2,r={marginTop:(i?0:o-n)+"px",marginBottom:`${o}px`},s={};return i?s["--separator-display"]="none":t&&"0px"!==a.month_separator_width?(s["--separator-border-width"]=a.month_separator_width,s["--separator-border-color"]=a.month_separator_color,s["--separator-display"]="block"):"0px"!==a.week_separator_width?(s["--separator-border-width"]=a.week_separator_width,s["--separator-border-color"]=a.week_separator_color,s["--separator-display"]="block"):s["--separator-display"]="none",I` ${e.map(((o,r)=>{var s;const l=r>0?e[r-1]:void 0,d=null!=(s=o.weekNumber)?s:null;let _=!1;if(l){_=o.weekNumber!==l.weekNumber}else _=!0;const c=l&&o.monthNumber!==l.monthNumber,u=0===r,m={isNewWeek:_,isNewMonth:Boolean(c)};let h=W;return!c||"0px"===t.month_separator_width||_&&null!==t.show_week_numbers?_&&(h=u&&null!==t.show_week_numbers&&!t.show_current_week_number?c?Xi(t):en(t,u):null!==t.show_week_numbers?function(e,t,a,i=!1){if(null===e)return W;const n=parseFloat(a.day_spacing),o=n*(t?we.MONTH:we.WEEK)/2,r={marginTop:(i?0:o-n)+"px",marginBottom:`${o}px`},s={};return i?s["--separator-display"]="none":t&&"0px"!==a.month_separator_width?(s["--separator-border-width"]=a.month_separator_width,s["--separator-border-color"]=a.month_separator_color,s["--separator-display"]="block"):"0px"!==a.week_separator_width?(s["--separator-border-width"]=a.week_separator_width,s["--separator-border-color"]=a.week_separator_color,s["--separator-display"]="block"):s["--separator-display"]="none",I`
<table class="week-row-table" style=${Li(r)}> <table class="week-row-table" style=${Hi(r)}>
<tr> <tr>
<td class="week-number-cell"> <td class="week-number-cell">
<div class="week-number">${e}</div> <div class="week-number">${e}</div>
</td> </td>
<td class="separator-cell" style=${Li(s)}> <td class="separator-cell" style=${Hi(s)}>
<div class="separator-line"></div> <div class="separator-line"></div>
</td> </td>
</tr> </tr>
</table> </table>
`}(d,Boolean(c),t,u):Gi(t,u)):m=Zi(t),I` `}(d,Boolean(c),t,u):en(t,u)):h=Xi(t),I`
${m} ${h}
${Xi(o,t,a,l,h,i,n)} ${nn(o,t,a,l,m,i,n)}
`}))} `}))}
`}var tn=o` `}const rn=Symbol.for(""),sn=e=>{if(e?.r===rn)return e?._$litStatic$},ln=(e,...t)=>({_$litStatic$:t.reduce(((t,a,i)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(a)+e[i+1]),e[0]),r:rn}),dn=new Map,_n=(e=>(t,...a)=>{const i=a.length;let n,o;const r=[],s=[];let l,d=0,_=!1;for(;d<i;){for(l=t[d];d<i&&void 0!==(o=a[d],n=sn(o));)l+=n+t[++d],_=!0;d!==i&&s.push(o),r.push(l),d++}if(d===i&&r.push(t[i]),_){const e=r.join("$$lit$$");void 0===(t=dn.get(e))&&(r.raw=r,dn.set(e,t=r)),a=s}return e(t,...a)})(I);var cn=o`
ha-textfield, ha-textfield,
ha-select, ha-select,
ha-formfield, ha-formfield,
@@ -781,6 +781,14 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
margin: 8px 0; margin: 8px 0;
} }
/*
* ha-input (HA 2026.4+) replaces ha-textfield. It is display: flex with its
* own vertical padding, so it only needs an explicit width to fill the editor.
*/
ha-input {
width: 100%;
}
.card-config { .card-config {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -885,7 +893,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
.date-field input[type='date']:hover { .date-field input[type='date']:hover {
border-bottom-color: var(--primary-text-color); border-bottom-color: var(--primary-text-color);
} }
`,an=Object.defineProperty,nn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,sn=(e,t,a)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ln=(e,t)=>{for(var a in t||(t={}))on.call(t,a)&&sn(e,a,t[a]);if(nn)for(var a of nn(t))rn.call(t,a)&&sn(e,a,t[a]);return e},dn=(e,t,a,i)=>{for(var n,o=void 0,r=e.length-1;r>=0;r--)(n=e[r])&&(o=n(t,a,o)||o);return o&&an(t,a,o),o};const _n={max_events_to_show:"compact_events_to_show",vertical_line_color:"accent_color",horizontal_line_width:"day_separator_width",horizontal_line_color:"day_separator_color"},cn={max_events_to_show:"compact_events_to_show"};class un extends oe{static get styles(){return tn}connectedCallback(){super.connectedCallback(),this._loadCustomElements()}async _loadCustomElements(){if(!customElements.get("ha-entity-picker"))try{const e=customElements.get("hui-entities-card");e&&"function"==typeof e.getConfigElement?await e.getConfigElement():console.warn("Could not load ha-entity-picker: getConfigElement not available")}catch(e){console.warn("Could not load ha-entity-picker",e)}}setConfig(e){this._config=ln(ln({},Ke),e)}getConfigValue(e,t){var a;if(!this._config)return t;if(!e.includes(".")){let i=null!=(a=this._config[e])?a:t;if("time_24h"===e){if(!0===i)return"true";if(!1===i)return"false"}return i}const i=e.split(".");let n=this._config;for(const e of i){if(null==n)return t;if(/^\d+$/.test(e)){const a=parseInt(e,10);if(Array.isArray(n)&&a>=0&&a<n.length){n=n[a];continue}return t}if("object"!=typeof n||null===n||!(e in n))return t;n=n[e]}return null!=n?n:t}setConfigValue(e,t){if(!this._config)return;"time_24h"===e&&("true"===t?t=!0:"false"===t&&(t=!1));const a=JSON.parse(JSON.stringify(this._config));if(!e.includes("."))return void 0===t?delete a[e]:a[e]=t,void this._fireConfigChanged(a);const i=e.split("."),n=i.pop();let o=a;for(const e of i)if(/^\d+$/.test(e)){const t=parseInt(e,10);for(Array.isArray(o)||(o=[]);o.length<=t;)o.push({});o[t]&&"object"==typeof o[t]||(o[t]={}),o=o[t]}else Object.prototype.hasOwnProperty.call(o,e)&&"object"==typeof o[e]||(o[e]={}),o=o[e];void 0===t?delete o[n]:o[n]=t,this._fireConfigChanged(a)}_fireConfigChanged(e){const t=yt(e,Ke);this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:t}}))}_findDeprecatedParams(e){return Object.keys(_n).filter((t=>t in e))}_findDeprecatedEntityParams(e){const t=[];return e.forEach(((e,a)=>{"object"==typeof e&&null!==e&&Object.keys(cn).forEach((i=>{i in e&&t.push({index:a,param:i})}))})),t}_upgradeConfig(){const e=ln({},this._config);let t=!1;for(const[a,i]of Object.entries(_n))a in e&&(e[i]=e[a],delete e[a],t=!0);Array.isArray(e.entities)&&(e.entities=e.entities.map((e=>{if("object"==typeof e&&null!==e){const a=ln({},e);for(const[e,i]of Object.entries(cn))e in a&&(a[i]=a[e],delete a[e],t=!0);return a}return e}))),t&&this._fireConfigChanged(e)}_getTranslation(e){var t,a,i;const n=(null==(t=this._config)?void 0:t.language)||(null==(i=null==(a=this.hass)?void 0:a.locale)?void 0:i.language)||"en",o=e.includes(".")?e:`editor.${e}`;return function(e,t,a){const i=ut(e);if("string"==typeof t&&t.includes(".")){const[e,n]=t.split(".");if("editor"===e&&i.editor&&n in i.editor){const e=i.editor[n];if("string"==typeof e||Array.isArray(e))return e}return void 0!==a?a:n}if(t in i){const e=i[t];if("string"==typeof e||Array.isArray(e))return e}return void 0!==a?a:t}(o.startsWith("editor.")&&!function(e){const t=ut(e);return Boolean((null==t?void 0:t.editor)&&Object.keys(t.editor).length>0)}(n)?"en":n,o,e)}_valueChanged(e){if(!e.target)return;e.stopPropagation();const t=e.target,a=t.getAttribute("name");let i=t.value;if(a)if("language_mode"!==a){if("height_mode"===a){const e=t.value,a=this.getConfigValue("height"),i=this.getConfigValue("max_height");return this.setConfigValue("height",void 0),this.setConfigValue("max_height",void 0),void("fixed"===e?this.setConfigValue("height",a&&"auto"!==a?a:"300px"):"maximum"===e&&this.setConfigValue("max_height",i&&"none"!==i?i:"300px"))}if("start_date_mode"!==a){if("start_date_fixed"===a||"start_date_offset"===a){if("start_date_offset"===a&&"keyup"===e.type)return;return this.setConfigValue("start_date",t.value),void this.requestUpdate()}"remove_location_country_selector"!==a&&("show_week_numbers"===a&&"null"===i&&(i=null),"HA-SWITCH"===t.tagName&&(i=t.checked),"number"===t.getAttribute("type")&&""!==i&&(i=parseFloat(i)),this.setConfigValue(a,i))}else this._handleStartDateModeChange(t.value)}else{const e=t.value;"system"===e?this.setConfigValue("language",void 0):"custom"===e&&(this.getConfigValue("language")||this.setConfigValue("language","en"))}}_selectChanged(e){var t,a;if(!e.target)return;e.stopPropagation();const i=e.target.getAttribute("name"),n=null!=(a=null==(t=e.detail)?void 0:t.value)?a:void 0;if(i)if("language_mode"!==i){if("height_mode"===i){const e=this.getConfigValue("height"),t=this.getConfigValue("max_height");return this.setConfigValue("he Line truncated `,un=Object.defineProperty,mn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,gn=(e,t,a)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,yn=(e,t)=>{for(var a in t||(t={}))hn.call(t,a)&&gn(e,a,t[a]);if(mn)for(var a of mn(t))pn.call(t,a)&&gn(e,a,t[a]);return e},vn=(e,t,a,i)=>{for(var n,o=void 0,r=e.length-1;r>=0;r--)(n=e[r])&&(o=n(t,a,o)||o);return o&&un(t,a,o),o};let fn;function kn(){if(void 0!==fn)return fn;if(customElements.get("ha-input"))fn=ln`ha-input`;else{if(!customElements.get("ha-textfield"))return ln`ha-input`;fn=ln`ha-textfield`}return fn}const wn={max_events_to_show:"compact_events_to_show",vertical_line_color:"accent_color",horizontal_line_width:"day_separator_width",horizontal_line_color:"day_separator_color"},bn={max_events_to_show:"compact_events_to_show"};class Mn extends oe{static get styles(){return cn}connectedCallback(){super.connectedCallback(),this._loadCustomElements()}async _loadCustomElements(){if(!customElements.get("ha-entity-picker"))try{const e=customElements.get("hui-entities-card");e&&"function"==typeof e.getConfigElement?await e.getConfigElement():console.warn("Could not load ha-entity-picker: getConfigElement not available")}catch(e){console.warn("Could not load ha-entity-picker",e)}}setConfig(e){this._config=yn(yn({},Ke),e)}getConfigValue(e,t){var a;if(!this._config)return t;if(!e.includes(".")){let i=null!=(a=this._config[e])?a:t;if("time_24h"===e){if(!0===i)return"true";if(!1===i)return"false"}return i}const i=e.split(".");let n=this._config;for(const e of i){if(null==n)return t;if(/^\d+$/.test(e)){const a=parseInt(e,10);if(Array.isArray(n)&&a>=0&&a<n.length){n=n[a];continue}return t}if("object"!=typeof n||null===n||!(e in n))return t;n=n[e]}return null!=n?n:t}setConfigValue(e,t){if(!this._config)return;"time_24h"===e&&("true"===t?t=!0:"false"===t&&(t=!1));const a=JSON.parse(JSON.stringify(this._config));if(!e.includes("."))return void 0===t?delete a[e]:a[e]=t,void this._fireConfigChanged(a);const i=e.split("."),n=i.pop();let o=a;for(const e of i)if(/^\d+$/.test(e)){const t=parseInt(e,10);for(Array.isArray(o)||(o=[]);o.length<=t;)o.push({});o[t]&&"object"==typeof o[t]||(o[t]={}),o=o[t]}else Object.prototype.hasOwnProperty.call(o,e)&&"object"==typeof o[e]||(o[e]={}),o=o[e];void 0===t?delete o[n]:o[n]=t,this._fireConfigChanged(a)}_fireConfigChanged(e){const t=kt(e,Ke);this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:t}}))}_findDeprecatedParams(e){return Object.keys(wn).filter((t=>t in e))}_findDeprecatedEntityParams(e){const t=[];return e.forEach(((e,a)=>{"object"==typeof e&&null!==e&&Object.keys(bn).forEach((i=>{i in e&&t.push({index:a,param:i})}))})),t}_upgradeConfig(){const e=yn({},this._config);let t=!1;for(const[a,i]of Object.entries(wn))a in e&&(e[i]=e[a],delete e[a],t=!0);Array.isArray(e.entities)&&(e.entities=e.entities.map((e=>{if("object"==typeof e&&null!==e){const a=yn({},e);for(const[e,i]of Object.entries(bn))e in a&&(a[i]=a[e],delete a[e],t=!0);return a}return e}))),t&&this._fireConfigChanged(e)}_getTranslation(e){var t,a,i;const n=(null==(t=this._config)?void 0:t.language)||(null==(i=null==(a=this.hass)?void 0:a.locale)?void 0:i.language)||"en",o=e.includes(".")?e:`editor.${e}`;return function(e,t,a){const i=ht(e);if("string"==typeof t&&t.includes(".")){const[e,n]=t.split(".");if("editor"===e&&i.editor&&n in i.editor){const e=i.editor[n];if("string"==typeof e||Array.isArray(e))return e}return void 0!==a?a:n}if(t in i){const e=i[t];if("string"==typeof e||Array.isArray(e))return e}return void 0!==a?a:t}(o.startsWith("editor.")&&!function(e){const t=ht(e);return Boolean((null==t?void 0:t.editor)&&Object.keys(t.editor).length>0)}(n)?"en":n,o,e)}_valueChanged(e){if(!e.target)return;e.stopPropagation();const t=e.target,a=t.getAttribute("name");let i=t.value;if(a)if("language_mode"!==a){if("height_mode"===a){const e=t.value,a=this.getConfigValue("height"),i=this.getConfigValue("max_height");return this.setConfigValue("height",void 0),this.setConfigValue("max_height",void 0),void("fixed"===e?this.setConfigValue("height",a&&"auto"!==a?a:"300px"):"maximum"===e&&this.setConfigValue("max_height",i&&"none"!==i?i:"300px"))}if("start_date_mode"!==a){if("start_date_fixed"===a||"start_date_offset"===a){if("start_date_offset"===a&&"change"!==e.type)return;return this.setConfigValue("start_date",t.value),void this.requestUpdate()}"remove_location_country_selector"!==a&&("show_week_numbers"===a&&"null"===i&&(i=null),"HA-SWITCH"===t.tagName&&(i=t.checked),"number"===t.getAttribute("type")&&""!==i&&(i=parseFloat(i)),this.setConfigValue(a,i))}else this._handleStartDateModeChange(t.value)}else{const e=t.value;"system"===e?this.setConfigValue("language",void 0):"custom"===e&&(this.getConfigValue("language")||this.setConfigValue("language","en"))}}_selectChanged(e){var t,a;if(!e.target)return;e.stopPropagation();const i=e.target.getAttribute("name"),n=null!=(a=null==(t Line truncated
<div style="border-radius: 8px; overflow: hidden;"> <div style="border-radius: 8px; overflow: hidden;">
<ha-alert alert-type="warning"> <ha-alert alert-type="warning">
<div style="height: 6px"></div> <div style="height: 6px"></div>
@@ -1098,16 +1106,16 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
${this.addTextField("location_color",this._getTranslation("location_color"))} ${this.addTextField("location_color",this._getTranslation("location_color"))}
${this.addTextField("location_icon_size",this._getTranslation("location_icon_size"))} ${this.addTextField("location_icon_size",this._getTranslation("location_icon_size"))}
${this.addSelectField("remove_location_country_selector",this._getTranslation("remove_location_country"),[{value:"false",label:this._getTranslation("none")},{value:"true",label:this._getTranslation("simple")},{value:"custom",label:this._getTranslation("custom")}],!1,(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country"))return"false";const e=this._config.remove_location_country;return!0===e||"true"===e?"true":!1===e||"false"===e?"false":"string"==typeof e?"custom":"false"})(),(e=>{"true"===e?this.setConfigValue("remove_location_country",!0):"false"===e?this.setConfigValue("remove_location_country",!1):"custom"===e&&this._config&&"custom"!==this._config.remove_location_country&&"string"!=typeof this._config.remove_location_country&&this.setConfigValue("remove_location_country","USA|United States|Canada")}))} ${this.addSelectField("remove_location_country_selector",this._getTranslation("remove_location_country"),[{value:"false",label:this._getTranslation("none")},{value:"true",label:this._getTranslation("simple")},{value:"custom",label:this._getTranslation("custom")}],!1,(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country"))return"false";const e=this._config.remove_location_country;return!0===e||"true"===e?"true":!1===e||"false"===e?"false":"string"==typeof e?"custom":"false"})(),(e=>{"true"===e?this.setConfigValue("remove_location_country",!0):"false"===e?this.setConfigValue("remove_location_country",!1):"custom"===e&&this._config&&"custom"!==this._config.remove_location_country&&"string"!=typeof this._config.remove_location_country&&this.setConfigValue("remove_location_country","USA|United States|Canada")}))}
${(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country")||!0===this._config.remove_location_country||!1===this._config.remove_location_country||"true"===this._config.remove_location_country||"false"===this._config.remove_location_country)return I``;const e=this._config.remove_location_country;return"string"==typeof e&&"true"!==e&&"false"!==e?I` ${(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country")||!0===this._config.remove_location_country||!1===this._config.remove_location_country||"true"===this._config.remove_location_country||"false"===this._config.remove_location_country)return I``;const e=this._config.remove_location_country;if("string"==typeof e&&"true"!==e&&"false"!==e){const t=kn();return _n`
<ha-textfield <${t}
label="${this._getTranslation("custom_country_pattern")}" label="${this._getTranslation("custom_country_pattern")}"
.value="${e}" .value="${e}"
@change="${e=>this.setConfigValue("remove_location_country",e.target.value)}" @change="${e=>this.setConfigValue("remove_location_country",e.target.value)}"
></ha-textfield> ></${t}>
<div class="helper-text"> <div class="helper-text">
${this._getTranslation("custom_country_pattern_note")} ${this._getTranslation("custom_country_pattern_note")}
</div> </div>
`:I``})()} `}return I``})()}
`)()} `)()}
<!-- Description Display --> <!-- Description Display -->
@@ -1194,15 +1202,15 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
${this.addBooleanField("refresh_on_navigate",this._getTranslation("refresh_on_navigate"))} ${this.addBooleanField("refresh_on_navigate",this._getTranslation("refresh_on_navigate"))}
`)} `)}
</div> </div>
`}addTextField(e,t,a,i){let n=this.getConfigValue(e,i);return void 0===n&&(n=""),I` `}addTextField(e,t,a,i){let n=this.getConfigValue(e,i);void 0===n&&(n="");const o=kn();return _n`
<ha-textfield <${o}
name="${e}" name="${e}"
label="${null!=t?t:this._getTranslation(e)}" label="${null!=t?t:this._getTranslation(e)}"
type="${null!=a?a:"text"}" type="${null!=a?a:"text"}"
.value="${n}" .value="${n}"
@keyup="${this._valueChanged}" @input="${this._valueChanged}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${o}>
`}addEntityPickerField(e,t,a,i){return I` `}addEntityPickerField(e,t,a,i){return I`
<ha-entity-picker <ha-entity-picker
.hass="${this.hass}" .hass="${this.hass}"
@@ -1345,7 +1353,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
`}_renderCalendarEntities(){var e;const t=(null==(e=this._config)?void 0:e.entities)||[];return I` `}_renderCalendarEntities(){var e;const t=(null==(e=this._config)?void 0:e.entities)||[];return I`
${t.map(((e,t)=>this._renderCalendarEntity(e,t)))} ${t.map(((e,t)=>this._renderCalendarEntity(e,t)))}
${this.addButton(this._getTranslation("add_calendar"),"mdi:plus",(()=>this._addCalendarEntity()))} ${this.addButton(this._getTranslation("add_calendar"),"mdi:plus",(()=>this._addCalendarEntity()))}
`}_addCalendarEntity(){var e;const t=[...(null==(e=this._config)?void 0:e.entities)||[]];t.push({entity:"calendar.calendar"}),this.setConfigValue("entities",t)}_removeCalendarEntity(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]];a.splice(e,1),this.setConfigValue("entities",a)}_convertEntityToObject(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]],i=a[e];a[e]={entity:i},this.setConfigValue("entities",a)}_renderActionConfig(e){const t=this.getConfigValue(e,{action:"none"}),a=t.action||"none";return I` `}_addCalendarEntity(){var e;const t=[...(null==(e=this._config)?void 0:e.entities)||[]];t.push({entity:"calendar.calendar"}),this.setConfigValue("entities",t)}_removeCalendarEntity(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]];a.splice(e,1),this.setConfigValue("entities",a)}_convertEntityToObject(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]],i=a[e];a[e]={entity:i},this.setConfigValue("entities",a)}_renderActionConfig(e){const t=this.getConfigValue(e,{action:"none"}),a=t.action||"none",i=kn();return I`
<div class="action-config"> <div class="action-config">
<ha-select <ha-select
name="${e}.action" name="${e}.action"
@@ -1355,38 +1363,38 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
> >
</ha-select> </ha-select>
${"navigate"===a?I` ${"navigate"===a?_n`
<ha-textfield <${i}
name="${e}.navigation_path" name="${e}.navigation_path"
.value="${t.navigation_path||""}" .value="${t.navigation_path||""}"
label="${this._getTranslation("navigation_path")}" label="${this._getTranslation("navigation_path")}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${i}>
`:I``} `:I``}
${"url"===a?I` ${"url"===a?_n`
<ha-textfield <${i}
name="${e}.url_path" name="${e}.url_path"
.value="${t.url_path||""}" .value="${t.url_path||""}"
label="${this._getTranslation("url_path")}" label="${this._getTranslation("url_path")}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${i}>
`:I``} `:I``}
${"call-service"===a?I` ${"call-service"===a?_n`
<ha-textfield <${i}
name="${e}.service" name="${e}.service"
.value="${t.service||""}" .value="${t.service||""}"
label="${this._getTranslation("service")}" label="${this._getTranslation("service")}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${i}>
<ha-textfield <${i}
name="${e}.service_data" name="${e}.service_data"
.value="${t.service_data?JSON.stringify(t.service_data):"{}"}" .value="${t.service_data?JSON.stringify(t.service_data):"{}"}"
label="${this._getTranslation("service_data")}" label="${this._getTranslation("service_data")}"
@change="${this._serviceDataChanged}" @change="${this._serviceDataChanged}"
></ha-textfield> ></${i}>
`:I``} `:I``}
</div> </div>
`}getValueType(e,t="label"){return e&&!1!==e?!0===e?"indicator"===t?"dot":"none":"string"==typeof e?mt(e)?"icon":e.startsWith("/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(e)?"image":"indicator"===t?["dot","pulse","glow"].includes(e)?e:"emoji":"text":"none":"none"}_handleValueTypeChange(e,t,a,i="label"){var n;e.stopPropagation();const o=null==(n=e.detail)?void 0:n.value;let r;"none"===o?r="indicator"!==i&&void 0:"icon"===o?r="string"==typeof a&&mt(a)?a:"indicator"===i?"mdi:star":"mdi:calendar":"image"===o?r="string"==typeof a&&(a.startsWith("/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(a))?a:"indicator"===i?"/local/image.jpg":"/local/calendar.jpg":"indicator"===i?["dot","pulse","glow"].includes(o)?r=o:"emoji"===o&&(r="string"!=typeof a||a.startsWith("mdi:")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(a)||/^\/local\//i.test(a)||["dot","pulse","glow"].includes(a)?"🗓️":a):"text"===o&&(r="string"==typeof a&&"text"===this.getValueType(a,"label")?a:"📅"),this.setConfigValue(t,r)}_renderTypeSelector(e,t,a,i="label"){const n=this.getConfigValue(e),o=this.getValueType(n,i);return I` `}getValueType(e,t="label"){return e&&!1!==e?!0===e?"indicator"===t?"dot":"none":"string"==typeof e?gt(e)?"icon":e.startsWith("/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(e)?"image":"indicator"===t?["dot","pulse","glow"].includes(e)?e:"emoji":"text":"none":"none"}_handleValueTypeChange(e,t,a,i="label"){var n;e.stopPropagation();const o=null==(n=e.detail)?void 0:n.value;let r;"none"===o?r="indicator"!==i&&void 0:"icon"===o?r="string"==typeof a&&gt(a)?a:"indicator"===i?"mdi:star":"mdi:calendar":"image"===o?r="string"==typeof a&&(a.startsWith("/")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(a))?a:"indicator"===i?"/local/image.jpg":"/local/calendar.jpg":"indicator"===i?["dot","pulse","glow"].includes(o)?r=o:"emoji"===o&&(r="string"!=typeof a||a.startsWith("mdi:")||/\.(jpg|jpeg|png|gif|svg|webp)$/i.test(a)||/^\/local\//i.test(a)||["dot","pulse","glow"].includes(a)?"🗓️":a):"text"===o&&(r="string"==typeof a&&"text"===this.getValueType(a,"label")?a:"📅"),this.setConfigValue(t,r)}_renderTypeSelector(e,t,a,i="label"){const n=this.getConfigValue(e),o=this.getValueType(n,i);return I`
<div class="type-selector-field"> <div class="type-selector-field">
<ha-select <ha-select
name="${e}_type" name="${e}_type"
@@ -1407,26 +1415,26 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
@value-changed="${e=>{const a=e.detail.value;a?this.setConfigValue(t,a):this.setConfigValue(t,"indicator"===i?"dot":"")}}" @value-changed="${e=>{const a=e.detail.value;a?this.setConfigValue(t,a):this.setConfigValue(t,"indicator"===i?"dot":"")}}"
></ha-icon-picker> ></ha-icon-picker>
</div> </div>
`;if("emoji"===e||"text"===e){const i="emoji"===e?this._getTranslation("emoji_value"):this._getTranslation("text_value"),n="emoji"===e?this._getTranslation("emoji_indicator_note"):this._getTranslation("text_label_note");return I` `;if("emoji"===e||"text"===e){const i="emoji"===e?this._getTranslation("emoji_value"):this._getTranslation("text_value"),n="emoji"===e?this._getTranslation("emoji_indicator_note"):this._getTranslation("text_label_note"),o=kn();return _n`
<ha-textfield <${o}
name="${t}" name="${t}"
label="${i}" label="${i}"
.value="${a}" .value="${a}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${o}>
<div class="helper-text">${n}</div> <div class="helper-text">${n}</div>
`}return"image"===e?I` `}if("image"===e){const e=kn();return _n`
<ha-textfield <${e}
name="${t}" name="${t}"
label="${this._getTranslation("image_path")}" label="${this._getTranslation("image_path")}"
.value="${a}" .value="${a}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-textfield> ></${e}>
<div class="helper-text">${this._getTranslation("image_indicator_note")}</div> <div class="helper-text">${this._getTranslation("image_indicator_note")}</div>
`:I``}}dn([de({attribute:!1})],un.prototype,"hass"),dn([de({attribute:!1})],un.prototype,"_config");var hn=Object.defineProperty,mn=Object.defineProperties,gn=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,kn=(e,t,a)=>t in e?hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,wn=(e,t)=>{for(var a in t||(t={}))yn.call(t,a)&&kn(e,a,t[a]);if(fn)for(var a of fn(t))vn.call(t,a)&&kn(e,a,t[a]);return e},bn=(e,t)=>mn(e,pn(t)),Mn=(e,t,a,i)=>{for(var n,o=i>1?void 0:i?gn(t,a):t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=(i?n(t,a,o):n(o))||o);return i&&o&&hn(t,a,o),o};let Tn=class extends oe{constructor(){super(),this.config=wn({},Ke),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this._instanceId=gt(),this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ke&&(Ie("Visibility changed to visible, updating events"),this.updateEvents())}},this._instanceId=gt(),Pe(_e)}static getConfigElement(){return document.createElement("calendar-card-pro-editor")}get safeHass(){return this.hass||null}get effectiveLanguage(){return!this._language&&this.hass&&(this._language=ct(this.config.language,this.hass.locale)),this._language||"en"}get groupedEvents(){return si(this.events,this.config,this.isExpanded,this.effectiveLanguage)}static get styles(){return Mi}connectedCallback(){super.connectedCallback(),Ie("Component connected"),this.startRefreshTimer(),this.updateEvents(),this._scheduleWeatherSetup(),document.addEventListener("visibilitychange",this._handleVisibilityChange)}disconnectedCallback(){super.disconnectedCallback(),this._weatherSetupVersion++,this._weatherSetupPending=!1,this._cleanupWeatherSubscriptions(),this._refreshTimerId&&clearTimeout(this._refreshTimerId),this._initialLoadRetryId&&(clearTimeout(this._initialLoadRetryId),this._initialLoadRetryId=void 0),this._holdTimer&&(clearTimeout(this._holdTimer),this._holdTimer=null),this._holdIndicator&&(Ti(this._holdIndicator),this._holdIndicator=null),document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ie("Component disconnected")}updated(e){var t,a,i,n,o,r,s,l,d;e.has("hass")&&this.hass&&!e.get("hass")&&this.updateEvents(!0),(e.has("hass")&&(null==(t=this.hass)?void 0:t.locale)||e.has("config")&&(null==(a=e.get("config"))?void 0:a.language)!==this.config.language)&&(this._language=ct(this.config.language,null==(i=this.hass)?void 0:i.locale));const _=e.has("hass")&&this.hass&&!e.get("hass"),c=e.get("config"),u=e.has("config")&&((null==(o=null==(n=this.config)?void 0:n.weather)?void 0:o.entity)!==(null==(r=null==c?void 0:c.weather)?void 0:r.entity)||(null==(l=null==(s=this.config)?void 0:s.weather)?void 0:l.position)!==(null==(d=null==c?void 0:c.weather)?void 0:d.position));(_||u)&&this._scheduleWeatherSetup()}getCustomStyles(){return function(e){var t,a,i,n,o,r,s,l,d,_,c,u;const h={"--calendar-card-background-color":e.background_color,"--calendar-card-font-size-weekday":e.weekday_font_size,"--calendar-card-font-size-day":e.day_font_size,"--calendar-card-font-size-month":e.month_font_size,"--calendar-card-font-size-event":e.event_font_size,"--calendar-card-font-size-time":e.time_font_size,"--calendar-card-font-size-location":e.location_font_size,"--calendar-card-font-size-description":e.description_font_size,"--calendar-card-color-weekday":e.weekday_color,"--calendar-card-color-day":e.day_color,"--calendar-card-color-month":e.month_color,"--calendar-card-color-event":e.event_color,"--calendar-card-color-time":e.time_color,"--calendar-card-color-location":e.location_color,"--calendar-card-color-description":e.description_color,"--calendar-card-line-color-vertical":e.accent_color,"--calendar-card-line-width-vertical":e.vertical_line_width,"--calendar-card-day-spacing":e.day_spacing,"--calendar-card-event-spacing":e.event_spacing,"--calendar-card-spacing-additional":e.additional_card_spacing,"--calendar-card-height":e.height||"auto","--calendar-card-max-height":e.max_height,"--calendar-card-progress-bar-color":e.progress_bar_color,"--calendar-card-progress-bar-height":e.progress_bar_height,"--calendar-card-progress-bar-width":e.progress_bar_width,"--calendar-card-icon-size-time":e.time_icon_size||"14px","--calendar-card-icon-size-location":e.location_icon_size||"14px","--calendar-card-icon-size-description":e.description_icon_size||"14px","--calendar-card-description-max-lines":e.description_max_lines>0?String(e.description_max_lines):"none","--calendar-card-date-column-width":1.75*parseFloat(e.day_font_size)+"px","--calendar-card-date-column-vertical-alignment":e.date_vertical Line truncated `}return I``}}vn([de({attribute:!1})],Mn.prototype,"hass"),vn([de({attribute:!1})],Mn.prototype,"_config");var zn=Object.defineProperty,Tn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptor,Sn=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Yn=(e,t,a)=>t in e?zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Ln=(e,t)=>{for(var a in t||(t={}))jn.call(t,a)&&Yn(e,a,t[a]);if($n)for(var a of $n(t))xn.call(t,a)&&Yn(e,a,t[a]);return e},En=(e,t)=>Tn(e,Sn(t)),An=(e,t,a,i)=>{for(var n,o=i>1?void 0:i?Dn(t,a):t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=(i?n(t,a,o):n(o))||o);return i&&o&&zn(t,a,o),o};let Cn=class extends oe{constructor(){super(),this.config=Ln({},Ke),this.events=[],this.isInitialLoad=!0,this.isLoading=!1,this.isExpanded=!1,this.weatherForecasts={daily:{},hourly:{}},this._instanceId=yt(),this._language="",this._lastUpdateTime=0,this._weatherUnsubscribers=[],this._weatherSetupVersion=0,this._weatherSetupPending=!1,this._activePointerId=null,this._holdTriggered=!1,this._holdTimer=null,this._holdIndicator=null,this._handleVisibilityChange=()=>{if("visible"===document.visibilityState){Date.now()-this._lastUpdateTime>ke&&(Ie("Visibility changed to visible, updating events"),this.updateEvents())}},this._instanceId=yt(),Pe(_e)}static getConfigElement(){return document.createElement("calendar-card-pro-editor")}get safeHass(){return this.hass||null}get effectiveLanguage(){return!this._language&&this.hass&&(this._language=mt(this.config.language,this.hass.locale)),this._language||"en"}get groupedEvents(){return ci(this.events,this.config,this.isExpanded,this.effectiveLanguage)}static get styles(){return Si}connectedCallback(){super.connectedCallback(),Ie("Component connected"),this.startRefreshTimer(),this.updateEvents(),this._scheduleWeatherSetup(),document.addEventListener("visibilitychange",this._handleVisibilityChange)}disconnectedCallback(){super.disconnectedCallback(),this._weatherSetupVersion++,this._weatherSetupPending=!1,this._cleanupWeatherSubscriptions(),this._refreshTimerId&&clearTimeout(this._refreshTimerId),this._initialLoadRetryId&&(clearTimeout(this._initialLoadRetryId),this._initialLoadRetryId=void 0),this._holdTimer&&(clearTimeout(this._holdTimer),this._holdTimer=null),this._holdIndicator&&($i(this._holdIndicator),this._holdIndicator=null),document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ie("Component disconnected")}updated(e){var t,a,i,n,o,r,s,l,d;e.has("hass")&&this.hass&&!e.get("hass")&&this.updateEvents(!0),(e.has("hass")&&(null==(t=this.hass)?void 0:t.locale)||e.has("config")&&(null==(a=e.get("config"))?void 0:a.language)!==this.config.language)&&(this._language=mt(this.config.language,null==(i=this.hass)?void 0:i.locale));const _=e.has("hass")&&this.hass&&!e.get("hass"),c=e.get("config"),u=e.has("config")&&((null==(o=null==(n=this.config)?void 0:n.weather)?void 0:o.entity)!==(null==(r=null==c?void 0:c.weather)?void 0:r.entity)||(null==(l=null==(s=this.config)?void 0:s.weather)?void 0:l.position)!==(null==(d=null==c?void 0:c.weather)?void 0:d.position));(_||u)&&this._scheduleWeatherSetup()}getCustomStyles(){return function(e){var t,a,i,n,o,r,s,l,d,_,c,u;const m={"--calendar-card-background-color":e.background_color,"--calendar-card-font-size-weekday":e.weekday_font_size,"--calendar-card-font-size-day":e.day_font_size,"--calendar-card-font-size-month":e.month_font_size,"--calendar-card-font-size-event":e.event_font_size,"--calendar-card-font-size-time":e.time_font_size,"--calendar-card-font-size-location":e.location_font_size,"--calendar-card-font-size-description":e.description_font_size,"--calendar-card-color-weekday":e.weekday_color,"--calendar-card-color-day":e.day_color,"--calendar-card-color-month":e.month_color,"--calendar-card-color-event":e.event_color,"--calendar-card-color-time":e.time_color,"--calendar-card-color-location":e.location_color,"--calendar-card-color-description":e.description_color,"--calendar-card-line-color-vertical":e.accent_color,"--calendar-card-line-width-vertical":e.vertical_line_width,"--calendar-card-day-spacing":e.day_spacing,"--calendar-card-event-spacing":e.event_spacing,"--calendar-card-spacing-additional":e.additional_card_spacing,"--calendar-card-height":e.height||"auto","--calendar-card-max-height":e.max_height,"--calendar-card-progress-bar-color":e.progress_bar_color,"--calendar-card-progress-bar-height":e.progress_bar_height,"--calendar-card-progress-bar-width":e.progress_bar_width,"--calendar-card-icon-size-time":e.time_icon_size||"14px","--calendar-card-icon-size-location":e.location_icon_size||"14px","--calendar-card-icon-size-description":e.description_icon_size||"14px","--calendar-card-description-max-lines":e.description_max_lines>0?String(e.description_max_lines):"none","--calendar-card-date-column-width":1.75*parseFloat(e.day_font_size)+"px","--calendar-card-date-column-vertical-alignment":e.date_v Line truncated
<ha-card <ha-card
class="calendar-card-pro ${n?"max-height-set":""}" class="calendar-card-pro ${n?"max-height-set":""}"
style=${Li(e)} style=${Hi(e)}
tabindex="0" tabindex="0"
aria-busy=${o?"true":"false"} aria-busy=${o?"true":"false"}
@keydown=${i.keyDown} @keydown=${i.keyDown}
@@ -1451,5 +1459,5 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
<!-- Content container is always present --> <!-- Content container is always present -->
<div class="content-container">${a}</div> <div class="content-container">${a}</div>
</ha-card> </ha-card>
`}(e,this.config.title,a,t,!1,this.isLoading)}};Tn.getStubConfig=Ue,Mn([de({attribute:!1})],Tn.prototype,"hass",2),Mn([de({attribute:!1})],Tn.prototype,"config",2),Mn([de({attribute:!1})],Tn.prototype,"events",2),Mn([de({attribute:!1})],Tn.prototype,"isInitialLoad",2),Mn([de({attribute:!1})],Tn.prototype,"isLoading",2),Mn([de({attribute:!1})],Tn.prototype,"isExpanded",2),Mn([de({attribute:!1})],Tn.prototype,"weatherForecasts",2),Tn=Mn([(e=>(t,a)=>{void 0!==a?a.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],Tn),customElements.define("calendar-card-pro-editor",un);const zn=customElements.get("calendar-card-pro");zn&&(zn.getStubConfig=Ue),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro"}); `}(e,this.config.title,a,t,!1,this.isLoading)}};Cn.getStubConfig=Re,An([de({attribute:!1})],Cn.prototype,"hass",2),An([de({attribute:!1})],Cn.prototype,"config",2),An([de({attribute:!1})],Cn.prototype,"events",2),An([de({attribute:!1})],Cn.prototype,"isInitialLoad",2),An([de({attribute:!1})],Cn.prototype,"isLoading",2),An([de({attribute:!1})],Cn.prototype,"isExpanded",2),An([de({attribute:!1})],Cn.prototype,"weatherForecasts",2),Cn=An([(e=>(t,a)=>{void 0!==a?a.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("calendar-card-pro")],Cn),customElements.define("calendar-card-pro-editor",Mn);const Hn=customElements.get("calendar-card-pro");Hn&&(Hn.getStubConfig=Re),window.customCards=window.customCards||[],window.customCards.push({type:"calendar-card-pro",name:"Calendar Card Pro",preview:!0,description:"A calendar card that supports multiple calendars with individual styling.",documentationURL:"https://github.com/alexpfau/calendar-card-pro"});
//# sourceMappingURL=calendar-card-pro.js.map //# sourceMappingURL=calendar-card-pro.js.map
+17 -17
View File
@@ -27,10 +27,10 @@
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"power": 3.6, "power": 2.6,
"current": 0.12, "current": 0.12,
"energy": 26.94, "energy": 26.94,
"power_factor": 0.25, "power_factor": 0.19,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,
@@ -45,7 +45,7 @@
"state": "ON", "state": "ON",
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"voltage": 121.2, "voltage": 121.7,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"energy": 50.57, "energy": 50.57,
"power_factor": 0.2, "power_factor": 0.2,
@@ -74,13 +74,13 @@
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"voltage": 119.5, "voltage": 120,
"state": "ON", "state": "ON",
"ac_frequency": 60, "ac_frequency": 60,
"energy": 103.02, "energy": 103.03,
"power": 102.9, "power": 103,
"current": 0.94, "current": 0.94,
"power_factor": 0.94, "power_factor": 0.95,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,
@@ -95,11 +95,11 @@
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"voltage": 121, "voltage": 121.5,
"energy": 44.26, "energy": 44.26,
"state": "ON", "state": "ON",
"power": 44.6, "power": 40.8,
"current": 0.47, "current": 0.45,
"ac_frequency": 60, "ac_frequency": 60,
"power_factor": 0.79, "power_factor": 0.79,
"update": { "update": {
@@ -114,12 +114,12 @@
}, },
"0xffffb40e060895b3": { "0xffffb40e060895b3": {
"state": "ON", "state": "ON",
"voltage": 121.5, "voltage": 122,
"ac_frequency": 60, "ac_frequency": 60,
"energy": 6.35, "energy": 6.35,
"current": 0.01, "current": 0.01,
"power": 0.2, "power": 0.2,
"power_factor": 0.22, "power_factor": 0.11,
"linkquality": 123, "linkquality": 123,
"update": { "update": {
"state": "idle", "state": "idle",
@@ -136,14 +136,14 @@
"0xffffb40e0608864e": { "0xffffb40e0608864e": {
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"voltage": 121.1, "voltage": 121.6,
"energy": 17.35, "energy": 17.35,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"state": "ON", "state": "ON",
"current": 0.02, "current": 0.02,
"ac_frequency": 60, "ac_frequency": 60,
"power": 0.3, "power": 0.3,
"power_factor": 0.2, "power_factor": 0.14,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,
@@ -172,7 +172,7 @@
"0xffffb40e060893d8": { "0xffffb40e060893d8": {
"state": "ON", "state": "ON",
"led_brightness": 100, "led_brightness": 100,
"voltage": 121.4, "voltage": 121.9,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"energy": 3.04, "energy": 3.04,
@@ -187,8 +187,8 @@
"latest_source": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/ThirdReality/SmartPlug_Zigbee_PROD_OTA_V101_1.01.01.ota", "latest_source": "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/ThirdReality/SmartPlug_Zigbee_PROD_OTA_V101_1.01.01.ota",
"latest_release_notes": null "latest_release_notes": null
}, },
"power_factor": 0.07, "power_factor": 0,
"power": 1.5 "power": 0.2
}, },
"0xa4c1380d0679ffff": { "0xa4c1380d0679ffff": {
"battery": 100, "battery": 100,