diff --git a/dist/scheduler-card.js b/dist/scheduler-card.js index 49a2b462..80ff1b05 100644 --- a/dist/scheduler-card.js +++ b/dist/scheduler-card.js @@ -1,11361 +1,1894 @@ -(function (exports) { - 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - - /** +!function(e){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */function t(e,t,i,s){var a,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(n=(o<3?a(n):o>3?a(t,i,n):a(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n +/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */ - const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol();class s{constructor(t,s){if(s!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t;}get styleSheet(){return t&&void 0===this.t&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const n=new Map,o=t=>{let o=n.get(t);return void 0===o&&n.set(t,o=new s(t,e)),o},r=t=>o("string"==typeof t?t:t+""),i=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,o)=>e+(t=>{if(t instanceof s)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.")})(n)+t[o+1]),t[0]);return o(n)},S=(e,s)=>{t?e.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((t=>{const s=document.createElement("style");s.textContent=t.cssText,e.appendChild(s);}));},u=t?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t; - - /** + */}const i=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new Map;class o{constructor(e,t){if(this._$cssResult$=!0,t!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let e=a.get(this.cssText);return i&&void 0===e&&(a.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const n=e=>new o("string"==typeof e?e:e+"",s),r=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,s)=>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.")})(i)+e[s+1],e[0]);return new o(i,s)},l=(e,t)=>{i?e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(t=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=t.cssText,e.appendChild(i)})},c=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return n(t)})(e):e +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */var s$1,e$1,h,r$1;const o$1={toAttribute(t,i){switch(i){case Boolean:t=t?"":null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},n$1=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:o$1,reflect:!1,hasChanged:n$1};class a extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u();}static addInitializer(t){var i;null!==(i=this.v)&&void 0!==i||(this.v=[]),this.v.push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this.Πp(s,i);void 0!==e&&(this.Πm.set(e,s),t.push(e));})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const h=this[t];this[i]=e,this.requestUpdate(t,h,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(u(i));}else void 0!==i&&s.push(u(i));return s}static Πp(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this.Πg=new Promise((t=>this.enableUpdating=t)),this.L=new Map,this.Π_(),this.requestUpdate(),null===(t=this.constructor.v)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this.ΠU)&&void 0!==i?i:this.ΠU=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this.ΠU)||void 0===i||i.splice(this.ΠU.indexOf(t)>>>0,1);}Π_(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this.Πi.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)})),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0);}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)})),this.Πo=new Promise((t=>this.Πl=t));}attributeChangedCallback(t,i,s){this.K(t,s);}Πj(t,i,s=l){var e,h;const r=this.constructor.Πp(t,s);if(void 0!==r&&!0===s.reflect){const n=(null!==(h=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==h?h:o$1.toAttribute)(i,s.type);this.Πh=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this.Πh=null;}}K(t,i){var s,e,h;const r=this.constructor,n=r.Πm.get(t);if(void 0!==n&&this.Πh!==n){const t=r.getPropertyOptions(n),l=t.converter,a=null!==(h=null!==(e=null===(s=l)||void 0===s?void 0:s.fromAttribute)&&void 0!==e?e:"function"==typeof l?l:null)&&void 0!==h?h:o$1.fromAttribute;this.Πh=n,this[n]=a(i,t.type),this.Πh=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||n$1)(this[t],i)?(this.L.has(t)||this.L.set(t,i),!0===s.reflect&&this.Πh!==t&&(void 0===this.Πk&&(this.Πk=new Map),this.Πk.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this.Πg=this.Πq());}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo;}catch(t){Promise.reject(t);}const t=this.performUpdate();return null!=t&&await t,!this.isUpdatePending}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach(((t,i)=>this[i]=t)),this.Πi=void 0);let i=!1;const s=this.L;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this.Π$();}catch(t){throw i=!1,this.Π$(),t}i&&this.E(s);}willUpdate(t){}E(t){var i;null===(i=this.ΠU)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}Π$(){this.L=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(t){return !0}update(t){void 0!==this.Πk&&(this.Πk.forEach(((t,i)=>this.Πj(i,this[i],t))),this.Πk=void 0),this.Π$();}updated(t){}firstUpdated(t){}}a.finalized=!0,a.elementProperties=new Map,a.elementStyles=[],a.shadowRootOptions={mode:"open"},null===(e$1=(s$1=globalThis).reactiveElementPlatformSupport)||void 0===e$1||e$1.call(s$1,{ReactiveElement:a}),(null!==(h=(r$1=globalThis).reactiveElementVersions)&&void 0!==h?h:r$1.reactiveElementVersions=[]).push("1.0.0-rc.2"); - - /** + */;var d;const u=window.trustedTypes,h=u?u.emptyScript:"",m=window.reactiveElementPolyfillSupport,p={toAttribute(e,t){switch(t){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},_=(e,t)=>t!==e&&(t==t||e==e),v={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:_};class g extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(e){var t;null!==(t=this.l)&&void 0!==t||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const s=this._$Eh(i,t);void 0!==s&&(this._$Eu.set(s,i),e.push(s))}),e}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){const a=this[e];this[t]=s,this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||v}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(c(e))}else void 0!==e&&t.push(c(e));return t}static _$Eh(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}o(){var e;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach(e=>e(this))}addController(e){var t,i;(null!==(t=this._$Eg)&&void 0!==t?t:this._$Eg=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$Eg)||void 0===t||t.splice(this._$Eg.indexOf(e)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return l(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$Eg)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$Eg)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ES(e,t,i=v){var s,a;const o=this.constructor._$Eh(e,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(a=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==a?a:p.toAttribute)(t,i.type);this._$Ei=e,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Ei=null}}_$AK(e,t){var i,s,a;const o=this.constructor,n=o._$Eu.get(e);if(void 0!==n&&this._$Ei!==n){const e=o.getPropertyOptions(n),r=e.converter,l=null!==(a=null!==(s=null===(i=r)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof r?r:null)&&void 0!==a?a:p.fromAttribute;this._$Ei=n,this[n]=l(t,e.type),this._$Ei=null}}requestUpdate(e,t,i){let s=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||_)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$Ei!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((e,t)=>this[t]=e),this._$Et=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$Eg)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(i)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$Eg)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$ES(t,this[t],e)),this._$EC=void 0),this._$EU()}updated(e){}firstUpdated(e){}} +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ - var t$1,i$1,s$2,e$2;const o$2=globalThis.trustedTypes,l$1=o$2?o$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,n$2=`lit$${(Math.random()+"").slice(9)}$`,h$1="?"+n$2,r$2=`<${h$1}>`,u$1=document,c=(t="")=>u$1.createComment(t),d=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,a$1=t=>{var i;return v(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,$=/'/g,g=/"/g,y=/^(?:script|style|textarea)$/i,b=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),T=b(1),w=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),P=new WeakMap,V=(t,i,s)=>{var e,o;const l=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let n=l._$litPart$;if(void 0===n){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;l._$litPart$=n=new C(i.insertBefore(c(),t),t,void 0,s);}return n.I(t),n},E=u$1.createTreeWalker(u$1,129,null,!1),M=(t,i)=>{const s=t.length-1,e=[];let o,h=2===i?"":"",u=f;for(let i=0;i"===c[0]?(u=null!=o?o:f,d=-1):void 0===c[1]?d=-2:(d=u.lastIndex-c[2].length,l=c[1],u=void 0===c[3]?p:'"'===c[3]?g:$):u===g||u===$?u=p:u===_||u===m?u=f:(u=p,o=void 0);const a=u===p&&t[i+1].startsWith("/>")?" ":"";h+=u===f?s+r$2:d>=0?(e.push(l),s.slice(0,d)+"$lit$"+s.slice(d)+n$2+a):s+n$2+(-2===d?(e.push(void 0),i):a);}const c=h+(t[s]||"")+(2===i?"":"");return [void 0!==l$1?l$1.createHTML(c):c,e]};class N{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let l=0,r=0;const u=t.length-1,d=this.parts,[v,a]=M(t,i);if(this.el=N.createElement(v,s),E.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(e=E.nextNode())&&d.length0){e.textContent=o$2?o$2.emptyScript:"";for(let s=0;s2||""!==s[0]||""!==s[1]?(this.H=Array(s.length-1).fill(A),this.strings=s):this.H=A;}get tagName(){return this.element.tagName}I(t,i=this,s,e){const o=this.strings;let l=!1;if(void 0===o)t=S$1(this,t,i,0),l=!d(t)||t!==this.H&&t!==w,l&&(this.H=t);else {const e=t;let n,h;for(t=o[0],n=0;ne}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,x=`<${k}>`,$=document,j=(e="")=>$.createComment(e),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,S=Array.isArray,z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,C=/>/g,A=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,D=/'/g,M=/"/g,T=/^(?:script|style|textarea|title)$/i,N=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),L=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),P=new WeakMap,q=$.createTreeWalker($,129,null,!1),R=(e,t)=>{const i=e.length-1,s=[];let a,o=2===t?"":"",n=z;for(let t=0;t"===l[0]?(n=null!=a?a:z,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,r=l[1],n=void 0===l[3]?A:'"'===l[3]?M:D):n===M||n===D?n=A:n===E||n===C?n=z:(n=A,a=void 0);const u=n===A&&e[t+1].startsWith("/>")?" ":"";o+=n===z?i+x:c>=0?(s.push(r),i.slice(0,c)+"$lit$"+i.slice(c)+w+u):i+w+(-2===c?(s.push(void 0),t):u)}const r=o+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==b?b.createHTML(r):r,s]};class U{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let a=0,o=0;const n=e.length-1,r=this.parts,[l,c]=R(e,t);if(this.el=U.createElement(l,i),q.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(s=q.nextNode())&&r.length0){s.textContent=y?y.emptyScript:"";for(let i=0;i{var t;return S(e)||"function"==typeof(null===(t=e)||void 0===t?void 0:t[Symbol.iterator])})(e)?this.S(e):this.$(e)}A(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}k(e){this._$AH!==e&&(this._$AR(),this._$AH=this.A(e))}$(e){this._$AH!==I&&O(this._$AH)?this._$AA.nextSibling.data=e:this.k($.createTextNode(e)),this._$AH=e}T(e){var t;const{values:i,_$litType$:s}=e,a="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=U.createElement(s.h,this.options)),s);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.m(i);else{const e=new V(a,this),t=e.p(this.options);e.m(i),this.k(t),this._$AH=e}}_$AC(e){let t=P.get(e.strings);return void 0===t&&P.set(e.strings,t=new U(e)),t}S(e){S(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const a of e)s===t.length?t.push(i=new F(this.A(j()),this.A(j()),this,this.options)):i=t[s],i._$AI(a),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){const a=this.strings;let o=!1;if(void 0===a)e=H(this,e,t,0),o=!O(e)||e!==this._$AH&&e!==L,o&&(this._$AH=e);else{const s=e;let n,r;for(e=a[0],n=0;n{var s,a;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:t;let n=o._$litPart$;if(void 0===n){const e=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:null;o._$litPart$=n=new F(t.insertBefore(j(),e),e,void 0,null!=i?i:{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Dt)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Dt)||void 0===e||e.setConnected(!1)}render(){return L}}ee.finalized=!0,ee._$litElement$=!0,null===(X=globalThis.litElementHydrateSupport)||void 0===X||X.call(globalThis,{LitElement:ee});const te=globalThis.litElementPolyfillSupport;null==te||te({LitElement:ee}),(null!==(Q=globalThis.litElementVersions)&&void 0!==Q?Q:globalThis.litElementVersions=[]).push("3.2.0"); +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ - const n$4=n=>e=>"function"==typeof e?((n,e)=>(window.customElements.define(n,e),e))(n,e):((n,e)=>{const{kind:t,elements:i}=e;return {kind:t,elements:i,finisher(e){window.customElements.define(n,e);}}})(n,e); - - /** +const ie=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:s}=t;return{kind:i,elements:s,finisher(t){window.customElements.define(e,t)}}})(e,t) +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */ - const i$3=(i,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this));},finisher(n){n.createProperty(e.key,i);}};function e$3(e){return (n,t)=>void 0!==t?((i,e,n)=>{e.constructor.createProperty(n,i);})(e,n,t):i$3(e,n)} - - /** + */,se=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function ae(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):se(e,t) +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function r$3(r){return e$3({...r,state:!0,attribute:!1})} - - /** + */}function oe(e){return ae({...e,state:!0})} +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause + */const ne=({finisher:e,descriptor:t})=>(i,s)=>{var a;if(void 0===s){const s=null!==(a=i.originalKey)&&void 0!==a?a:i.key,o=null!=t?{kind:"method",placement:"prototype",key:s,descriptor:t(i.key)}:{...i,key:s};return null!=e&&(o.finisher=function(t){e(t,s)}),o}{const a=i.constructor;void 0!==t&&Object.defineProperty(i,s,t(s)),null==e||e(a,s)}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause */ - const o$4=({finisher:e,descriptor:t})=>(o,n)=>{var r;if(void 0===n){const n=null!==(r=o.originalKey)&&void 0!==r?r:o.key,i=null!=t?{kind:"method",placement:"prototype",key:n,descriptor:t(o.key)}:{...o,key:n};return null!=e&&(i.finisher=function(t){e(t,n);}),i}{const r=o.constructor;void 0!==t&&Object.defineProperty(o,n,t(n)),null==e||e(r,n);}}; - - /** +var re;null===(re=window.HTMLSlotElement)||void 0===re||re.prototype.assignedElements;var le=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ce="[^\\s]+",de=/\[([^]*?)\]/gm;function ue(e,t){for(var i=[],s=0,a=e.length;s-1?s:null}};function me(e){for(var t=[],i=1;i3?0:(e-e%10!=10?1:0)*e%10]}},fe=me({},ge),ye=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+ye(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+ye(Math.floor(Math.abs(t)/60),2)+":"+ye(Math.abs(t)%60,2)}},we=function(e){return+e-1},ke=[null,"[1-9]\\d?"],xe=[null,ce],$e=["isPm",ce,function(e,t){var i=e.toLowerCase();return i===t.amPm[0]?0:i===t.amPm[1]?1:null}],je=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var i=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?i:-i}return 0}],Oe=(he("monthNamesShort"),he("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"}),Se=function(e,t,i){if(void 0===t&&(t=Oe.default),void 0===i&&(i={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var s=[];t=(t=Oe[t]||t).replace(de,(function(e,t){return s.push(t),"@@@"}));var a=me(me({},fe),i);return(t=t.replace(le,(function(t){return be[t](e,a)}))).replace(/@@@/g,(function(){return s.shift()}))};var ze,Ee,Ce=Se;(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();function Ae(e){return e.substr(0,e.indexOf("."))}function De(e){return e.substr(e.indexOf(".")+1)}!function(e){e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none"}(ze||(ze={})),function(e){e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24"}(Ee||(Ee={}));var Me=function(e,t,i,s){s=s||{},i=null==i?{}:i;var a=new Event(t,{bubbles:void 0===s.bubbles||s.bubbles,cancelable:Boolean(s.cancelable),composed:void 0===s.composed||s.composed});return a.detail=i,e.dispatchEvent(a),a},Te={alert:"hass:alert",automation:"hass:playlist-play",calendar:"hass:calendar",camera:"hass:video",climate:"hass:thermostat",configurator:"hass:settings",conversation:"hass:text-to-speech",device_tracker:"hass:account",fan:"hass:fan",group:"hass:google-circles-communities",history_graph:"hass:chart-line",homeassistant:"hass:home-assistant",homekit:"hass:home-automation",image_processing:"hass:image-filter-frames",input_boolean:"hass:drawing",input_datetime:"hass:calendar-clock",input_number:"hass:ray-vertex",input_select:"hass:format-list-bulleted",input_text:"hass:textbox",light:"hass:lightbulb",mailbox:"hass:mailbox",notify:"hass:comment-alert",person:"hass:account",plant:"hass:flower",proximity:"hass:apple-safari",remote:"hass:remote",scene:"hass:google-pages",script:"hass:file-document",sensor:"hass:eye",simple_alarm:"hass:bell",sun:"hass:white-balance-sunny",switch:"hass:flash",timer:"hass:timer",updater:"hass:cloud-upload",vacuum:"hass:robot-vacuum",water_heater:"hass:thermometer",weblink:"hass:open-in-new"};function Ne(e,t){if(e in Te)return Te[e];switch(e){case"alarm_control_panel":switch(t){case"armed_home":return"hass:bell-plus";case"armed_night":return"hass:bell-sleep";case"disarmed":return"hass:bell-outline";case"triggered":return"hass:bell-ring";default:return"hass:bell"}case"binary_sensor":return t&&"off"===t?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===t?"hass:window-closed":"hass:window-open";case"lock":return t&&"unlocked"===t?"hass:lock-open":"hass:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"hass:cast-connected":"hass:cast";case"zwave":switch(t){case"dead":return"hass:emoticon-dead";case"sleeping":return"hass:sleep";case"initializing":return"hass:timer-sand";default:return"hass:z-wave"}default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),"hass:bookmark"}}var Le,Ie,Pe,qe,Re,Ue,He,Ve={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},Fe={binary_sensor:function(e){var t=e.state&&"off"===e.state;switch(e.attributes.device_class){case"battery":return t?"hass:battery":"hass:battery-outline";case"cold":return t?"hass:thermometer":"hass:snowflake";case"connectivity":return t?"hass:server-network-off":"hass:server-network";case"door":return t?"hass:door-closed":"hass:door-open";case"garage_door":return t?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return t?"hass:shield-check":"hass:alert";case"heat":return t?"hass:thermometer":"hass:fire";case"light":return t?"hass:brightness-5":"hass:brightness-7";case"lock":return t?"hass:lock":"hass:lock-open";case"moisture":return t?"hass:water-off":"hass:water";case"motion":return t?"hass:walk":"hass:run";case"occupancy":return t?"hass:home-outline":"hass:home";case"opening":return t?"hass:square":"hass:square-outline";case"plug":return t?"hass:power-plug-off":"hass:power-plug";case"presence":return t?"hass:home-outline":"hass:home";case"sound":return t?"hass:music-note-off":"hass:music-note";case"vibration":return t?"hass:crop-portrait":"hass:vibrate";case"window":return t?"hass:window-closed":"hass:window-open";default:return t?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(e){var t="closed"!==e.state;switch(e.attributes.device_class){case"garage":return t?"hass:garage-open":"hass:garage";case"door":return t?"hass:door-open":"hass:door-closed";case"shutter":return t?"hass:window-shutter-open":"hass:window-shutter";case"blind":return t?"hass:blinds-open":"hass:blinds";case"window":return t?"hass:window-open":"hass:window-closed";default:return Ne("cover",e.state)}},sensor:function(e){var t=e.attributes.device_class;if(t&&t in Ve)return Ve[t];if("battery"===t){var i=Number(e.state);if(isNaN(i))return"hass:battery-unknown";var s=10*Math.round(i/10);return s>=100?"hass:battery":s<=0?"hass:battery-alert":"hass:battery-"+s}var a=e.attributes.unit_of_measurement;return"°C"===a||"°F"===a?"hass:thermometer":Ne("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?Ne("input_datetime"):"hass:calendar":"hass:clock"}},Be=function(e){if(!e)return"hass:bookmark";if(e.attributes.icon)return e.attributes.icon;var t=Ae(e.entity_id);return t in Fe?Fe[t](e):Ne(t,e.state)};!function(e){e.Repeat="repeat",e.Pause="pause",e.Single="single"}(Le||(Le={})),function(e){e.Level="LEVEL",e.List="LIST",e.Text="TEXT"}(Ie||(Ie={})),function(e){e.Equal="is",e.Unequal="not",e.Below="below",e.Above="above"}(Pe||(Pe={})),function(e){e.Any="or",e.All="and"}(qe||(qe={})),function(e){e.Sunrise="sunrise",e.Sunset="sunset"}(Re||(Re={})),function(e){e.Daily="DAILY",e.Workday="WORKDAY",e.Weekend="WEEKEND",e.Custom="CUSTOM"}(Ue||(Ue={})),function(e){e.ItemCreated="scheduler_item_created",e.ItemUpdated="scheduler_item_updated",e.ItemRemoved="scheduler_item_removed",e.TimerFinished="scheduler_timer_finished",e.TimerUpdated="scheduler_timer_updated"}(He||(He={}));var Ye;!function(e){e.Overview="OVERVIEW",e.NewSchedule="NEW_SCHEDULE",e.TimePicker="TIME_PICKER",e.TimeScheme="TIME_SCHEME",e.Options="OPTIONS"}(Ye||(Ye={}));const We={type:"scheduler-card",discover_existing:!0,standard_configuration:!0,include:[],exclude:[],groups:[],customize:{},title:!0,time_step:10,show_header_toggle:!1,display_options:{primary_info:"default",secondary_info:["relative-time","additional-tasks"],icon:"action"},tags:[],sort_by:["relative-time","state"]};function Ge(e,t){if(e.match(/^([0-9:]+)$/)){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+(t[2]||0)}const i=Je(e);if(i){const e=t.states["sun.sun"],s=Ge(e.attributes.next_rising,t),a=Ge(e.attributes.next_setting,t);let o="sunrise"==i.event?s:a;return o="+"==i.sign?o+Ge(i.offset,t):o-Ge(i.offset,t),o}const s=new Date(e);return 3600*s.getHours()+60*s.getMinutes()+s.getSeconds()}function Ze(e){const t=Math.floor(e/3600);e-=3600*t;const i=Math.floor(e/60);e-=60*i;const s=Math.round(e);return String(t%24).padStart(2,"0")+":"+String(i).padStart(2,"0")+":"+String(s).padStart(2,"0")}function Ke(e,t,i={wrapAround:!0}){let s=e>=0?Math.floor(e/3600):Math.ceil(e/3600),a=Math.floor((e-3600*s)/60);a%t!=0&&(a=Math.round(a/t)*t),a>=60?(s++,a-=60):a<0&&(s--,a+=60),i.wrapAround&&(s>=24?s-=24:s<0&&(s+=24));const o=3600*s+60*a;if(i.maxHours){if(o>3600*i.maxHours)return 3600*i.maxHours;if(o<3600*-i.maxHours)return 3600*-i.maxHours}return o}function Je(e){const t=e.match(/^([a-z]+)([\+|-]{1})([0-9:]+)$/);return!!t&&{event:t[1],sign:t[2],offset:t[3]}}function Xe(e,t){return e?Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,i])=>Object.assign(e,{[t]:i}),{}):{}}const Qe=(e,...t)=>{const i={};let s;for(s in e)t.includes(s)||(i[s]=e[s]);return i};function et(e){return e.every(e=>!Array.isArray(e))?e.slice():e.reduce((e,t)=>e.concat(Array.isArray(t)?et(t):t),[])}function tt(e){let t=[];return e.forEach(e=>{t.find(t=>"object"==typeof e?st(t,e):t===e)||t.push(e)}),t}function it(e){return null!=e}function st(...e){if(!e.length)return!1;const t=e[0];return e.every(e=>t&&e&&"object"==typeof t&&"object"==typeof e?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce((i,s)=>i&&st(t[s],e[s]),!0):t===e)}function at(e,t){const i=e=>"object"==typeof e?void 0!==e.name?String(e.name).trim().toLowerCase():JSON.stringify(e):String(e).trim().toLowerCase();return i(e)Object(Object.assign(Object.assign({},e),{start:Ge(e.start,t)<0?"00:00:00":e.start,stop:Ge(e.stop,t)>86400?"00:00:00":e.stop})))).map(e=>{const i=Ge(e.stop,t)-Ge(e.start,t);return i<0?0==Ge(e.stop,t)?Object.assign(Object.assign({},e),{stop:Ze(Ge(e.stop,t)+86400)}):Object.assign(Object.assign({},e),{start:e.stop,stop:e.start}):i<60?Object.assign(Object.assign({},e),{start:e.start,stop:Ze(Ge(e.start,t)+60)}):e})).sort((e,i)=>Ge(e.start,t)>Ge(i.start,t)?1:Ge(e.start,t)Ge(i.stop,t)?1:-1);let i="00:00:00",s=e.length;for(let a=0;aGe(i,t)?(e.splice(a,0,Object.assign(Object.assign({},o),{start:i,stop:o.start,actions:[]})),s++,a++):Ge(o.start,t)0&&e.push(Object.assign(Object.assign({},e[0]),{start:i,stop:Ze(86400),actions:[]})),e}const ct=e=>e.locale||{language:e.language,number_format:ze.system};function dt(e){return Array.isArray(e)?e:null!=e?[e]:[]}function ut(e){const t=[];let i=[];const s=e=>{e&&t.push(i.length?`in ${i.join("->")}: ${e}`:e)},a=(e,t)=>e.hasOwnProperty(t),o=(e,t)=>Array.isArray(t)?t.some(t=>o(e,t)):"array"==t?Array.isArray(e):"object"==t?typeof e===t&&null!==e:typeof e===t,n=(e,t,i)=>{if(a(e,t)){o(e[t],i)||s(`'${t}' must be of type ${i}`)}else s(`missing required property '${t}'`)},r=(e,t,i)=>{if(!a(e,t))return;o(e[t],i)||s(`'${t}' must be of type ${i}`)},l=(e,t,i)=>{let n=!0;return a(e,t)&&o(e[t],"array")?e[t].some(e=>!o(e,i))&&(s(`'${t}' must be an array with items of type ${i}`),n=!1):n=!1,n};if(r(e,"discover_existing","boolean"),r(e,"standard_configuration","boolean"),r(e,"title",["boolean","string"]),r(e,"time_step","number"),r(e,"show_header_toggle","boolean"),r(e,"show_add_button","boolean"),r(e,"sort_by",["string","array"]),r(e,"include","array"),l(e,"include","string"),r(e,"exclude","array"),l(e,"exclude","string"),r(e,"display_options","object"),a(e,"display_options")&&(i.push("display_options"),r(e.display_options,"primary_info",["string","array"]),r(e.display_options,"secondary_info",["string","array"]),r(e.display_options,"icon","string"),l(e.display_options,"primary_info","string"),l(e.display_options,"secondary_info","string")),i=[],r(e,"groups","array"),a(e,"groups")&&o(e.groups,"array")&&(i.push("groups"),e.groups.forEach((e,t)=>{i=["groups",t],n(e,"name","string"),r(e,"icon","string"),n(e,"include","array"),r(e,"exclude","array"),l(e,"include","string"),l(e,"exclude","string")})),i=[],r(e,"customize","object"),a(e,"customize")&&o(e.customize,"object")&&Object.keys(e.customize).forEach(t=>{if(i=["customize"],o(t,"string")||s(t+" is not allowed"),n(e.customize,t,"object"),a(e.customize,t)&&o(e.customize[t],"object")){i.push(t);const c=e.customize[t];r(c,"name","string"),r(c,"icon","string"),r(c,"actions","array"),l(c,"actions","object")&&c.actions.forEach((e,c)=>{i=["customize",t,c],(e=>{const t=i;r(e,"name","string"),r(e,"icon","string"),n(e,"service","string"),r(e,"service_data","object"),l(e,"service_data","string"),a(e,"service_data")&&o(e.service_data,"object")&&Object.keys(e.service_data).some(e=>!o(e,"string"))&&s("service_data items must have string as index type"),r(e,"variables","object"),a(e,"variables")&&o(e.variables,"object")&&Object.keys(e.variables).forEach(c=>{if(i=t.concat(t,["variables"]),o(c,"string")||s(c+" is not allowed"),n(e.variables,c,"object"),a(e.variables,c)&&o(e.variables[c],"object")){i.push(c);const s=e.variables[c];l(s,"options","object")?s.options.forEach((e,s)=>{i=t.concat(t,["variables",c,"options",s]),n(e,"value","string"),r(e,"name","string"),r(e,"icon","string")}):void 0!==s.min||void 0!==s.max?(r(s,"min","number"),r(s,"max","number"),r(s,"step","number"),r(s,"scale_factor","number"),r(s,"optional","boolean"),r(s,"unit","string")):r(s,"multiline","boolean")}})})(e)}),r(c,"states",["object","array"]),a(c,"states")&&o(c.states,"array")?l(c,"states","string"):a(c,"states")&&o(c.states,"object")&&(n(c.states,"min","number"),n(c.states,"max","number"),r(c.states,"step","number"),r(c.states,"scale_factor","number"),r(c.states,"unit","string"))}}),r(e,"tags",["string","array"]),t.length)throw new Error(`Invalid configuration provided (${t.length} error${t.length>1?"s":""}): ${t.join(", ")}.`)} +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function e$4(e){return o$4({finisher:(r,t)=>{Object.assign(r.prototype[t],e);}})} - - /** + */const ht=2; +/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function o$5(o,r){return o$4({descriptor:t=>{const i={get(){var t;return null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(o)},enumerable:!0,configurable:!0};if(r){const r="symbol"==typeof t?Symbol():"__"+t;i.get=function(){var t;return void 0===this[r]&&(this[r]=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(o)),this[r]};}return i}})} - - var token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g; - var twoDigitsOptional = "[1-9]\\d?"; - var twoDigits = "\\d\\d"; - var threeDigits = "\\d{3}"; - var fourDigits = "\\d{4}"; - var word = "[^\\s]+"; - var literal = /\[([^]*?)\]/gm; - function shorten(arr, sLen) { - var newArr = []; - for (var i = 0, len = arr.length; i < len; i++) { - newArr.push(arr[i].substr(0, sLen)); - } - return newArr; + */ +class mt extends class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}{constructor(e){if(super(e),this.it=I,e.type!==ht)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===I||null==e)return this.ft=void 0,this.it=e;if(e===L)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}mt.directiveName="unsafeHTML",mt.resultType=1;const pt=(e=>(...t)=>({_$litDirective$:e,values:t}))(mt);var _t={generic:{parameter_to_value:"{parameter} na {value}",action_with_parameter:"{action} s {parameter}"},climate:{set_temperature:"nastavit teplotu[ na {temperature}]",set_temperature_hvac_mode_heat:"topení[ na {temperature}]",set_temperature_hvac_mode_cool:"chlazení[ na {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"nastavit režim[ na {hvac_mode}]",set_preset_mode:"nastavit předvolbu[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"zavřít",open_cover:"otevřít",set_cover_position:"nastavit polohu[ na {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"nastavit rychlost[ na {speed}]",set_direction:"nastavit směr[ na {direction}]",oscillate:"nastavit oscilaci[ na {oscillate}]"},humidifier:{set_humidity:"nastavit vlhkost[ na {humidity}]",set_mode:"nastavit režim[ na {mode}]"},input_number:{set_value:"nastavit hodnotu[ na {value}]"},input_select:{select_option:"vybrat možnost[ {option}]"},select:{select_option:"vybrat možnost[ {option}]"},light:{turn_on:"zapnout[ na {brightness} jas]"},media_player:{select_source:"vybrat zdroj[ {source}]"},notify:{notify:"send notification"},script:{script:"spustit"},vacuum:{start_pause:"start / pauza"},water_heater:{set_operation_mode:"nastavit režim[ na {operation_mode}]",set_away_mode:"vypnout režim"}},vt={alarm_control_panel:"poplašný ovládací panel",binary_sensor:"binary sensors",climate:"klima",cover:"rolety",fan:"ventilátory",group:"skupiny",humidifier:"zvlhčovače",input_boolean:"input boolean",input_number:"input number",input_select:"input select",light:"světla",lock:"zámky",media_player:"média přehrávače",notify:"notification",switch:"spínače",vacuum:"vysavače",water_heater:"ohřívače vody"},gt={components:{date:{day_types_short:{daily:"denně",workdays:"pracovní dny",weekend:"víkendy"},day_types_long:{daily:"každý den",workdays:"v pracovní dny",weekend:"o víkendu"},days:"dnů",tomorrow:"zítra",repeated_days:"každý {days}",repeated_days_except:"každý den kromě {excludedDays}",days_range:"od {startDay} do {endDay}",next_week_day:"příští {weekday}"},time:{absolute:"od {time}",interval:"od {startTime} do {endTime}",at_midnight:"od půlnoc",at_noon:"od poledne",at_sun_event:"na {sunEvent}"}},panel:{common:{title:"Plánovač"},overview:{no_entries:"Nejsou žádné položky k zobrazení",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number} vyloučeno {if number is 1} položka {else} položek",hide_excluded:"skrýt vyloučené položky",additional_tasks:"{number} a více {if number is 1} úkol {else} úkolů"},entity_picker:{no_groups_defined:"Nejsou definovány žádné skupiny",no_group_selected:"Nejprve vyberte skupinu",no_entities_for_group:"V této skupině nejsou žádné entity",no_entity_selected:"Nejprve vyberte entitu",no_actions_for_entity:"Pro tuto entitu neexistují žádné akce",make_scheme:"vytvořit schéma",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Nejprve vyberte časový úsek",time_scheme:"Schéma",time_input_mode:"Time control mode"},conditions:{equal_to:"je",unequal_to:"není",all:"Vše",any:"žádný",no_conditions_defined:"Nejsou definovány žádné podmínky",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"chování po spuštění",period:"období"}}},ft={services:_t,domains:vt,ui:gt},yt=Object.freeze({__proto__:null,services:_t,domains:vt,ui:gt,default:ft}),bt={generic:{parameter_to_value:"{parameter} auf {value}",action_with_parameter:"{action} mit {parameter}"},climate:{set_temperature:"Temperatur einstellen[ auf {temperature}]",set_temperature_hvac_mode_heat:"heizen[ auf {temperature}]",set_temperature_hvac_mode_cool:"kühlen[ auf {temperature}]",set_temperature_hvac_mode_heat_cool:"regulieren[ auf {target_temp_low} - {target_temp_high}]",set_hvac_mode:"Modus setzen[ auf {hvac_mode}]",set_preset_mode:"Voreinstellung setzen[ auf {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"schließen",open_cover:"öffnen",set_cover_position:"Position setzen[ auf {position}]",set_cover_tilt_position:"Tilt Position setzen[ auf {tilt_position}]"},fan:{set_speed:"Geschwindigkeit speed[ auf {speed}]",set_direction:"Richtung setzen[ auf {direction}]",oscillate:"Oszillation setzen[ auf {oscillate}]"},humidifier:{set_humidity:"Luftfeuchtigkeit setzen[ auf {humidity}]",set_mode:"Modus setzen[ auf {mode}]"},input_number:{set_value:"Wert setzen[ auf {value}]"},input_select:{select_option:"Option[ {option}] auswählen"},select:{select_option:"Option[ {option}] auswählen"},light:{turn_on:"anschalten[ mit {brightness} Helligkeit]"},media_player:{select_source:"Quelle[ {source}] auswählen"},notify:{notify:"Nachricht senden"},script:{script:"ausführen"},vacuum:{start_pause:"Start / Pause"},water_heater:{set_operation_mode:"Modus setzen[ auf {operation_mode}]",set_away_mode:"Abwesenheitsmodus setzen"}},wt={alarm_control_panel:"Alarmzentrale",binary_sensor:"binary sensors",climate:"Heizung",cover:"Beschattung",fan:"Lüfter",group:"Gruppen",humidifier:"Befeuchter",input_boolean:"input boolean",input_number:"input number",input_select:"input select",light:"Licht",lock:"Schlösser",media_player:"Medienplayer",notify:"notification",switch:"Schalter",vacuum:"Staubsauger",water_heater:"Boiler"},kt={components:{date:{day_types_short:{daily:"täglich",workdays:"Werktags",weekend:"Wochenende"},day_types_long:{daily:"Jeden Tag",workdays:"An Werktagen",weekend:"Am Wochenende"},days:"Tage",tomorrow:"morgen",repeated_days:"jeden {days}",repeated_days_except:"täglich außer {excludedDays}",days_range:"von {startDay} bis {endDay}",next_week_day:"nächsten {weekday}"},time:{absolute:"um {time}",interval:"von {startTime} bis {endTime}",at_midnight:"um Mitternacht",at_noon:"um Mittag",at_sun_event:"beim {sunEvent}"}},panel:{common:{title:"Zeitplaner"},overview:{no_entries:"Es gibt keine Einträge, die angezeigt werden können",backend_error:"Es konnte keine Verbindung mit der Schedulerkomponente hergestellt werden. Es muss als Integration installiert werden, bevor diese Karte verwendet werden kann.",excluded_items:"{number}{if number is 1} ausgeschlossener Eintrag {else} ausgeschlossene Einträge",hide_excluded:"Verstecke ausgeschlossene Einträge",additional_tasks:"{number} weitere {if number is 1} Aufgabe {else} Aufgaben"},entity_picker:{no_groups_defined:"Es gibt keine Gruppe",no_group_selected:"Wähle zuerst eine Gruppe aus",no_entities_for_group:"Es gibt keine Entities in dieser Gruppe",no_entity_selected:"Wähle zuerst eine Entity aus",no_actions_for_entity:"Es gibt keine Aktionen für diese Entity",make_scheme:"Erstelle Zeitplan",multiple:"mehrere"},time_picker:{no_timeslot_selected:"Wähle zuerst ein Zeitfenster aus",time_scheme:"Zeitplan",time_input_mode:"Time control mode"},conditions:{equal_to:"ist",unequal_to:"ist nicht",all:"alle",any:"keine",no_conditions_defined:"Es sind keine Bedingungen definiert",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"Verhalten nach Abschluß",period:"Term"}}},xt={services:bt,domains:wt,ui:kt},$t=Object.freeze({__proto__:null,services:bt,domains:wt,ui:kt,default:xt}),jt={generic:{parameter_to_value:"{parameter} to {value}",action_with_parameter:"{action} with {parameter}"},climate:{set_temperature:"set temperature[ to {temperature}]",set_temperature_hvac_mode_heat:"heat[ to {temperature}]",set_temperature_hvac_mode_cool:"cool[ to {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"set mode[ to {hvac_mode}]",set_preset_mode:"set preset[ to {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"close",open_cover:"open",set_cover_position:"set position[ to {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"set speed[ to {speed}]",set_direction:"set direction[ to {direction}]",oscillate:"set oscillation[ to {oscillate}]"},humidifier:{set_humidity:"set humidity[ to {humidity}]",set_mode:"set mode[ to {mode}]"},input_number:{set_value:"set value[ to {value}]"},input_select:{select_option:"select option[ {option}]"},select:{select_option:"select option[ {option}]"},light:{turn_on:"turn on[ with {brightness} brightness]"},media_player:{select_source:"select source[ {source}]"},notify:{notify:"send notification"},script:{script:"execute"},vacuum:{start_pause:"start / pause"},water_heater:{set_operation_mode:"set mode[ to {operation_mode}]",set_away_mode:"set away mode"}},Ot={alarm_control_panel:"alarm control panel",binary_sensor:"binary sensors",climate:"climate",cover:"covers",fan:"fans",group:"entity groups",humidifier:"humidifiers",input_boolean:"input boolean",input_number:"input number",input_select:"input select",light:"lights",lock:"locks",media_player:"media players",notify:"notification",switch:"switches",vacuum:"vacuums",water_heater:"water heaters"},St={components:{date:{day_types_short:{daily:"daily",workdays:"workdays",weekend:"weekend"},day_types_long:{daily:"every day",workdays:"on workdays",weekend:"in the weekend"},days:"days",tomorrow:"tomorrow",repeated_days:"every {days}",repeated_days_except:"every day except {excludedDays}",days_range:"from {startDay} to {endDay}",next_week_day:"next {weekday}"},time:{absolute:"at {time}",interval:"from {startTime} to {endTime}",at_midnight:"at midnight",at_noon:"at noon",at_sun_event:"at {sunEvent}"}},panel:{common:{title:"Scheduler"},overview:{no_entries:"There are no items to show",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number} excluded {if number is 1} item {else} items",hide_excluded:"hide excluded items",additional_tasks:"{number} more {if number is 1} task {else} tasks"},entity_picker:{no_groups_defined:"There are no groups defined",no_group_selected:"Select a group first",no_entities_for_group:"There are no entities in this group",no_entity_selected:"Select an entity first",no_actions_for_entity:"There are no actions for this entity",make_scheme:"make scheme",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Select a timeslot first",time_scheme:"Scheme",time_input_mode:"Time control mode"},conditions:{equal_to:"is",unequal_to:"is not",all:"all",any:"any",no_conditions_defined:"There are no conditions defined",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"behaviour after completion",period:"period"},card_editor:{tabs:{entities:"Entities",other:"Other"},fields:{title:{heading:"Title of the card",options:{standard:"standard",hidden:"hidden",custom:"custom"},custom_title:"Custom title"},discover_existing:{heading:"Show all schedules",description:"This sets the 'discover existing' parameter. Previously created schedules will be automatically added to the card. "},time_step:{heading:"Time step",description:"Resolution (in minutes) for creating schedules"},sort_by:{heading:"Sorting options",description:"Order in which the schedules appear in the card",options:{relative_time:"Time remaining until next action",title:"Displayed title of the schedule",state:"Show active schedules on top"}},display_format_primary:{heading:"Displayed primary info",description:"Configure which label is used for schedules in the overview",options:{default:"Schedule name",entity_action:"Summary of task"}},display_format_secondary:{heading:"Displayed secondary info",description:"Configure what additional properties are visible in the overview",options:{relative_time:"Time remaining until next action",time:"Configured time for next action",days:"Repeated days of the week",additional_tasks:"Number of additional tasks"}},show_header_toggle:{heading:"Show header toggle",description:"Show toggle switch at the top of the card for enabling/enabling all entities"},tags:{heading:"Tags",description:"Use tags to divide schedules between multiple cards"},entities:{heading:"Included entities",description:"Select the entities that you want to control using the scheduler. You can click on a group to open it. Note that some entities (such as sensors) can only be used for conditions, not for actions.",included_number:"{number}/{total} selected"}}}}},zt={services:jt,domains:Ot,ui:St},Et=Object.freeze({__proto__:null,services:jt,domains:Ot,ui:St,default:zt}),Ct={generic:{parameter_to_value:"{parameter} a {value}",action_with_parameter:"{action} con {parameter}"},climate:{set_temperature:"establecer temperatura[ a {temperature}]",set_temperature_hvac_mode_heat:"calefacción[ a {temperature}]",set_temperature_hvac_mode_cool:"frío[ a {temperature}]",set_temperature_hvac_mode_heat_cool:"regular[ entre {target_temp_low} - {target_temp_high}]",set_hvac_mode:"establecer modo[ a {hvac_mode}]",set_preset_mode:"establecer preajuste[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"cerrado",open_cover:"abierto",set_cover_position:"establecer posición[ a {position}]",set_cover_tilt_position:"establecer inclinación[ a {tilt_position}]"},fan:{set_speed:"establecer velocidad [ a {speed}]",set_direction:"establecer dirección[ a {direction}]",oscillate:"establecer oscilación[ a {oscillate}]"},humidifier:{set_humidity:"establecer humedad[ a {humidity}]",set_mode:"establecer modo[ a {mode}]"},input_number:{set_value:"establecer valor[ a {value}]"},input_select:{select_option:"seleccionar opción[ {option}]"},select:{select_option:"seleccionar opción[ {option}]"},light:{turn_on:"encender[ con brillo en {brightness}]"},media_player:{select_source:"seleccionar fuente[ {source}]"},notify:{notify:"enviar notificación"},script:{script:"ejecutar"},vacuum:{start_pause:"iniciar / pausar"},water_heater:{set_operation_mode:"establecer modo[ a {operation_mode}]",set_away_mode:"establecer modo fuera de casa"}},At={alarm_control_panel:"panel de control de alarma",binary_sensor:"binary sensors",climate:"climatización",cover:"cortinas",fan:"ventiladores",group:"grupos",humidifier:"humidificadores",input_boolean:"input boolean",input_number:"input number",input_select:"input select",light:"luces",lock:"cerraduras",media_player:"reproductores",notify:"notification",switch:"interruptores",vacuum:"aspiradores",water_heater:"calentador de agua"},Dt={components:{date:{day_types_short:{daily:"a diario",workdays:"días hábiles",weekend:"fin de semana"},day_types_long:{daily:"todos los días",workdays:"en días hábiles",weekend:"en el fin de semana"},days:"días",tomorrow:"mañana",repeated_days:"cada {days}",repeated_days_except:"cada dia excepto {excludedDays}",days_range:"de {startDay} a {endDay}",next_week_day:"próximo {weekday}"},time:{absolute:"a las {time}",interval:"desde las {startTime} a las {endTime}",at_midnight:"a la medianoche",at_noon:"a la mediodía",at_sun_event:"a la {sunEvent}"}},panel:{common:{title:"Programador"},overview:{no_entries:"No hay ningún elemento que mostrar",backend_error:"Fallo de conexión con Scheduler component. Debe ser installado como integración antes de poder usar este panel.",excluded_items:"{number} {if number is 1} elemento excluido {else} elementos excluidos",hide_excluded:"ocultar elementos excluidos",additional_tasks:"{number} {if number is 1} tarea adicional {else} tareas adicionales"},entity_picker:{no_groups_defined:"No hay ningún grupo definido",no_group_selected:"selecciona un grupo primero",no_entities_for_group:"no hay ninguna entidad en este grupo",no_entity_selected:"selecciona una entidad primero",no_actions_for_entity:"no hay acciones para esta entidad",make_scheme:"crear planificación",multiple:"Múltiple"},time_picker:{no_timeslot_selected:"selecciona un bloque de tiempo primero",time_scheme:"Planificación",time_input_mode:"Time control mode"},conditions:{equal_to:"igual a",unequal_to:"desigual a",all:"todos",any:"cualquiera",no_conditions_defined:"no hay ninguna condición definida",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"acción después de la finalización",period:"período"}}},Mt={services:Ct,domains:At,ui:Dt},Tt=Object.freeze({__proto__:null,services:Ct,domains:At,ui:Dt,default:Mt}),Nt={generic:{parameter_to_value:"{parameter} {value} jaoks",action_with_parameter:"{action} väärtusega {parameter}"},climate:{set_temperature:"vali temperatuur [{temperature}]",set_temperature_hvac_mode_heat:"küte[ @ {temperature}]",set_temperature_hvac_mode_cool:"jahutus [ @ {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"vali režiim [{hvac_mode}]",set_preset_mode:"eelseade[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"sulge",open_cover:"ava",set_cover_position:"sea asendisse[{position}]",set_cover_tilt_position:"sea ribide kalle [ asendisse {tilt_position}]"},fan:{set_speed:"vali kiirus[ @ {speed}]",set_direction:"vali suund[ @ {direction}]",oscillate:"vali hajutus[ @ {oscillate}]"},humidifier:{set_humidity:"sea niiskus[ {humidity}]",set_mode:"vali režiim [{mode}]"},input_number:{set_value:"vali väärtus[ {value}]"},input_select:{select_option:"valik[ {option}]"},select:{select_option:"valik[ {option}]"},light:{turn_on:"lülita sisse[ heledusega {brightness}]"},media_player:{select_source:"vali sisend[ {source}]"},notify:{notify:"send notification"},script:{script:"käivita"},vacuum:{start_pause:"alusta/ootele"},water_heater:{set_operation_mode:"vali režiim [{operation_mode}]",set_away_mode:"kodust ära"}},Lt={alarm_control_panel:"valvepaneel",binary_sensor:"binary sensors",climate:"kliimaseade",cover:"aknakatted",fan:"ventilaatorid",group:"grupid",humidifier:"niisutajad",input_boolean:"tõeväärtus",input_number:"numbriline valik",input_select:"valikmenüü",light:"valgustid",lock:"lukud",media_player:"meediamängijad",notify:"notification",switch:"lülitid",vacuum:"tolmuimejad",water_heater:"veeboilerid"},It={components:{date:{day_types_short:{daily:"iga päev",workdays:"tööpäevadel",weekend:"nädalavahetusel"},day_types_long:{daily:"iga päev",workdays:"tööpäevadel",weekend:"nädalavahetusel"},days:"päeva",tomorrow:"homme",repeated_days:"iga {days} järel",repeated_days_except:"iga päev aga mitte {excludedDays}",days_range:"{startDay} kuni {endDay}",next_week_day:"järgmisel {weekday}"},time:{absolute:"{time}",interval:"{startTime} kuni {endTime}",at_midnight:"keskööl",at_noon:"keskpäeval",at_sun_event:"{sunEvent}"}},panel:{common:{title:"Ajastaja"},overview:{no_entries:"Ajastused puuduvad",backend_error:"Ajastaja sidumine puudub. Sidumine tuleb luua enne selle kaardi kasutamist.",excluded_items:"välja on jäetud {number} {if number is 1} ajastus {else} ajastust",hide_excluded:"peida välja jäetud ajastused",additional_tasks:"veel {number} {if number is 1} ajastus {else} ajastust"},entity_picker:{no_groups_defined:"Gruppe pole valitud",no_group_selected:"Vali alustuseks grupid",no_entities_for_group:"Selles grupis puuduvad olemid",no_entity_selected:"Vali alustuseks olem",no_actions_for_entity:"Selle olemi jaoks pole tegevusi",make_scheme:"loo skeem",multiple:"Mitu"},time_picker:{no_timeslot_selected:"Alustuseks vali ajavahemik",time_scheme:"Kkeem",time_input_mode:"Time control mode"},conditions:{equal_to:"võrdub",unequal_to:"ei võrdu",all:"kõik",any:"iga",no_conditions_defined:"Tingimusi pole määratud",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"toiming peale käivitumist",period:"periood"}}},Pt={services:Nt,domains:Lt,ui:It},qt=Object.freeze({__proto__:null,services:Nt,domains:Lt,ui:It,default:Pt}),Rt={generic:{parameter_to_value:"{parameter} vers {value}",action_with_parameter:"{action} avec {parameter}"},climate:{set_temperature:"ajuster la température[ à {temperature}]",set_temperature_hvac_mode_heat:"chauffe[ à {temperature}]",set_temperature_hvac_mode_cool:"refroidit[ à {temperature}]",set_temperature_hvac_mode_heat_cool:"régler[ à {target_temp_low} - {target_temp_high}]",set_hvac_mode:"ajuster le mode[ à {hvac_mode}]",set_preset_mode:"choisir le pré-réglage[ {preset_mode}]",set_fan_mode:"ajuster le mode de ventilation[ à {fan_mode}]"},cover:{close_cover:"fermer",open_cover:"ouvrir",set_cover_position:"ajuster la position[ à {position}]",set_cover_tilt_position:"régler les volets[ à {tilt_position}]"},fan:{set_speed:"ajuster la vitesse[ à {speed}]",set_direction:"ajuster l'orientation[ vers {direction}]",oscillate:"ajuster l'oscillation[ à {oscillate}]"},humidifier:{set_humidity:"ajuster l'humidité[ à {humidity}]",set_mode:"ajuster le mode[ à {mode}]"},input_number:{set_value:"ajuster la valeur[ à {value}]"},input_select:{select_option:"choisir l'option[ {option}]"},select:{select_option:"choisir l'option[ {option}]"},light:{turn_on:"allumer[ avec une luminosité de {brightness}]"},media_player:{select_source:"choisir la source[ {source}]"},notify:{notify:"envoyer une notification"},script:{script:"exécuter"},vacuum:{start_pause:"démarrer / pause"},water_heater:{set_operation_mode:"ajuster le mode[ à {operation_mode}]",set_away_mode:"choisir le mode absent"}},Ut={alarm_control_panel:"panneau de contrôle de l'alarme",binary_sensor:"capteurs binaires",climate:"thermostat",cover:"volet",fan:"ventilateur",group:"groupe",humidifier:"humidificateur",input_boolean:"entrée booléenne",input_number:"entrée numérique",input_select:"entrée de sélection",light:"lumière",lock:"serrure",media_player:"lecteur multimédia",notify:"notification",switch:"interrupteur",vacuum:"aspirateur",water_heater:"chauffe eau"},Ht={components:{date:{day_types_short:{daily:"quotidien",workdays:"jours de travail",weekend:"weekend"},day_types_long:{daily:"chaque jour",workdays:"en semaine",weekend:"le weekend"},days:"jours",tomorrow:"demain",repeated_days:"chaque {days}",repeated_days_except:"chaque jour sauf {excludedDays}",days_range:"de {startDay} à {endDay}",next_week_day:"{weekday} prochain"},time:{absolute:"à {time}",interval:"de {startTime} à {endTime}",at_midnight:"à minuit",at_noon:"à midi",at_sun_event:"au {sunEvent}"}},panel:{common:{title:"Planificateur"},overview:{no_entries:"il n'y a pas d'entrée à montrer",backend_error:"Impossible de se connecter au composant du planificateur. Elle doit être installée en tant qu'intégration avant que cette carte puisse être utilisée.",excluded_items:"{number} {if number is 1}entrée exclue{else}entrées exclues",hide_excluded:"cacher les entrées exclues",additional_tasks:"{number} {if number is 1}tâche à venir{else}tâches à venir"},entity_picker:{no_groups_defined:"Aucun groupe défini",no_group_selected:"Choisir un groupe en premier",no_entities_for_group:"Il n'y a pas d'entité dans ce groupe",no_entity_selected:"Choisir une entité en premier",no_actions_for_entity:"Il n'y a pas d'action pour cette entité",make_scheme:"créer un schéma",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Choisir d'abord une plage horaire",time_scheme:"Schéma",time_input_mode:"contrôle temporel"},conditions:{equal_to:"égal à",unequal_to:"pas égal à",all:"tous",any:"tout",no_conditions_defined:"Il n'y a pas de condition définie",track_conditions:"Ré-évaluer lorsque la condition change"},options:{repeat_type:"comportement après l'achèvement",period:"période"}}},Vt={services:Rt,domains:Ut,ui:Ht},Ft=Object.freeze({__proto__:null,services:Rt,domains:Ut,ui:Ht,default:Vt}),Bt={generic:{parameter_to_value:"{parameter} ל {value}",action_with_parameter:"{action} עם {parameter}"},climate:{set_temperature:"קבע טמפרטורה[ ל {temperature}]",set_temperature_hvac_mode_heat:"חימום[ ל {temperature}]",set_temperature_hvac_mode_cool:"קירור[ ל {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"קבע מצב עבודה[ ל {hvac_mode}]",set_preset_mode:"קבע הגדרה[ ל {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"סגירה",open_cover:"פתיחה",set_cover_position:"קבע מיקום[ ל {position}]",set_cover_tilt_position:"קבע הטיה[ ל {tilt_position}]"},fan:{set_speed:"קבע מהירות[ ל {speed}]",set_direction:"קבע כיוון[ ל {direction}]",oscillate:"קבע תנודה[ ל {oscillate}]"},humidifier:{set_humidity:"קבע לחות[ ל {humidity}]",set_mode:"קבע מצב עבודה[ ל {mode}]"},input_number:{set_value:"קבע ערך[ ל {value}]"},input_select:{select_option:"בחר אפשרות[ {option}]"},select:{select_option:"בחר אפשרות[ {option}]"},light:{turn_on:"הדלקה[ בעוצמה של {brightness}]"},media_player:{select_source:"select source[ {source}]"},notify:{notify:"send notification"},script:{script:"בצע"},vacuum:{start_pause:"התחל / הפסק"},water_heater:{set_operation_mode:"קבע מצב עבודה[ ל {operation_mode}]",set_away_mode:"קבע מצב מוץ לבית"}},Yt={alarm_control_panel:"בקרת אזעקה",binary_sensor:"binary sensors",climate:"מזג אוויר",cover:"תריסים",fan:"מאווררים",group:"קבוצות יישויות",humidifier:"מכשירי אדים",input_boolean:"כניסה בוליאנית",input_number:"כניסה מספרית",input_select:"בחירת כניסה",light:"תאורה",lock:"מנעולים",media_player:"נגני מדיה",notify:"notification",switch:"מפסקים",vacuum:"שואבי אבק",water_heater:"מחממי מים"},Wt={components:{date:{day_types_short:{daily:"כל יום",workdays:"ימי חול",weekend:"סוף שבוע"},day_types_long:{daily:"כל יום",workdays:"בימי חול",weekend:"בסוף השבוע"},days:"ימים",tomorrow:"מחר",repeated_days:"בכל {days}",repeated_days_except:"בכל יום פרט ל {excludedDays}",days_range:"מ- {startDay} ועד- {endDay}",next_week_day:"הבא {weekday}"},time:{absolute:"בשעה {time}",interval:"משעה {startTime} עד שעה {endTime}",at_midnight:"בחצות הלילה",at_noon:"בחצות היום",at_sun_event:"ב {sunEvent}"}},panel:{common:{title:"לוח זמנים"},overview:{no_entries:"אין פריטים להצגה",backend_error:"אין אפשרות להתחבר לרכיב התזמונים. נדרש להתקין את הרכיב באינטגרציה לפני השימוש בכרטיס.",excluded_items:"{number} לא נכלל {if number is 1} פריט {else} פריטים",hide_excluded:"הסתר פריטים לא כלולים",additional_tasks:"{number} נוסף {if number is 1} משימה {else} משימות"},entity_picker:{no_groups_defined:"לא הוגדרו קבוצות",no_group_selected:"בחר קבוצה תחילה",no_entities_for_group:"אין יישויות בקבוצה זו",no_entity_selected:"תחילה בחר יישות",no_actions_for_entity:"אין פעולות עבור יישות זאת",make_scheme:"בנה סכימה",multiple:"מספר יישויות"},time_picker:{no_timeslot_selected:"בחר משבצת זמן קודם",time_scheme:"סכימה",time_input_mode:"Time control mode"},conditions:{equal_to:"שווה ל",unequal_to:"שונה מ",all:"כל התנאים",any:"אחד מהתנאים",no_conditions_defined:"לא הוגדרו תנאים",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"התנהגות לאחר הפעלה",period:"פרק זמן"}}},Gt={services:Bt,domains:Yt,ui:Wt},Zt=Object.freeze({__proto__:null,services:Bt,domains:Yt,ui:Wt,default:Gt}),Kt={generic:{parameter_to_value:"{parameter} to {value}",action_with_parameter:"{action} with {parameter}"},climate:{set_temperature:"hőmérséklet[ to {temperature}]",set_temperature_hvac_mode_heat:"hőmérséklet[ to {temperature}]",set_temperature_hvac_mode_cool:"hőmérséklet[ to {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"mód beállítása[ to {hvac_mode}]",set_preset_mode:"preset beállítása[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"zárás",open_cover:"nyitás",set_cover_position:"változtass pozíciót[ to {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"set speed[ to {speed}]",set_direction:"set direction[ to {direction}]",oscillate:"set oscillation[ to {oscillate}]"},humidifier:{set_humidity:"set humidity[ to {humidity}]",set_mode:"mód beállítása[ to {mode}]"},input_number:{set_value:"érték beállítása[ to {value}]"},input_select:{select_option:"opció kiválasztása[ {option}]"},select:{select_option:"opció kiválasztása[ {option}]"},light:{turn_on:"bekapcsolás[ with {brightness} brightness]"},media_player:{select_source:"forrás kiválasztása[ {source}]"},notify:{notify:"send notification"},script:{script:"kezdés"},vacuum:{start_pause:"start / pause"},water_heater:{set_operation_mode:"mód beállítása[ to {operation_mode}]",set_away_mode:"set away mode"}},Jt={alarm_control_panel:"alarm control panel",binary_sensor:"binary sensors",climate:"termosztát",cover:"redőny",fan:"ventilátor",group:"csoportok",humidifier:"humifiers",input_boolean:"logikai bemenet",input_number:"szám bemenet",input_select:"legördülő bemenet",light:"lámpa",lock:"locks",media_player:"lejátszó",notify:"notification",switch:"kapcsoló",vacuum:"pórszívó",water_heater:"water heaters"},Xt={components:{date:{day_types_short:{daily:"minden nap",workdays:"munkanapokon",weekend:"hétvégén"},day_types_long:{daily:"minden nap",workdays:"munkanapokon",weekend:"hétvégén"},days:"Napokon",tomorrow:"tomorrow",repeated_days:"every {days}",repeated_days_except:"every day except {excludedDays}",days_range:"from {startDay} to {endDay}",next_week_day:"következő {weekday}"},time:{absolute:"{time}-kor",interval:"{startTime} - {endTime}",at_midnight:"éjfélkor",at_noon:"délben",at_sun_event:"{sunEvent}kor"}},panel:{common:{title:"Időzítések"},overview:{no_entries:"Nincs megjeleníthető elem",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number} excluded {if number is 1} item {else} items",hide_excluded:"hide excluded items",additional_tasks:"még {number} feladat"},entity_picker:{no_groups_defined:"Nincsenek deffiniált csoportok",no_group_selected:"Előbb egy csoportot szükséges választani",no_entities_for_group:"Ebben a csoportban nem találhatók entitások",no_entity_selected:"Előbb egy entitást szükséges választani",no_actions_for_entity:"Ehhez az entitáshoz nem tartoznak műveletek",make_scheme:"make scheme",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Select a timeslot first",time_scheme:"Scheme",time_input_mode:"Time control mode"},conditions:{equal_to:"is",unequal_to:"is not",all:"all",any:"any",no_conditions_defined:"There are no conditions defined",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"behaviour after triggering",period:"időszak"}}},Qt={services:Kt,domains:Jt,ui:Xt},ei=Object.freeze({__proto__:null,services:Kt,domains:Jt,ui:Xt,default:Qt}),ti={generic:{parameter_to_value:"{parameter} a {value}",action_with_parameter:"{action} con {parameter}"},climate:{set_temperature:"imposta temperatura[ a {temperature}]",set_temperature_hvac_mode_heat:"riscaldamento[ a {temperature}]",set_temperature_hvac_mode_cool:"raffrescamento[ a {temperature}]",set_temperature_hvac_mode_heat_cool:"regola[ a {target_temp_low} - {target_temp_high}]",set_hvac_mode:"imposta modalità[ a {hvac_mode}]",set_preset_mode:"imposta programmazione[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"chiuso",open_cover:"aperto",set_cover_position:"imposta posizione[ su {position}]",set_cover_tilt_position:"imposta inclinazione[ su {tilt_position}]"},fan:{set_speed:"imposta velocità[ a {speed}]",set_direction:"imposta direzione[ a {direction}]",oscillate:"imposta oscillazione[ a {oscillate}]"},humidifier:{set_humidity:"imposta umidità[ a {humidity}]",set_mode:"imposta modalità[ a {mode}]"},input_number:{set_value:"imposta valore[ a {value}]"},input_select:{select_option:"seleziona opzione[ {option}]"},select:{select_option:"seleziona opzione[ {option}]"},light:{turn_on:"accendi[ con il {brightness} di luminosità]"},media_player:{select_source:"seleziona sorgente[ {source}]"},notify:{notify:"invia notifica"},script:{script:"esegui"},vacuum:{start_pause:"avvia / pausa"},water_heater:{set_operation_mode:"imposta modalità[ a {operation_mode}]",set_away_mode:"imposta fuori casa"}},ii={alarm_control_panel:"pannello di controllo allarme",binary_sensor:"binary sensors",climate:"clima",cover:"serrande",fan:"ventole",group:"gruppi",humidifier:"umidificatori",input_boolean:"input booleani",input_number:"input numerici",input_select:"input select",light:"luci",lock:"lucchetti",media_player:"media player",notify:"notification",switch:"interruttori",vacuum:"aspirapolveri",water_heater:"scaldabagno"},si={components:{date:{day_types_short:{daily:"giornaliero",workdays:"giorni lavorativi",weekend:"weekend"},day_types_long:{daily:"ogni giorno",workdays:"nei giorni lavorativi",weekend:"nel weekend"},days:"giorni",tomorrow:"domani",repeated_days:"ogni {days}",repeated_days_except:"ogni giorno tranne {excludedDays}",days_range:"{if startDay is domenica} dalla domenica {else} dal {startDay} {if endDay is domenica} alla domenica {else} al {endDay}",next_week_day:"prossimo {weekday}"},time:{absolute:"alle {time}",interval:"dalle {startTime} alle {endTime}",at_midnight:"a mezzanotte",at_noon:"a mezzogiorno",at_sun_event:"al {sunEvent}"}},panel:{common:{title:"Schedulatore"},overview:{no_entries:"Non ci sono oggetti da visualizzare",backend_error:"Impossibile connettersi con il componente scheduler. Deve essere installato come integrazione prima di poter utilizzare questa card.",excluded_items:"{number} {if number is 1} oggetto escluso {else} oggetti esclusi",hide_excluded:"Nascondi oggetti esclusi",additional_tasks:"{number} attività in più"},entity_picker:{no_groups_defined:"Non ci sono gruppi definiti",no_group_selected:"Seleziona prima un gruppo",no_entities_for_group:"Non ci sono entità in questo gruppo",no_entity_selected:"Seleziona prima un'entità",no_actions_for_entity:"Non ci sono azioni per questa entità",make_scheme:"crea schema",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Seleziona prima una fascia oraria",time_scheme:"Schema",time_input_mode:"Time control mode"},conditions:{equal_to:"uguale",unequal_to:"non uguale",all:"tutte",any:"qualunque",no_conditions_defined:"Non ci sono condizioni definite",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"comportamento dopo il completamento",period:"periodo"}}},ai={services:ti,domains:ii,ui:si},oi=Object.freeze({__proto__:null,services:ti,domains:ii,ui:si,default:ai}),ni={generic:{parameter_to_value:"{parameter} naar {value}",action_with_parameter:"{action} met {parameter}"},climate:{set_temperature:"temperatuur instellen[ naar {temperature}]",set_temperature_hvac_mode_heat:"verwarmen[ naar {temperature}]",set_temperature_hvac_mode_cool:"koelen[ naar {temperature}]",set_temperature_hvac_mode_heat_cool:"reguleren[ naar {target_temp_low} - {target_temp_high}]",set_hvac_mode:"modus aanpassen[ naar {hvac_mode}]",set_preset_mode:"programma[ {preset_mode}] instellen",set_fan_mode:"ventilatiemodus aanpassen[ naar {fan_mode}]"},cover:{close_cover:"sluiten",open_cover:"openen",set_cover_position:"positie instellen[ naar {position}]",set_cover_tilt_position:"hellingshoek instellen[ naar {tilt_position}]"},fan:{set_speed:"snelheid instellen[ op {speed}]",set_direction:"richting instellen[ naar {direction}]",oscillate:"zet oscillatie[ naar {oscillate}]"},humidifier:{set_humidity:"luchtvochtigheid instellen [ op {humidity}]",set_mode:"modus aanpassen[ naar {mode}]"},input_number:{set_value:"waarde aanpassen[ naar {value}]"},input_select:{select_option:"selecteer optie[ {option}]"},select:{select_option:"selecteer optie[ {option}]"},light:{turn_on:"inschakelen[ met {brightness} helderheid]"},media_player:{select_source:"kies ingang[ {source}]"},notify:{notify:"notificatie sturen"},script:{script:"uitvoeren"},vacuum:{start_pause:"start / pauzeer"},water_heater:{set_operation_mode:"modus aanpassen[ naar {operation_mode}]",set_away_mode:"stel afwezigheidsmode in"}},ri={alarm_control_panel:"alarmsystemen",binary_sensor:"binaire sensoren",climate:"verwarming",cover:"zonwering",fan:"ventilatie",group:"groepen",humidifier:"luchtbevochtigers",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",select:"select",light:"verlichting",lock:"sloten",media_player:"mediaspelers",notify:"notificatie",switch:"schakelaars",vacuum:"stofzuigers",water_heater:"waterverwarming"},li={components:{date:{day_types_short:{daily:"dagelijks",workdays:"werkdagen",weekend:"weekend"},day_types_long:{daily:"iedere dag",workdays:"doordeweeks",weekend:"in het weekend"},days:"dagen",tomorrow:"morgen",repeated_days:"elke {days}",repeated_days_except:"elke dag behalve {excludedDays}",days_range:"van {startDay} tot {endDay}",next_week_day:"volgende week {weekday}"},time:{absolute:"om {time}",interval:"van {startTime} tot {endTime}",at_midnight:"om middernacht",at_noon:"om 12:00",at_sun_event:"bij {sunEvent}"}},panel:{common:{title:"Tijdplanner"},overview:{no_entries:"Er zijn geen items aangemaakt",backend_error:"Er kon geen verbinding worden gemaakt met het Scheduler component. Deze moet als integratie zijn geinstalleerd voordat deze kaart gebruikt kan worden.",excluded_items:"{number} uitgesloten {if number is 1} item {else} items",hide_excluded:"verberg uitgesloten items",additional_tasks:"{number} overige {if number is 1} taak {else} taken"},entity_picker:{no_group_selected:"Selecteer eerst een groep",no_entity_selected:"Selecteer eerst een entiteit",no_groups_defined:"Er zijn geen groepen gedefinieerd",no_entities_for_group:"Deze groep heeft geen entiteiten",no_actions_for_entity:"Deze entiteit heeft geen acties",make_scheme:"maak schema",multiple:"Meerdere"},time_picker:{no_timeslot_selected:"Kies eerst een tijdsslot",time_scheme:"Schema",time_input_mode:"Invoermodus voor tijd"},conditions:{equal_to:"is",unequal_to:"is niet",all:"en",any:"of",no_conditions_defined:"Er zijn geen voorwaarden gedefinieerd",track_conditions:"Herevalueer wanneer condities veranderen"},options:{repeat_type:"gedrag na voltooiing",period:"periode"}}},ci={services:ni,domains:ri,ui:li},di=Object.freeze({__proto__:null,services:ni,domains:ri,ui:li,default:ci}),ui={generic:{parameter_to_value:"{parameter} til {value}",action_with_parameter:"{action} med {parameter}"},climate:{set_temperature:"sett temperatur[ til {temperature}]",set_temperature_hvac_mode_heat:"sett temperatur[ til {temperature}]",set_temperature_hvac_mode_cool:"sett temperatur[ til {temperature}]",set_temperature_hvac_mode_heat_cool:"reguler[ til {target_temp_low} - {target_temp_high}]",set_hvac_mode:"sett modus[ til {hvac_mode}]",set_preset_mode:"sett forhåndsvalg[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"lukk",open_cover:"åpne",set_cover_position:"sett posisjon[ til {position}]",set_cover_tilt_position:"sett vippestilling[ til {tilt_position}]"},fan:{set_speed:"sett hastighet[ til {speed}]",set_direction:"sett retning[ til {direction}]",oscillate:"sett svingning[ til {oscillate}]"},humidifier:{set_humidity:"sett luftfuktighet[ til {humidity}]",set_mode:"sett modus[ til {mode}]"},input_number:{set_value:"sett verdi[ til {value}]"},input_select:{select_option:"velg[ {option}]"},select:{select_option:"velg[ {option}]"},light:{turn_on:"slå på[ med {brightness} lysstyrke]"},media_player:{select_source:"velg kilde[ {source}]"},notify:{notify:"send notifikasjon"},script:{script:"utfør"},vacuum:{start_pause:"start / pause"},water_heater:{set_operation_mode:"sett modus[ til {operation_mode}]",set_away_mode:"sett bortemodus"}},hi={alarm_control_panel:"alarmpanel",binary_sensor:"binary sensors",climate:"klima",cover:"solskjerming",fan:"vifter",group:"grupper",humidifier:"luftfuktere",input_boolean:"input boolsk",input_number:"input nummer",input_select:"input valg",light:"lys",lock:"låser",media_player:"mediaspillere",notify:"notification",switch:"brytere",vacuum:"støvsugere",water_heater:"varmtvannsberedere"},mi={components:{date:{day_types_short:{daily:"hver dag",workdays:"ukedager",weekend:"helg"},day_types_long:{daily:"hver dag",workdays:"ukedager",weekend:"helg"},days:"Dager",tomorrow:"imorgen",repeated_days:"hver {days}",repeated_days_except:"hver dag unntatt {excludedDays}",days_range:"fra {startDay} til {endDay}",next_week_day:"neste {weekday}"},time:{absolute:"kl. {time}",interval:"fra {startTime} til {endTime}",at_midnight:"ved midnatt",at_noon:"kl. 12.00",at_sun_event:"ved {sunEvent}"}},panel:{common:{title:"Tidsplan"},overview:{no_entries:"Det er ingen definerte tidsplaner å vise",backend_error:"Kunne ikke koble til tidsplankomponenten. Den må installeres som en integrasjon før dette kortet kan benyttes.",excluded_items:"{number} ekskludert {if number is 1} element {else} elementer",hide_excluded:"skjul ekskluderte elementer",additional_tasks:"{number} flere {if number is 1} oppgaver {else} oppgaver"},entity_picker:{no_groups_defined:"Ingen grupper definert",no_group_selected:"Velg en gruppe først",no_entities_for_group:"Det finnes ingen entiteter i denne gruppen",no_entity_selected:"Velg en entitet først",no_actions_for_entity:"Det finnes ingen handlinger for denne entiteten",make_scheme:"lag tidsplan",multiple:"Flere"},time_picker:{no_timeslot_selected:"Velg tidsluke først",time_scheme:"Tidsplan",time_input_mode:"Time control mode"},conditions:{equal_to:"er",unequal_to:"er ikke",all:"alle",any:"any",no_conditions_defined:"Ingen vilkår definert",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"oppførsel etter fullføring",period:"periode"}}},pi={services:ui,domains:hi,ui:mi},_i=Object.freeze({__proto__:null,services:ui,domains:hi,ui:mi,default:pi}),vi={generic:{parameter_to_value:"{parameter} na {value}",action_with_parameter:"{action} z {parameter}"},climate:{set_temperature:"ustaw temperaturę[ na {temperature}]",set_temperature_hvac_mode_heat:"grzej[ do {temperature}]",set_temperature_hvac_mode_cool:"chłodź[ do {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"ustaw tryb[ na {hvac_mode}]",set_preset_mode:"ustaw preset[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"zamknij",open_cover:"otwórz",set_cover_position:"ustaw pozycję[ na {position}]",set_cover_tilt_position:"ustaw pozycję lameli[ na {tilt_position}]"},fan:{set_speed:"ustaw prędkość[ na {speed}]",set_direction:"ustaw kierunek[ na {direction}]",oscillate:"ustaw oscylacje[ na {oscillate}]"},humidifier:{set_humidity:"ustaw wilgotność[ na {humidity}]",set_mode:"ustaw tryb[ na {mode}]"},input_number:{set_value:"ustaw wartość[ na {value}]"},input_select:{select_option:"wybierz opcję[ {option}]"},select:{select_option:"wybierz opcję[ {option}]"},light:{turn_on:"zapal[ z jasnością {brightness}]"},media_player:{select_source:"wybierz źródło[ {source}]"},notify:{notify:"send notification"},script:{script:"wykonaj"},vacuum:{start_pause:"start / pauza"},water_heater:{set_operation_mode:"ustaw tryb[ na {operation_mode}]",set_away_mode:"ustaw tryb nieobecności"}},gi={alarm_control_panel:"panel kontrolny alarmu",binary_sensor:"binary sensors",climate:"klimatyzacja",cover:"rolety",fan:"wentylatory",group:"grupy",humidifier:"nawilżacze",input_boolean:"wejście logiczne",input_number:"wejście liczbowe",input_select:"wybór wejścia",light:"światła",lock:"zamki",media_player:"odtwarzacze",notify:"notification",switch:"przełączniki",vacuum:"odkurzacze",water_heater:"podgrzewacze wody"},fi={components:{date:{day_types_short:{daily:"codziennie",workdays:"robocze",weekend:"weekendy"},day_types_long:{daily:"codziennie",workdays:"w dni robocze",weekend:"podczas weekendu"},days:"dni",tomorrow:"jutro",repeated_days:"co {days} dni",repeated_days_except:"coddziennie z wyjątkiem {excludedDays}",days_range:"od {startDay} do {endDay}",next_week_day:"następna {weekday}"},time:{absolute:"o {time}",interval:"od {startTime} do {endTime}",at_midnight:"o północ",at_noon:"o południe",at_sun_event:"o {sunEvent}"}},panel:{common:{title:"Harmonogram"},overview:{no_entries:"Nie ma elementów do pokazania",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number} wykluczona {if number is 1} pozycja {else} pozycje",hide_excluded:"ukryj wykluczone pozycje",additional_tasks:"{number} dodatkowe {if number is 1} zadanie {else} zadań(nia)"},entity_picker:{no_groups_defined:"Nie ma zdefiniowanych grup",no_group_selected:"Najpierw wybierz grupę",no_entities_for_group:"Nie ma encji w tej grupie",no_entity_selected:"Najpierw wybierz encję",no_actions_for_entity:"Nie ma akcji dla tej encji",make_scheme:"stwórz schemat",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Najpierw wybierz przedział czasowy",time_scheme:"Schemat",time_input_mode:"Time control mode"},conditions:{equal_to:"jest równe ",unequal_to:"nie jest równe",all:"wszystkie",any:"dowolny",no_conditions_defined:"Nie ma zdefiniowanych warunków",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"zachowanie po zakończeniu",period:"okres"}}},yi={services:vi,domains:gi,ui:fi},bi=Object.freeze({__proto__:null,services:vi,domains:gi,ui:fi,default:yi}),wi={generic:{parameter_to_value:"{parameter} para {value}",action_with_parameter:"{action} com {parameter}"},climate:{set_temperature:"definir temperatura[ para {temperature}]",set_temperature_hvac_mode_heat:"aquecimento[ para {temperature}]",set_temperature_hvac_mode_cool:"arrefecimento[ para {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"definir modo[ para {hvac_mode}]",set_preset_mode:"definir predefinição[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"fechar",open_cover:"abrir",set_cover_position:"definir posição[ para {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"definir velocidade[ para {speed}]",set_direction:"definir direção[ para {direction}]",oscillate:"definir oscilação[ para {oscillate}]"},humidifier:{set_humidity:"definir humidade[ para {humidity}]",set_mode:"definir modo[ para {mode}]"},input_number:{set_value:"definir valor[ para {value}]"},input_select:{select_option:"selecionar opção[ {option}]"},select:{select_option:"selecionar opção[ {option}]"},light:{turn_on:"ligar[ com {brightness} brightness]"},media_player:{select_source:"selecionar origem[ {source}]"},notify:{notify:"send notification"},script:{script:"executar"},vacuum:{start_pause:"iniciar / pausar"},water_heater:{set_operation_mode:"definir modo[ para {operation_mode}]",set_away_mode:"definir modo ausente"}},ki={alarm_control_panel:"painel de controlo de alarme",binary_sensor:"binary sensors",climate:"ambiente",cover:"estores",fan:"ventiladores",group:"grupos",humidifier:"humidificadores",input_boolean:"campo booleano",input_number:"campo numérico",input_select:"campo de opção",light:"iluminação",lock:"fechaduras",media_player:"reprodutores de mídia",notify:"notification",switch:"interruptores",vacuum:"aspiradores",water_heater:"aquecedores hidráulicos"},xi={components:{date:{day_types_short:{daily:"todos",workdays:"semana de trabalho",weekend:"fim-de-semana"},day_types_long:{daily:"todos os dias",workdays:"em dias de semana",weekend:"no fim-de-semana"},days:"dias",tomorrow:"amanhã",repeated_days:"a cada {days}",repeated_days_except:"a cada dia exceto {excludedDays}",days_range:"até {startDay} até {endDay}",next_week_day:"próximo {weekday}"},time:{absolute:"Às {time}",interval:"das {startTime} às {endTime}",at_midnight:"ao meia-noite",at_noon:"ao meio-dia",at_sun_event:"ao {sunEvent}"}},panel:{common:{title:"Agenda"},overview:{no_entries:"Não existem itens a mostrar",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number}{if number is 1} item excluído {else} itens excluídos",hide_excluded:"ocultar itens excluídos",additional_tasks:"Mais {number} {if number is 1} tarefa {else} tarefas"},entity_picker:{no_groups_defined:"Não existem grupos definidos",no_group_selected:"Selecione um grupo primeiro",no_entities_for_group:"Não existem entidades neste grupo",no_entity_selected:"Selecione uma entidade primeiro",no_actions_for_entity:"Não existem ações para esta entidade",make_scheme:"criar esquema",multiple:"Multiple"},time_picker:{no_timeslot_selected:"É necessário selecionar um período horário para escolher uma ação",time_scheme:"Esquema",time_input_mode:"Time control mode"},conditions:{equal_to:"é",unequal_to:"não é",all:"todos(as)",any:"qualquer",no_conditions_defined:"Não existem condições definidas",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"comportamento após a conclusão",period:"período"}}},$i={services:wi,domains:ki,ui:xi},ji=Object.freeze({__proto__:null,services:wi,domains:ki,ui:xi,default:$i}),Oi={generic:{parameter_to_value:"{parameter} para {value}",action_with_parameter:"{action} com {parameter}"},climate:{set_temperature:"definir temperatura[ para {temperature}]",set_temperature_hvac_mode_heat:"aquecimento[ para {temperature}]",set_temperature_hvac_mode_cool:"arrefecimento[ para {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"definir modo[ para {hvac_mode}]",set_preset_mode:"definir predefinição[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"fechar",open_cover:"abrir",set_cover_position:"definir posição[ para {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"definir velocidade[ para {speed}]",set_direction:"definir direção[ para {direction}]",oscillate:"definir oscilação[ para {oscillate}]"},humidifier:{set_humidity:"definir humidade[ para {humidity}]",set_mode:"definir modo[ para {mode}]"},input_number:{set_value:"definir valor[ para {value}]"},input_select:{select_option:"selecionar opção[ {option}]"},select:{select_option:"selecionar opção[ {option}]"},light:{turn_on:"ligar[ com {brightness} brightness]"},media_player:{select_source:"selecionar origem[ {source}]"},notify:{notify:"send notification"},script:{script:"executar"},vacuum:{start_pause:"iniciar / pausar"},water_heater:{set_operation_mode:"definir modo[ para {operation_mode}]",set_away_mode:"definir modo ausente"}},Si={alarm_control_panel:"painel de controlo de alarme",binary_sensor:"binary sensors",climate:"ambiente",cover:"estores",fan:"ventiladores",group:"grupos",humidifier:"humidificadores",input_boolean:"campo booleano",input_number:"campo numérico",input_select:"campo de opção",light:"iluminação",lock:"fechaduras",media_player:"reprodutores de mídia",notify:"notification",switch:"interruptores",vacuum:"aspiradores",water_heater:"aquecedores hidráulicos"},zi={components:{date:{day_types_short:{daily:"diário",workdays:"semana de trabalho",weekend:"fim-de-semana"},day_types_long:{daily:"todos os dias",workdays:"em dias de semana",weekend:"no fim-de-semana"},days:"dias",tomorrow:"amanhã",repeated_days:"a cada {days}",repeated_days_except:"a cada dia exceto {excludedDays}",days_range:"até {startDay} até {endDay}",next_week_day:"próximo {weekday}"},time:{absolute:"à {time}",interval:"das {startTime} às {endTime}",at_midnight:"ao meia-noite",at_noon:"ao meio-dia",at_sun_event:"ao {sunEvent}"}},panel:{common:{title:"Agenda"},overview:{no_entries:"Não existem itens a mostrar",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{number}{if number is 1} item excluído {else} itens excluídos",hide_excluded:"ocultar itens excluídos",additional_tasks:"Mais {number} {if number is 1} tarefa {else} tarefas"},entity_picker:{no_groups_defined:"Não existem grupos definidos",no_group_selected:"Selecione um grupo primeiro",no_entities_for_group:"Não existem entidades neste grupo",no_entity_selected:"Selecione uma entidade primeiro",no_actions_for_entity:"Não existem ações para esta entidade",make_scheme:"criar esquema",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Selecionar um período horário primeiro",time_scheme:"Esquema",time_input_mode:"Time control mode"},conditions:{equal_to:"é",unequal_to:"não é",all:"todos(as)",any:"qualquer",no_conditions_defined:"Não existem condições definidas",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"comportamento após a conclusão",period:"período"}}},Ei={services:Oi,domains:Si,ui:zi},Ci=Object.freeze({__proto__:null,services:Oi,domains:Si,ui:zi,default:Ei}),Ai={generic:{parameter_to_value:"{parameter} la {value}",action_with_parameter:"{action} cu {parameter}"},climate:{set_temperature:"setare temperatură[ la {temperature}]",set_temperature_hvac_mode_heat:"încălzire[ la {temperature}]",set_temperature_hvac_mode_cool:"răcire[ la {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"setare mod[ la {hvac_mode}]",set_preset_mode:"setare preset[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"închidere",open_cover:"deschidere",set_cover_position:"setare poziție[ la {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"setare viteză[ la {speed}]",set_direction:"setare direcție[ la {direction}]",oscillate:"setare oscilare[ la {oscillate}]"},humidifier:{set_humidity:"setare umiditate[ la {humidity}]",set_mode:"setare mod[ la {mode}]"},input_number:{set_value:"setare valoare[ la {value}]"},input_select:{select_option:"selectare opțiune[ {option}]"},select:{select_option:"selectare opțiune[ {option}]"},light:{turn_on:"pornire[ cu luminozitate {brightness}]"},media_player:{select_source:"selectare sursă[ {source}]"},notify:{notify:"send notification"},script:{script:"executare"},vacuum:{start_pause:"start / pauză"},water_heater:{set_operation_mode:"setare mod[ la {operation_mode}]",set_away_mode:"setare mod plecat"}},Di={alarm_control_panel:"panou control alarmă",binary_sensor:"binary sensors",climate:"climat",cover:"jaluzele",fan:"ventilatoare",group:"grupuri",humidifier:"umidificatoare",input_boolean:"input boolean",input_number:"input număr",input_select:"input selecție",light:"lumini",lock:"încuietori",media_player:"media playere",notify:"notification",switch:"întrerupătoare",vacuum:"aspiratoare",water_heater:"încălzitoare apă"},Mi={components:{date:{day_types_short:{daily:"zilnic",workdays:"zile lucrătoare",weekend:"sfârșit de săptămână"},day_types_long:{daily:"zilnic",workdays:"în timpul săptămânii",weekend:"la sfârșit de săptămână"},days:"zile",tomorrow:"mâine",repeated_days:"la fiecare {days} zile",repeated_days_except:"zilnic cu excepția {excludedDays}",days_range:"din {startDay} până în {endDay}",next_week_day:"{weekday} viitoare"},time:{absolute:"la {time}",interval:"de la {startTime} până la {endTime}",at_midnight:"la miezul nopții",at_noon:"la amiază",at_sun_event:"la {sunEvent}"}},panel:{common:{title:"Planificator"},overview:{no_entries:"Nu există elemente de afișat",backend_error:"Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.",excluded_items:"{if number is 1}un element exclus {else}{number} elemente excluse",hide_excluded:"ascunde elementele excluse",additional_tasks:"{if number is 1}o sarcină suplimentară {else}{number} sarcini suplimentare"},entity_picker:{no_groups_defined:"Nu există grupuri definite",no_group_selected:"Prima dată selectați un grup",no_entities_for_group:"Nu există entități definite în acest grup",no_entity_selected:"Prima dată selectați o entitate",no_actions_for_entity:"Nu există acțiuni pentru această entitate",make_scheme:"creare schemă",multiple:"Multiple"},time_picker:{no_timeslot_selected:"Prima dată selectați un interval orar",time_scheme:"Schemă",time_input_mode:"Time control mode"},conditions:{equal_to:"este",unequal_to:"nu este",all:"tot",any:"oricare",no_conditions_defined:"Nu există condiții definite",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"comportament după declanșare",period:"perioadă"}}},Ti={services:Ai,domains:Di,ui:Mi},Ni=Object.freeze({__proto__:null,services:Ai,domains:Di,ui:Mi,default:Ti}),Li={generic:{parameter_to_value:"{parameter} к {value}",action_with_parameter:"{action} с {parameter}"},climate:{set_temperature:"установить температуру[ {temperature}]",set_temperature_hvac_mode_heat:"обогрев[ {temperature}]",set_temperature_hvac_mode_cool:"охлаждение[ {temperature}]",set_temperature_hvac_mode_heat_cool:"регулировать[ в пределах {target_temp_low} - {target_temp_high}]",set_hvac_mode:"установить режим[ {hvac_mode}]",set_preset_mode:"выбрать набор настроек[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"закрыть",open_cover:"открыть",set_cover_position:"установить позицию[ {position}]",set_cover_tilt_position:"установить наклон[ {tilt_position}]"},fan:{set_speed:"установить скорость[ {speed}]",set_direction:"установить направление[ {direction}]",oscillate:"установить колебание[ {oscillate}]"},humidifier:{set_humidity:"установить влажность[ {humidity}]",set_mode:"установить режим[ {mode}]"},input_number:{set_value:"установить значение[ в {value}]"},input_select:{select_option:"установить опцию[ {option}]"},select:{select_option:"установить опцию[ {option}]"},light:{turn_on:"включить[ с {brightness} яркостью]"},media_player:{select_source:"выбрать источник[ {source}]"},notify:{notify:"послать сообщение"},script:{script:"запустить"},vacuum:{start_pause:"старт / пауза"},water_heater:{set_operation_mode:"установить режим[ {operation_mode}]",set_away_mode:"установить режим вне дома"}},Ii={alarm_control_panel:"панель управления сигнализацией",binary_sensor:"binary sensors",climate:"климат",cover:"жалюзи",fan:"вентиляторы",group:"группы",humidifier:"увлажнители",input_boolean:"логические",input_number:"числовые",input_select:"списки",light:"освещение",lock:"замки",media_player:"медиа-плееры",notify:"notification",switch:"розетки",vacuum:"пылесосы",water_heater:"подогреватели воды"},Pi={components:{date:{day_types_short:{daily:"ежедневно",workdays:"рабочие дни",weekend:"выходные"},day_types_long:{daily:"каждый день",workdays:"по рабочим дням",weekend:"в выходные"},days:"дни",tomorrow:"завтра",repeated_days:"каждый {days}",repeated_days_except:"каждый день кроме {excludedDays}",days_range:"с {startDay} до {endDay}",next_week_day:"в следующую {weekday}"},time:{absolute:"в {time}",interval:"с {startTime} до {endTime}",at_midnight:"в полночь",at_noon:"в полдень",at_sun_event:"в {sunEvent}"}},panel:{common:{title:"Планировщик"},overview:{no_entries:"Отсутствуют элементы",backend_error:"Нет соединенияс scheduler component. Scheduler component должен быть установлен до применения этой карты.",excluded_items:"{number} исключено {if number is 1} элемент {else} элементов",hide_excluded:"скрыть исключенные элементы",additional_tasks:"{number} больше {if number is 1} задача {else} задач"},entity_picker:{no_groups_defined:"Не определены группы",no_group_selected:"Выберите группу",no_entities_for_group:"Отсутствуют элементы в группе",no_entity_selected:"Выберите элемент",no_actions_for_entity:"Нет действий для этого элемента",make_scheme:"создать схему",multiple:"Множественный"},time_picker:{no_timeslot_selected:"Выберите временной слот",time_scheme:"Cхему",time_input_mode:"Time control mode"},conditions:{equal_to:"равно",unequal_to:"не равно",all:"все",any:"любое",no_conditions_defined:"Не определены условия",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"поведение после срабатывания",period:"период"}}},qi={services:Li,domains:Ii,ui:Pi},Ri=Object.freeze({__proto__:null,services:Li,domains:Ii,ui:Pi,default:qi}),Ui={generic:{parameter_to_value:"{parameter} na {value}",action_with_parameter:"{action} s {parameter}"},climate:{set_temperature:"nastaviť teplotu[ na {temperature}]",set_temperature_hvac_mode_heat:"vykurovanie[ na {temperature}]",set_temperature_hvac_mode_cool:"chladenie[ na {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"nastaviť režim[ na {hvac_mode}]",set_preset_mode:"nastaviť predvoľbu[ {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"zatvoriť",open_cover:"otvoriť",set_cover_position:"nastaviť polohu[ na {position}]",set_cover_tilt_position:"nastaviť naklonenie[ na {tilt_position}]"},fan:{set_speed:"nastaviť rýchlosť[ na {speed}]",set_direction:"nastaviť smer[ na {direction}]",oscillate:"nastaviť osciláciu[ na {oscillate}]"},humidifier:{set_humidity:"nastaviť vlhkosť[ na {humidity}]",set_mode:"nastaviť režim[ na {mode}]"},input_number:{set_value:"nastaviť hodnotu[ na {value}]"},input_select:{select_option:"vybrať možnosť[ {option}]"},select:{select_option:"vybrať možnosť[ {option}]"},light:{turn_on:"zapnúť[ na {brightness} jas]"},media_player:{select_source:"vybrať zdroj[ {source}]"},notify:{notify:"send notification"},script:{script:"spustiť"},vacuum:{start_pause:"štart / pauza"},water_heater:{set_operation_mode:"nastaviť režim[ na {operation_mode}]",set_away_mode:"nastaviť mód neprítomný"}},Hi={alarm_control_panel:"ovládací panel alarmu",binary_sensor:"binary sensors",climate:"klimatizácia",cover:"rolety",fan:"ventilátory",group:"skupiny",humidifier:"zvlhčovače",input_boolean:"input boolean",input_number:"input number",input_select:"input select",light:"svetlá",lock:"zámky",media_player:"mediálne prehrávače",notify:"notification",switch:"vypínače",vacuum:"vysávače",water_heater:"ohrievače vody"},Vi={components:{date:{day_types_short:{daily:"denne",workdays:"pracovné dni",weekend:"víkend"},day_types_long:{daily:"každý deň",workdays:"cez pracovné dni",weekend:"cez víkend"},days:"dni",tomorrow:"zajtra",repeated_days:"každý {days}",repeated_days_except:"každý deň okrem {excludedDays}",days_range:"od {startDay} do {endDay}",next_week_day:"budúcu {weekday}"},time:{absolute:"od {time}",interval:"od {startTime} do {endTime}",at_midnight:"od polnoci",at_noon:"od obeda",at_sun_event:"na {sunEvent}"}},panel:{common:{title:"Plánovač"},overview:{no_entries:"Žiadne položky k zobrazeniu",backend_error:"Nepodarilo sa pripojiť k Scheduler Component. Musí byť nainštalovaný ako integrácia pred použitím tejto karty.",excluded_items:"Vylúčené položky: {number}",hide_excluded:"skryť vylúčené položky",additional_tasks:"Ďalšie úlohy: {number}"},entity_picker:{no_groups_defined:"Nie sú definované žiadne skupiny",no_group_selected:"Najprv vyberte skupinu",no_entities_for_group:"V tejto skupine nie sú žiadne entity",no_entity_selected:"Najprv vyberte entitu",no_actions_for_entity:"Pre túto entitu neexistujú žiadne akcie",make_scheme:"vytvoriť schému",multiple:"Viacero"},time_picker:{no_timeslot_selected:"Najprv vyberte časový úsek",time_scheme:"Schému",time_input_mode:"Time control mode"},conditions:{equal_to:"je",unequal_to:"nie je",all:"Všetko",any:"žiadny",no_conditions_defined:"Nie sú definované žiadne podmienky",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"správanie sa po spustení",period:"obdobie"}}},Fi={services:Ui,domains:Hi,ui:Vi},Bi={generic:{parameter_to_value:"{parameter} до {value}",action_with_parameter:"{action} з {parameter}"},climate:{set_temperature:"встановити температуру[ to {temperature}]",set_temperature_hvac_mode_heat:"нагрів[ to {temperature}]",set_temperature_hvac_mode_cool:"охолодження[ to {temperature}]",set_temperature_hvac_mode_heat_cool:"regulate[ to {target_temp_low} - {target_temp_high}]",set_hvac_mode:"встановити режим[ to {hvac_mode}]",set_preset_mode:"вибрати пресет[ to {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"закрити",open_cover:"відкрити",set_cover_position:"встановити позицію[ to {position}]",set_cover_tilt_position:"set tilt position[ to {tilt_position}]"},fan:{set_speed:"встановити швидкість[ to {speed}]",set_direction:"встановити напрямок[ to {direction}]",oscillate:"встановити коливання[ to {oscillate}]"},humidifier:{set_humidity:"встановити вологість[ to {humidity}]",set_mode:"встановити режим[ to {mode}]"},input_number:{set_value:"встановити значення[ to {value}]"},input_select:{select_option:"встановити опцію[ {option}]"},select:{select_option:"встановити опцію[ {option}]"},light:{turn_on:"увімкнути[ з {brightness} якскравістю]"},media_player:{select_source:"вибрати джерело[ {source}]"},notify:{notify:"send notification"},script:{script:"виконати"},vacuum:{start_pause:"старт / пауза"},water_heater:{set_operation_mode:"встановити режим[ to {operation_mode}]",set_away_mode:"встановити режим Не вдома"}},Yi={alarm_control_panel:"панель керування сигналізацією",binary_sensor:"binary sensors",climate:"клімат",cover:"жалюзі",fan:"вентилятори",group:"групи",humidifier:"зволожувачі",input_boolean:"логічні",input_number:"числові",input_select:"списки",light:"освітлення",lock:"замки",media_player:"медіаплеєри",notify:"notification",switch:"вимикачі",vacuum:"пилососи",water_heater:"водонагрівачі"},Wi={components:{date:{day_types_short:{daily:"щоденно",workdays:"робочі дні",weekend:"вихідні"},day_types_long:{daily:"кожного дня",workdays:"в робочі дні",weekend:"по вихідних"},days:"дні",tomorrow:"завтра",repeated_days:"кожні {days}",repeated_days_except:"кожного дня окрім {excludedDays}",days_range:"з {startDay} до {endDay}",next_week_day:"наступної {weekday}"},time:{absolute:"о {time}",interval:"з {startTime} до {endTime}",at_midnight:"опівночі",at_noon:"опівдні",at_sun_event:"о {sunEvent}"}},panel:{common:{title:"Планувальник"},overview:{no_entries:"Елементи відсутні",backend_error:"Не вдалося підключитися до компонента планувальника. Перш ніж використовувати цю карту, її потрібно встановити як інтеграцію.",excluded_items:"{number} виключено {if number is 1} елемент {else} елементів",hide_excluded:"сховати виключені елементи",additional_tasks:"{number} більше {if number is 1} завдання {else} завдань"},entity_picker:{no_groups_defined:"Немає визначених груп",no_group_selected:"Спершу виберіть групу",no_entities_for_group:"В даній групі відсутні елементи",no_entity_selected:"Спершу виберіть елемент",no_actions_for_entity:"Немає дій для цього елемента",make_scheme:"створити схему",multiple:"Декілька"},time_picker:{no_timeslot_selected:"Спершу виберіть часовий проміжок",time_scheme:"Cхему",time_input_mode:"Time control mode"},conditions:{equal_to:"дорівнює",unequal_to:"не рівне",all:"всі",any:"будь-яке",no_conditions_defined:"Не визначені умови",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"поведінка після спрацювання",period:"період"}}},Gi={services:Bi,domains:Yi,ui:Wi},Zi={generic:{parameter_to_value:"{parameter} 至 {value}",action_with_parameter:"{action} 使用 {parameter}"},climate:{set_temperature:"设定温度[ 至 {temperature}]",set_temperature_hvac_mode_heat:"制热模式[ 至 {temperature}]",set_temperature_hvac_mode_cool:"制冷模式[ 至 {temperature}]",set_temperature_hvac_mode_heat_cool:"调节[ 至 {target_temp_low} - {target_temp_high}]",set_hvac_mode:"设定模式[ 为 {hvac_mode}]",set_preset_mode:"设定预设模式[ 为 {preset_mode}]",set_fan_mode:"set fan mode[ to {fan_mode}]"},cover:{close_cover:"关闭",open_cover:"打开",set_cover_position:"设定位置[ 至 {position}]",set_cover_tilt_position:"设定倾斜位置[ 至 {tilt_position}]"},fan:{set_speed:"设定风速[ 至 {speed}]",set_direction:"设定方向[ 至 {direction}]",oscillate:"设置摇摆[ 至 {oscillate}]"},humidifier:{set_humidity:"设定湿度[ 至 {humidity}]",set_mode:"设定模式[ 为 {mode}]"},input_number:{set_value:"设定数值[ 至 {value}]"},input_select:{select_option:"选择选项[ {option}]"},select:{select_option:"选择选项[ {option}]"},light:{turn_on:"打开[ 并设定亮度为 {brightness}]"},media_player:{select_source:"选择播放源[ {source}]"},notify:{notify:"发送通知"},script:{script:"执行"},vacuum:{start_pause:"开始 / 暂停"},water_heater:{set_operation_mode:"设定模式[ 为 {operation_mode}]",set_away_mode:"设定离开模式"}},Ki={alarm_control_panel:"警戒控制面板",binary_sensor:"binary sensors",climate:"空调/地暖",cover:"窗帘",fan:"风扇/空气净化器",group:"实体组",humidifier:"空气加湿器",input_boolean:"输入二元选择器",input_number:"输入数值",input_select:"输入选择",light:"灯具",lock:"门锁",media_player:"媒体播放器",notify:"notification",switch:"开关",vacuum:"扫地机/吸尘器",water_heater:"热水器"},Ji={components:{date:{day_types_short:{daily:"每日",workdays:"工作日",weekend:"周末"},day_types_long:{daily:"每一天",workdays:"在工作日",weekend:"在周末"},days:"天",tomorrow:"明天",repeated_days:"每 {days}",repeated_days_except:"每天,除了 {excludedDays}",days_range:"从 {startDay} 至 {endDay}",next_week_day:"下{weekday}"},time:{absolute:"在 {time}",interval:"从 {startTime} 至 {endTime}",at_midnight:"在午夜",at_noon:"在正午",at_sun_event:"在 {sunEvent}"}},panel:{common:{title:"计划任务"},overview:{no_entries:"无事项",backend_error:"计划任务组件关联失败。本卡片使用前,需先安装计划任务组件和集成.",excluded_items:"{number} 除外 {if number is 1} 事项 {else} 事项",hide_excluded:"隐藏除外事项",additional_tasks:"{number} 更多 {if number is 1} 任务 {else} 任务"},entity_picker:{no_groups_defined:"未添加需执行计划任务的群组",no_group_selected:"请选择群组",no_entities_for_group:"群组不含实体",no_entity_selected:"请选择实体",no_actions_for_entity:"该实体不含可执行的动作",make_scheme:"制定计划",multiple:"多选"},time_picker:{no_timeslot_selected:"请选择时间段",time_scheme:"议程",time_input_mode:"Time control mode"},conditions:{equal_to:"是",unequal_to:"非",all:"全部",any:"任一",no_conditions_defined:"未定义条件",track_conditions:"Re-evaluate when conditions change"},options:{repeat_type:"触发后的行为",period:"时期"}}},Xi={services:Zi,domains:Ki,ui:Ji};const Qi={cs:yt,de:$t,en:Et,es:Tt,et:qt,es_419:Tt,fr:Ft,he:Zt,hu:ei,it:oi,nb:_i,nl:di,nn:_i,no:_i,pl:bi,pt:ji,pt_BR:Ci,ro:Ni,sk:Object.freeze({__proto__:null,services:Ui,domains:Hi,ui:Vi,default:Fi}),ru:Ri,uk:Object.freeze({__proto__:null,services:Bi,domains:Yi,ui:Wi,default:Gi}),"zh-Hans":Object.freeze({__proto__:null,services:Zi,domains:Ki,ui:Ji,default:Xi})};function es(e,t,i="",s=""){let a;try{if("test"==t.language)return"TRANSLATED";a=e.split(".").reduce((e,t)=>e[t],Qi[t.language]),a||(a=e.split(".").reduce((e,t)=>e[t],Qi.en))}catch(t){try{a=e.split(".").reduce((e,t)=>e[t],Qi.en)}catch(e){a=""}}if(""!==i&&""!==s&&a){Array.isArray(i)||(i=[i]),Array.isArray(s)||(s=[s]);for(let e=0;e -1) { - return index; - } - return null; - }; }; - function assign(origObj) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { - var obj = args_1[_a]; - for (var key in obj) { - // @ts-ignore ex - origObj[key] = obj[key]; - } - } - return origObj; + .card-header .name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: flex; } - var dayNames = [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ]; - var monthNames = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ]; - var monthNamesShort = shorten(monthNames, 3); - var dayNamesShort = shorten(dayNames, 3); - var defaultI18n = { - dayNamesShort: dayNamesShort, - dayNames: dayNames, - monthNamesShort: monthNamesShort, - monthNames: monthNames, - amPm: ["am", "pm"], - DoFn: function (dayOfMonth) { - return (dayOfMonth + - ["th", "st", "nd", "rd"][dayOfMonth % 10 > 3 - ? 0 - : ((dayOfMonth - (dayOfMonth % 10) !== 10 ? 1 : 0) * dayOfMonth) % 10]); - } - }; - var globalI18n = assign({}, defaultI18n); - var setGlobalDateI18n = function (i18n) { - return (globalI18n = assign(globalI18n, i18n)); - }; - var regexEscape = function (str) { - return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&"); - }; - var pad = function (val, len) { - if (len === void 0) { len = 2; } - val = String(val); - while (val.length < len) { - val = "0" + val; - } - return val; - }; - var formatFlags = { - D: function (dateObj) { return String(dateObj.getDate()); }, - DD: function (dateObj) { return pad(dateObj.getDate()); }, - Do: function (dateObj, i18n) { - return i18n.DoFn(dateObj.getDate()); - }, - d: function (dateObj) { return String(dateObj.getDay()); }, - dd: function (dateObj) { return pad(dateObj.getDay()); }, - ddd: function (dateObj, i18n) { - return i18n.dayNamesShort[dateObj.getDay()]; - }, - dddd: function (dateObj, i18n) { - return i18n.dayNames[dateObj.getDay()]; - }, - M: function (dateObj) { return String(dateObj.getMonth() + 1); }, - MM: function (dateObj) { return pad(dateObj.getMonth() + 1); }, - MMM: function (dateObj, i18n) { - return i18n.monthNamesShort[dateObj.getMonth()]; - }, - MMMM: function (dateObj, i18n) { - return i18n.monthNames[dateObj.getMonth()]; - }, - YY: function (dateObj) { - return pad(String(dateObj.getFullYear()), 4).substr(2); - }, - YYYY: function (dateObj) { return pad(dateObj.getFullYear(), 4); }, - h: function (dateObj) { return String(dateObj.getHours() % 12 || 12); }, - hh: function (dateObj) { return pad(dateObj.getHours() % 12 || 12); }, - H: function (dateObj) { return String(dateObj.getHours()); }, - HH: function (dateObj) { return pad(dateObj.getHours()); }, - m: function (dateObj) { return String(dateObj.getMinutes()); }, - mm: function (dateObj) { return pad(dateObj.getMinutes()); }, - s: function (dateObj) { return String(dateObj.getSeconds()); }, - ss: function (dateObj) { return pad(dateObj.getSeconds()); }, - S: function (dateObj) { - return String(Math.round(dateObj.getMilliseconds() / 100)); - }, - SS: function (dateObj) { - return pad(Math.round(dateObj.getMilliseconds() / 10), 2); - }, - SSS: function (dateObj) { return pad(dateObj.getMilliseconds(), 3); }, - a: function (dateObj, i18n) { - return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1]; - }, - A: function (dateObj, i18n) { - return dateObj.getHours() < 12 - ? i18n.amPm[0].toUpperCase() - : i18n.amPm[1].toUpperCase(); - }, - ZZ: function (dateObj) { - var offset = dateObj.getTimezoneOffset(); - return ((offset > 0 ? "-" : "+") + - pad(Math.floor(Math.abs(offset) / 60) * 100 + (Math.abs(offset) % 60), 4)); - }, - Z: function (dateObj) { - var offset = dateObj.getTimezoneOffset(); - return ((offset > 0 ? "-" : "+") + - pad(Math.floor(Math.abs(offset) / 60), 2) + - ":" + - pad(Math.abs(offset) % 60, 2)); - } - }; - var monthParse = function (v) { return +v - 1; }; - var emptyDigits = [null, twoDigitsOptional]; - var emptyWord = [null, word]; - var amPm = [ - "isPm", - word, - function (v, i18n) { - var val = v.toLowerCase(); - if (val === i18n.amPm[0]) { - return 0; - } - else if (val === i18n.amPm[1]) { - return 1; - } - return null; - } - ]; - var timezoneOffset = [ - "timezoneOffset", - "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?", - function (v) { - var parts = (v + "").match(/([+-]|\d\d)/gi); - if (parts) { - var minutes = +parts[1] * 60 + parseInt(parts[2], 10); - return parts[0] === "+" ? minutes : -minutes; - } - return 0; - } - ]; - var parseFlags = { - D: ["day", twoDigitsOptional], - DD: ["day", twoDigits], - Do: ["day", twoDigitsOptional + word, function (v) { return parseInt(v, 10); }], - M: ["month", twoDigitsOptional, monthParse], - MM: ["month", twoDigits, monthParse], - YY: [ - "year", - twoDigits, - function (v) { - var now = new Date(); - var cent = +("" + now.getFullYear()).substr(0, 2); - return +("" + (+v > 68 ? cent - 1 : cent) + v); - } - ], - h: ["hour", twoDigitsOptional, undefined, "isPm"], - hh: ["hour", twoDigits, undefined, "isPm"], - H: ["hour", twoDigitsOptional], - HH: ["hour", twoDigits], - m: ["minute", twoDigitsOptional], - mm: ["minute", twoDigits], - s: ["second", twoDigitsOptional], - ss: ["second", twoDigits], - YYYY: ["year", fourDigits], - S: ["millisecond", "\\d", function (v) { return +v * 100; }], - SS: ["millisecond", twoDigits, function (v) { return +v * 10; }], - SSS: ["millisecond", threeDigits], - d: emptyDigits, - dd: emptyDigits, - ddd: emptyWord, - dddd: emptyWord, - MMM: ["month", word, monthUpdate("monthNamesShort")], - MMMM: ["month", word, monthUpdate("monthNames")], - a: amPm, - A: amPm, - ZZ: timezoneOffset, - Z: timezoneOffset - }; - // Some common format strings - var globalMasks = { - default: "ddd MMM DD YYYY HH:mm:ss", - shortDate: "M/D/YY", - mediumDate: "MMM D, YYYY", - longDate: "MMMM D, YYYY", - fullDate: "dddd, MMMM D, YYYY", - isoDate: "YYYY-MM-DD", - isoDateTime: "YYYY-MM-DDTHH:mm:ssZ", - shortTime: "HH:mm", - mediumTime: "HH:mm:ss", - longTime: "HH:mm:ss.SSS" - }; - var setGlobalDateMasks = function (masks) { return assign(globalMasks, masks); }; - /*** - * Format a date - * @method format - * @param {Date|number} dateObj - * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate' - * @returns {string} Formatted date string - */ - var format = function (dateObj, mask, i18n) { - if (mask === void 0) { mask = globalMasks["default"]; } - if (i18n === void 0) { i18n = {}; } - if (typeof dateObj === "number") { - dateObj = new Date(dateObj); - } - if (Object.prototype.toString.call(dateObj) !== "[object Date]" || - isNaN(dateObj.getTime())) { - throw new Error("Invalid Date pass to format"); - } - mask = globalMasks[mask] || mask; - var literals = []; - // Make literals inactive by replacing them with @@@ - mask = mask.replace(literal, function ($0, $1) { - literals.push($1); - return "@@@"; - }); - var combinedI18nSettings = assign(assign({}, globalI18n), i18n); - // Apply formatting rules - mask = mask.replace(token, function ($0) { - return formatFlags[$0](dateObj, combinedI18nSettings); - }); - // Inline literal values back into the formatted value - return mask.replace(/@@@/g, function () { return literals.shift(); }); - }; - /** - * Parse a date string into a Javascript Date object / - * @method parse - * @param {string} dateStr Date string - * @param {string} format Date parse format - * @param {i18n} I18nSettingsOptional Full or subset of I18N settings - * @returns {Date|null} Returns Date object. Returns null what date string is invalid or doesn't match format - */ - function parse(dateStr, format, i18n) { - if (i18n === void 0) { i18n = {}; } - if (typeof format !== "string") { - throw new Error("Invalid format in fecha parse"); - } - // Check to see if the format is actually a mask - format = globalMasks[format] || format; - // Avoid regular expression denial of service, fail early for really long strings - // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS - if (dateStr.length > 1000) { - return null; - } - // Default to the beginning of the year. - var today = new Date(); - var dateInfo = { - year: today.getFullYear(), - month: 0, - day: 1, - hour: 0, - minute: 0, - second: 0, - millisecond: 0, - isPm: null, - timezoneOffset: null - }; - var parseInfo = []; - var literals = []; - // Replace all the literals with @@@. Hopefully a string that won't exist in the format - var newFormat = format.replace(literal, function ($0, $1) { - literals.push(regexEscape($1)); - return "@@@"; - }); - var specifiedFields = {}; - var requiredFields = {}; - // Change every token that we find into the correct regex - newFormat = regexEscape(newFormat).replace(token, function ($0) { - var info = parseFlags[$0]; - var field = info[0], regex = info[1], requiredField = info[3]; - // Check if the person has specified the same field twice. This will lead to confusing results. - if (specifiedFields[field]) { - throw new Error("Invalid format. " + field + " specified twice in format"); - } - specifiedFields[field] = true; - // Check if there are any required fields. For instance, 12 hour time requires AM/PM specified - if (requiredField) { - requiredFields[requiredField] = true; - } - parseInfo.push(info); - return "(" + regex + ")"; - }); - // Check all the required fields are present - Object.keys(requiredFields).forEach(function (field) { - if (!specifiedFields[field]) { - throw new Error("Invalid format. " + field + " is required in specified format"); - } - }); - // Add back all the literals after - newFormat = newFormat.replace(/@@@/g, function () { return literals.shift(); }); - // Check if the date string matches the format. If it doesn't return null - var matches = dateStr.match(new RegExp(newFormat, "i")); - if (!matches) { - return null; - } - var combinedI18nSettings = assign(assign({}, globalI18n), i18n); - // For each match, call the parser function for that date part - for (var i = 1; i < matches.length; i++) { - var _a = parseInfo[i - 1], field = _a[0], parser = _a[2]; - var value = parser - ? parser(matches[i], combinedI18nSettings) - : +matches[i]; - // If the parser can't make sense of the value, return null - if (value == null) { - return null; - } - dateInfo[field] = value; - } - if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) { - dateInfo.hour = +dateInfo.hour + 12; - } - else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) { - dateInfo.hour = 0; - } - var dateWithoutTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond); - var validateFields = [ - ["month", "getMonth"], - ["day", "getDate"], - ["hour", "getHours"], - ["minute", "getMinutes"], - ["second", "getSeconds"] - ]; - for (var i = 0, len = validateFields.length; i < len; i++) { - // Check to make sure the date field is within the allowed range. Javascript dates allows values - // outside the allowed range. If the values don't match the value was invalid - if (specifiedFields[validateFields[i][0]] && - dateInfo[validateFields[i][0]] !== dateWithoutTZ[validateFields[i][1]]()) { - return null; - } - } - if (dateInfo.timezoneOffset == null) { - return dateWithoutTZ; - } - return new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond)); + .card-header ha-switch { + padding: 5px; } - var fecha = { - format: format, - parse: parse, - defaultI18n: defaultI18n, - setGlobalDateI18n: setGlobalDateI18n, - setGlobalDateMasks: setGlobalDateMasks - }; - - var a$3=function(){try{(new Date).toLocaleDateString("i");}catch(e){return "RangeError"===e.name}return !1}()?function(e,t){return e.toLocaleDateString(t.language,{year:"numeric",month:"long",day:"numeric"})}:function(t){return fecha.format(t,"mediumDate")},r$4=function(){try{(new Date).toLocaleString("i");}catch(e){return "RangeError"===e.name}return !1}()?function(e,t){return e.toLocaleString(t.language,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:function(t){return fecha.format(t,"haDateTime")},n$5=function(){try{(new Date).toLocaleTimeString("i");}catch(e){return "RangeError"===e.name}return !1}()?function(e,t){return e.toLocaleTimeString(t.language,{hour:"numeric",minute:"2-digit"})}:function(t){return fecha.format(t,"shortTime")};var m$1,f$1;function g$1(e){return e.substr(0,e.indexOf("."))}function b$1(e){return e.substr(e.indexOf(".")+1)}!function(e){e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none";}(m$1||(m$1={})),function(e){e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24";}(f$1||(f$1={}));var A$1=function(e,t,a,r){r=r||{},a=null==a?{}:a;var n=new Event(t,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});return n.detail=a,e.dispatchEvent(n),n},U={alert:"hass:alert",automation:"hass:playlist-play",calendar:"hass:calendar",camera:"hass:video",climate:"hass:thermostat",configurator:"hass:settings",conversation:"hass:text-to-speech",device_tracker:"hass:account",fan:"hass:fan",group:"hass:google-circles-communities",history_graph:"hass:chart-line",homeassistant:"hass:home-assistant",homekit:"hass:home-automation",image_processing:"hass:image-filter-frames",input_boolean:"hass:drawing",input_datetime:"hass:calendar-clock",input_number:"hass:ray-vertex",input_select:"hass:format-list-bulleted",input_text:"hass:textbox",light:"hass:lightbulb",mailbox:"hass:mailbox",notify:"hass:comment-alert",person:"hass:account",plant:"hass:flower",proximity:"hass:apple-safari",remote:"hass:remote",scene:"hass:google-pages",script:"hass:file-document",sensor:"hass:eye",simple_alarm:"hass:bell",sun:"hass:white-balance-sunny",switch:"hass:flash",timer:"hass:timer",updater:"hass:cloud-upload",vacuum:"hass:robot-vacuum",water_heater:"hass:thermometer",weblink:"hass:open-in-new"};function B(e,t){if(e in U)return U[e];switch(e){case"alarm_control_panel":switch(t){case"armed_home":return "hass:bell-plus";case"armed_night":return "hass:bell-sleep";case"disarmed":return "hass:bell-outline";case"triggered":return "hass:bell-ring";default:return "hass:bell"}case"binary_sensor":return t&&"off"===t?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return "closed"===t?"hass:window-closed":"hass:window-open";case"lock":return t&&"unlocked"===t?"hass:lock-open":"hass:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"hass:cast-connected":"hass:cast";case"zwave":switch(t){case"dead":return "hass:emoticon-dead";case"sleeping":return "hass:sleep";case"initializing":return "hass:timer-sand";default:return "hass:z-wave"}default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),"hass:bookmark"}}var te={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},ae={binary_sensor:function(e){var t=e.state&&"off"===e.state;switch(e.attributes.device_class){case"battery":return t?"hass:battery":"hass:battery-outline";case"cold":return t?"hass:thermometer":"hass:snowflake";case"connectivity":return t?"hass:server-network-off":"hass:server-network";case"door":return t?"hass:door-closed":"hass:door-open";case"garage_door":return t?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return t?"hass:shield-check":"hass:alert";case"heat":return t?"hass:thermometer":"hass:fire";case"light":return t?"hass:brightness-5":"hass:brightness-7";case"lock":return t?"hass:lock":"hass:lock-open";case"moisture":return t?"hass:water-off":"hass:water";case"motion":return t?"hass:walk":"hass:run";case"occupancy":return t?"hass:home-outline":"hass:home";case"opening":return t?"hass:square":"hass:square-outline";case"plug":return t?"hass:power-plug-off":"hass:power-plug";case"presence":return t?"hass:home-outline":"hass:home";case"sound":return t?"hass:music-note-off":"hass:music-note";case"vibration":return t?"hass:crop-portrait":"hass:vibrate";case"window":return t?"hass:window-closed":"hass:window-open";default:return t?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(e){var t="closed"!==e.state;switch(e.attributes.device_class){case"garage":return t?"hass:garage-open":"hass:garage";case"door":return t?"hass:door-open":"hass:door-closed";case"shutter":return t?"hass:window-shutter-open":"hass:window-shutter";case"blind":return t?"hass:blinds-open":"hass:blinds";case"window":return t?"hass:window-open":"hass:window-closed";default:return B("cover",e.state)}},sensor:function(e){var t=e.attributes.device_class;if(t&&t in te)return te[t];if("battery"===t){var a=Number(e.state);if(isNaN(a))return "hass:battery-unknown";var r=10*Math.round(a/10);return r>=100?"hass:battery":r<=0?"hass:battery-alert":"hass:battery-"+r}var n=e.attributes.unit_of_measurement;return "°C"===n||"°F"===n?"hass:thermometer":B("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?B("input_datetime"):"hass:calendar":"hass:clock"}},re=function(e){if(!e)return "hass:bookmark";if(e.attributes.icon)return e.attributes.icon;var t=g$1(e.entity_id);return t in ae?ae[t](e):B(t,e.state)}; - - var ERepeatType; - (function (ERepeatType) { - ERepeatType["Repeat"] = "repeat"; - ERepeatType["Pause"] = "pause"; - ERepeatType["Single"] = "single"; - })(ERepeatType || (ERepeatType = {})); - /* action variables */ - var EVariableType; - (function (EVariableType) { - EVariableType["Level"] = "LEVEL"; - EVariableType["List"] = "LIST"; - EVariableType["Text"] = "TEXT"; - })(EVariableType || (EVariableType = {})); - /* other */ - var EConditionMatchType; - (function (EConditionMatchType) { - EConditionMatchType["Equal"] = "is"; - EConditionMatchType["Unequal"] = "not"; - EConditionMatchType["Below"] = "below"; - EConditionMatchType["Above"] = "above"; - })(EConditionMatchType || (EConditionMatchType = {})); - var EConditionType; - (function (EConditionType) { - EConditionType["Any"] = "or"; - EConditionType["All"] = "and"; - })(EConditionType || (EConditionType = {})); - var ETimeEvent; - (function (ETimeEvent) { - ETimeEvent["Sunrise"] = "sunrise"; - ETimeEvent["Sunset"] = "sunset"; - })(ETimeEvent || (ETimeEvent = {})); - var EDayType; - (function (EDayType) { - EDayType["Daily"] = "DAILY"; - EDayType["Workday"] = "WORKDAY"; - EDayType["Weekend"] = "WEEKEND"; - EDayType["Custom"] = "CUSTOM"; - })(EDayType || (EDayType = {})); - var SchedulerEvent; - (function (SchedulerEvent) { - SchedulerEvent["ItemCreated"] = "scheduler_item_created"; - SchedulerEvent["ItemUpdated"] = "scheduler_item_updated"; - SchedulerEvent["ItemRemoved"] = "scheduler_item_removed"; - SchedulerEvent["TimerFinished"] = "scheduler_timer_finished"; - SchedulerEvent["TimerUpdated"] = "scheduler_timer_updated"; - })(SchedulerEvent || (SchedulerEvent = {})); - - const CARD_VERSION = 'v2.3.3'; - const DefaultTimeStep = 10; - const DefaultGroupIcon = 'folder-outline'; - const DefaultEntityIcon = 'folder-outline'; - const DefaultActionIcon = 'flash'; - const DeadEntityName = '(unknown entity)'; - const DeadEntityIcon = 'help-circle-outline'; - const NotifyDomain = 'notify'; - var EViews; - (function (EViews) { - EViews["Overview"] = "OVERVIEW"; - EViews["NewSchedule"] = "NEW_SCHEDULE"; - EViews["TimePicker"] = "TIME_PICKER"; - EViews["TimeScheme"] = "TIME_SCHEME"; - EViews["Options"] = "OPTIONS"; - })(EViews || (EViews = {})); - const DefaultCardConfig = { - type: 'scheduler-card', - discover_existing: true, - standard_configuration: true, - include: [], - exclude: [], - groups: [], - customize: {}, - title: true, - time_step: 10, - show_header_toggle: false, - display_options: { - primary_info: 'default', - secondary_info: ['relative-time', 'additional-tasks'], - icon: 'action', - }, - tags: [], - sort_by: ['relative-time', 'state'], - }; - const WebsocketEvent = 'scheduler_updated'; - - function stringToTime(string, hass) { - if (string.match(/^([0-9:]+)$/)) { - const parts = string.split(':').map(Number); - return parts[0] * 3600 + parts[1] * 60 + (parts[2] || 0); - } - const res = parseRelativeTime(string); - if (res) { - const sunEntity = hass.states['sun.sun']; - const ts_sunrise = stringToTime(sunEntity.attributes.next_rising, hass); - const ts_sunset = stringToTime(sunEntity.attributes.next_setting, hass); - let ts = res.event == 'sunrise' ? ts_sunrise : ts_sunset; - ts = res.sign == '+' ? ts + stringToTime(res.offset, hass) : ts - stringToTime(res.offset, hass); - return ts; - } - const ts = new Date(string); - return ts.getHours() * 3600 + ts.getMinutes() * 60 + ts.getSeconds(); - } - function timeToString(time) { - const hours = Math.floor(time / 3600); - time -= hours * 3600; - const minutes = Math.floor(time / 60); - time -= minutes * 60; - const seconds = Math.round(time); - return (String(hours % 24).padStart(2, '0') + - ':' + - String(minutes).padStart(2, '0') + - ':' + - String(seconds).padStart(2, '0')); - } - function roundTime(value, stepSize, options = { wrapAround: true }) { - let hours = value >= 0 ? Math.floor(value / 3600) : Math.ceil(value / 3600); - let minutes = Math.floor((value - hours * 3600) / 60); - if (minutes % stepSize != 0) - minutes = Math.round(minutes / stepSize) * stepSize; - if (minutes >= 60) { - hours++; - minutes -= 60; - } - else if (minutes < 0) { - hours--; - minutes += 60; - } - if (options.wrapAround) { - if (hours >= 24) - hours -= 24; - else if (hours < 0) - hours += 24; - } - const time = hours * 3600 + minutes * 60; - if (options.maxHours) { - if (time > options.maxHours * 3600) - return options.maxHours * 3600; - if (time < -options.maxHours * 3600) - return -options.maxHours * 3600; - } - return time; - } - function parseRelativeTime(time) { - const match = time.match(/^([a-z]+)([\+|-]{1})([0-9:]+)$/); - if (!match) - return false; - return { - event: match[1], - sign: match[2], - offset: match[3], - }; + .card-header ha-icon-button { + position: absolute; + right: 6px; + top: 6px; } - - function pick(obj, keys) { - if (!obj) - return {}; - return Object.entries(obj) - .filter(([key]) => keys.includes(key)) - .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {}); - } - const omit = (obj, ...keys) => { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - }; - // export function omit(obj: Dictionary, keys: string[]): Dictionary { - // if (!obj) return {}; - // return Object.entries(obj) - // .filter(([key]) => !keys.includes(key)) - // .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {}); - // } - function flatten(arr) { - if (arr.every(val => !Array.isArray(val))) { - return arr.slice(); - } - return arr.reduce((acc, val) => acc.concat(Array.isArray(val) ? flatten(val) : val), []); - } - function unique(arr) { - let res = []; - arr.forEach(item => { - if (!res.find(e => (typeof item === 'object' ? isEqual(e, item) : e === item))) - res.push(item); - }); - return res; - } - function isDefined(value) { - return value !== null && value !== undefined; - } - function isEqual(...arr) { - if (!arr.length) - return false; - const firstItem = arr[0]; - return arr.every(item => { - return firstItem && item && typeof firstItem === 'object' && typeof item === 'object' - ? Object.keys(firstItem).length === Object.keys(item).length && - Object.keys(firstItem).reduce((res, key) => res && isEqual(firstItem[key], item[key]), true) - : firstItem === item; - }); - } - function sortAlphabetically(a, b) { - const stringVal = (a) => { - if (typeof a === 'object') { - return a.name !== undefined - ? String(a.name) - .trim() - .toLowerCase() - : JSON.stringify(a); - } - else - return String(a) - .trim() - .toLowerCase(); - }; - return stringVal(a) < stringVal(b) ? -1 : 1; - } - function capitalize(input) { - return input.charAt(0).toUpperCase() + input.slice(1); - } - function PrettyPrintName(input) { - if (typeof input != typeof 'x') - input = String(input); - return capitalize(input.replace(/_/g, ' ')); - } - function PrettyPrintIcon(input) { - if (!input) - return; - if (typeof input != typeof 'x') - input = String(input); - if (input.match(/^[a-z]+:[a-z0-9-]+$/i)) - return input; - return `hass:${input}`; - } - function calculateTimeline(entries, hass) { - //correct timeslots which are outside of 00:00:00 - 23:59:00 window - entries = entries.map(e => Object(Object.assign(Object.assign({}, e), { start: stringToTime(e.start, hass) < 0 ? '00:00:00' : e.start, stop: stringToTime(e.stop, hass) > 3600 * 24 ? '00:00:00' : e.stop }))); - entries = entries.map(e => { - const duration = stringToTime(e.stop, hass) - stringToTime(e.start, hass); - if (duration < 0) { - if (stringToTime(e.stop, hass) == 0) - //if stop time is 00:00:00, this should be mapped as the end of the day - return Object.assign(Object.assign({}, e), { stop: timeToString(stringToTime(e.stop, hass) + 3600 * 24) }); - //correct timeslots who have their start and stop point flipped - else - return Object.assign(Object.assign({}, e), { start: e.stop, stop: e.start }); - } - else if (duration < 60) { - //correct timeslots which have a duration shorter than 1 minute - return Object.assign(Object.assign({}, e), { start: e.start, stop: timeToString(stringToTime(e.start, hass) + 60) }); - } - return e; - }); - //sort chronological - entries.sort((a, b) => { - if (stringToTime(a.start, hass) > stringToTime(b.start, hass)) - return 1; - else if (stringToTime(a.start, hass) < stringToTime(b.start, hass)) - return -1; - else - return stringToTime(a.stop, hass) > stringToTime(b.stop, hass) ? 1 : -1; - }); - let startTime = '00:00:00'; - let len = entries.length; - //insert empty timeslots where needed - for (let i = 0; i < len; i++) { - const entry = entries[i]; - if (stringToTime(entry.start, hass) > stringToTime(startTime, hass)) { - entries.splice(i, 0, Object.assign(Object.assign({}, entry), { - start: startTime, - stop: entry.start, - actions: [], - })); - len++; - i++; - } - else if (stringToTime(entry.start, hass) < stringToTime(startTime, hass)) { - //move timeslot if it is overlapping with previous - entries = Object.assign(entries, { [i]: Object.assign(Object.assign({}, entry), { start: startTime }) }); - } - startTime = entry.stop; - } - const endOfDay = 24 * 3600; - //insert empty timeslots at the end when needed - if (stringToTime(startTime, hass) < endOfDay && stringToTime(startTime, hass) > 0) { - entries.push(Object.assign(Object.assign({}, entries[0]), { - start: startTime, - stop: timeToString(endOfDay), - actions: [], - })); - } - return entries; - } - function IsDefaultName(name) { - if (!name) - return false; - return name.match(/^Schedule\ #[a-f0-9]{6}/) !== null; - } - const getLocale = (hass) => hass.locale || { - language: hass.language, - number_format: m$1.system, - }; - function AsArray(value) { - if (Array.isArray(value)) - return value; - else if (value !== null && value !== undefined) - return [value]; - else - return []; + .card-content { + flex: 1; } - - function ValidateConfig(config) { - const errors = []; - let tree = []; - const addError = (err) => { - if (!err) - return; - errors.push(tree.length ? `in ${tree.join('->')}: ${err}` : err); - }; - const Has = (object, key) => { - return object.hasOwnProperty(key); - }; - const Type = (input, type) => { - if (Array.isArray(type)) - return type.some(e => Type(input, e)); - else if (type == 'array') - return Array.isArray(input); - else if (type == 'object') - return typeof input === type && input !== null; - else - return typeof input === type; - }; - const Required = (obj, key, type) => { - if (!Has(obj, key)) - addError(`missing required property '${key}'`); - else { - const res = Type(obj[key], type); - if (!res) - addError(`'${key}' must be of type ${type}`); - } - }; - const Optional = (obj, key, type) => { - if (!Has(obj, key)) - return; - const res = Type(obj[key], type); - if (!res) - addError(`'${key}' must be of type ${type}`); - }; - const RequiredArrayType = (obj, key, type) => { - let res = true; - if (Has(obj, key) && Type(obj[key], 'array')) { - if (obj[key].some(e => !Type(e, type))) { - addError(`'${key}' must be an array with items of type ${type}`); - res = false; - } - } - else { - res = false; - } - return res; - }; - const validateActionConfig = (action) => { - const baseTree = tree; - Optional(action, 'name', 'string'); - Optional(action, 'icon', 'string'); - Required(action, 'service', 'string'); - Optional(action, 'service_data', 'object'); - RequiredArrayType(action, 'service_data', 'string'); - if (Has(action, 'service_data') && Type(action.service_data, 'object')) { - if (Object.keys(action.service_data).some(e => !Type(e, 'string'))) - addError('service_data items must have string as index type'); - } - Optional(action, 'variables', 'object'); - if (Has(action, 'variables') && Type(action.variables, 'object')) { - Object.keys(action.variables).forEach(key => { - tree = baseTree.concat(baseTree, ['variables']); - if (!Type(key, 'string')) - addError(`${key} is not allowed`); - Required(action.variables, key, 'object'); - if (Has(action.variables, key) && Type(action.variables[key], 'object')) { - tree.push(key); - const variableCfg = action.variables[key]; - //list variable - if (RequiredArrayType(variableCfg, 'options', 'object')) { - variableCfg.options.forEach((option, index) => { - tree = baseTree.concat(baseTree, ['variables', key, 'options', index]); - Required(option, 'value', 'string'); - Optional(option, 'name', 'string'); - Optional(option, 'icon', 'string'); - }); - } - //level variable - else if (variableCfg.min !== undefined || variableCfg.max !== undefined) { - Optional(variableCfg, 'min', 'number'); - Optional(variableCfg, 'max', 'number'); - Optional(variableCfg, 'step', 'number'); - Optional(variableCfg, 'scale_factor', 'number'); - Optional(variableCfg, 'optional', 'boolean'); - Optional(variableCfg, 'unit', 'string'); - } - //text variable - else { - Optional(variableCfg, 'multiline', 'boolean'); - } - } - }); - } - }; - Optional(config, 'discover_existing', 'boolean'); - Optional(config, 'standard_configuration', 'boolean'); - Optional(config, 'title', ['boolean', 'string']); - Optional(config, 'time_step', 'number'); - Optional(config, 'show_header_toggle', 'boolean'); - Optional(config, 'show_add_button', 'boolean'); - Optional(config, 'sort_by', ['string', 'array']); - Optional(config, 'include', 'array'); - RequiredArrayType(config, 'include', 'string'); - Optional(config, 'exclude', 'array'); - RequiredArrayType(config, 'exclude', 'string'); - Optional(config, 'display_options', 'object'); - if (Has(config, 'display_options')) { - tree.push('display_options'); - Optional(config.display_options, 'primary_info', ['string', 'array']); - Optional(config.display_options, 'secondary_info', ['string', 'array']); - Optional(config.display_options, 'icon', 'string'); - RequiredArrayType(config.display_options, 'primary_info', 'string'); - RequiredArrayType(config.display_options, 'secondary_info', 'string'); - } - tree = []; - Optional(config, 'groups', 'array'); - if (Has(config, 'groups') && Type(config.groups, 'array')) { - tree.push('groups'); - config.groups.forEach((group, index) => { - tree = ['groups', index]; - Required(group, 'name', 'string'); - Optional(group, 'icon', 'string'); - Required(group, 'include', 'array'); - Optional(group, 'exclude', 'array'); - RequiredArrayType(group, 'include', 'string'); - RequiredArrayType(group, 'exclude', 'string'); - }); - } - tree = []; - Optional(config, 'customize', 'object'); - if (Has(config, 'customize') && Type(config.customize, 'object')) { - Object.keys(config.customize).forEach(key => { - tree = ['customize']; - if (!Type(key, 'string')) - addError(`${key} is not allowed`); - Required(config.customize, key, 'object'); - if (Has(config.customize, key) && Type(config.customize[key], 'object')) { - tree.push(key); - const entryObj = config.customize[key]; - Optional(entryObj, 'name', 'string'); - Optional(entryObj, 'icon', 'string'); - Optional(entryObj, 'actions', 'array'); - if (RequiredArrayType(entryObj, 'actions', 'object')) { - entryObj.actions.forEach((action, index) => { - tree = ['customize', key, index]; - validateActionConfig(action); - }); - } - Optional(entryObj, 'states', ['object', 'array']); - if (Has(entryObj, 'states') && Type(entryObj.states, 'array')) { - RequiredArrayType(entryObj, 'states', 'string'); - } - else if (Has(entryObj, 'states') && Type(entryObj.states, 'object')) { - Required(entryObj.states, 'min', 'number'); - Required(entryObj.states, 'max', 'number'); - Optional(entryObj.states, 'step', 'number'); - Optional(entryObj.states, 'scale_factor', 'number'); - Optional(entryObj.states, 'unit', 'string'); - } - } - }); - } - Optional(config, 'tags', ['string', 'array']); - if (errors.length) { - throw new Error(`Invalid configuration provided (${errors.length} error${errors.length > 1 ? 's' : ''}): ${errors.join(', ')}.`); - } + .card-content > *:first-child { + margin-top: 0; } - - /** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */ - const t$2={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},i$4=t=>(...i)=>({_$litDirective$:t,values:i});class s$4{constructor(t){}T(t,i,s){this.Σdt=t,this.M=i,this.Σct=s;}S(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}} - - /** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */class n$6 extends s$4{constructor(i){if(super(i),this.vt=A,i.type!==t$2.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A)return this.Vt=void 0,this.vt=r;if(r===w)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.vt)return this.Vt;this.vt=r;const s=[r];return s.raw=s,this.Vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}n$6.directiveName="unsafeHTML",n$6.resultType=1;const o$6=i$4(n$6); - - const STATE_NOT_RUNNING = "NOT_RUNNING"; - - var services = { - generic: { - parameter_to_value: "{parameter} na {value}", - action_with_parameter: "{action} s {parameter}" - }, - climate: { - set_temperature: "nastavit teplotu[ na {temperature}]", - set_temperature_hvac_mode_heat: "topení[ na {temperature}]", - set_temperature_hvac_mode_cool: "chlazení[ na {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "nastavit režim[ na {hvac_mode}]", - set_preset_mode: "nastavit předvolbu[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "zavřít", - open_cover: "otevřít", - set_cover_position: "nastavit polohu[ na {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "nastavit rychlost[ na {speed}]", - set_direction: "nastavit směr[ na {direction}]", - oscillate: "nastavit oscilaci[ na {oscillate}]" - }, - humidifier: { - set_humidity: "nastavit vlhkost[ na {humidity}]", - set_mode: "nastavit režim[ na {mode}]" - }, - input_number: { - set_value: "nastavit hodnotu[ na {value}]" - }, - input_select: { - select_option: "vybrat možnost[ {option}]" - }, - select: { - select_option: "vybrat možnost[ {option}]" - }, - light: { - turn_on: "zapnout[ na {brightness} jas]" - }, - media_player: { - select_source: "vybrat zdroj[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "spustit" - }, - vacuum: { - start_pause: "start / pauza" - }, - water_heater: { - set_operation_mode: "nastavit režim[ na {operation_mode}]", - set_away_mode: "vypnout režim" - } - }; - var domains = { - alarm_control_panel: "poplašný ovládací panel", - binary_sensor: "binary sensors", - climate: "klima", - cover: "rolety", - fan: "ventilátory", - group: "skupiny", - humidifier: "zvlhčovače", - input_boolean: "input boolean", - input_number: "input number", - input_select: "input select", - light: "světla", - lock: "zámky", - media_player: "média přehrávače", - notify: "notification", - "switch": "spínače", - vacuum: "vysavače", - water_heater: "ohřívače vody" - }; - var ui = { - components: { - date: { - day_types_short: { - daily: "denně", - workdays: "pracovní dny", - weekend: "víkendy" - }, - day_types_long: { - daily: "každý den", - workdays: "v pracovní dny", - weekend: "o víkendu" - }, - days: "dnů", - tomorrow: "zítra", - repeated_days: "každý {days}", - repeated_days_except: "každý den kromě {excludedDays}", - days_range: "od {startDay} do {endDay}", - next_week_day: "příští {weekday}" - }, - time: { - absolute: "od {time}", - interval: "od {startTime} do {endTime}", - at_midnight: "od půlnoc", - at_noon: "od poledne", - at_sun_event: "na {sunEvent}" - } - }, - panel: { - common: { - title: "Plánovač" - }, - overview: { - no_entries: "Nejsou žádné položky k zobrazení", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number} vyloučeno {if number is 1} položka {else} položek", - hide_excluded: "skrýt vyloučené položky", - additional_tasks: "{number} a více {if number is 1} úkol {else} úkolů" - }, - entity_picker: { - no_groups_defined: "Nejsou definovány žádné skupiny", - no_group_selected: "Nejprve vyberte skupinu", - no_entities_for_group: "V této skupině nejsou žádné entity", - no_entity_selected: "Nejprve vyberte entitu", - no_actions_for_entity: "Pro tuto entitu neexistují žádné akce", - make_scheme: "vytvořit schéma", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Nejprve vyberte časový úsek", - time_scheme: "Schéma", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "je", - unequal_to: "není", - all: "Vše", - any: "žádný", - no_conditions_defined: "Nejsou definovány žádné podmínky", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "chování po spuštění", - period: "období" - } - } - }; - var cs = { - services: services, - domains: domains, - ui: ui - }; - - var cs$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services, - domains: domains, - ui: ui, - 'default': cs - }); - - var services$1 = { - generic: { - parameter_to_value: "{parameter} auf {value}", - action_with_parameter: "{action} mit {parameter}" - }, - climate: { - set_temperature: "Temperatur einstellen[ auf {temperature}]", - set_temperature_hvac_mode_heat: "heizen[ auf {temperature}]", - set_temperature_hvac_mode_cool: "kühlen[ auf {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulieren[ auf {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "Modus setzen[ auf {hvac_mode}]", - set_preset_mode: "Voreinstellung setzen[ auf {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "schließen", - open_cover: "öffnen", - set_cover_position: "Position setzen[ auf {position}]", - set_cover_tilt_position: "Tilt Position setzen[ auf {tilt_position}]" - }, - fan: { - set_speed: "Geschwindigkeit speed[ auf {speed}]", - set_direction: "Richtung setzen[ auf {direction}]", - oscillate: "Oszillation setzen[ auf {oscillate}]" - }, - humidifier: { - set_humidity: "Luftfeuchtigkeit setzen[ auf {humidity}]", - set_mode: "Modus setzen[ auf {mode}]" - }, - input_number: { - set_value: "Wert setzen[ auf {value}]" - }, - input_select: { - select_option: "Option[ {option}] auswählen" - }, - select: { - select_option: "Option[ {option}] auswählen" - }, - light: { - turn_on: "anschalten[ mit {brightness} Helligkeit]" - }, - media_player: { - select_source: "Quelle[ {source}] auswählen" - }, - notify: { - notify: "Nachricht senden" - }, - script: { - script: "ausführen" - }, - vacuum: { - start_pause: "Start / Pause" - }, - water_heater: { - set_operation_mode: "Modus setzen[ auf {operation_mode}]", - set_away_mode: "Abwesenheitsmodus setzen" - } - }; - var domains$1 = { - alarm_control_panel: "Alarmzentrale", - binary_sensor: "binary sensors", - climate: "Heizung", - cover: "Beschattung", - fan: "Lüfter", - group: "Gruppen", - humidifier: "Befeuchter", - input_boolean: "input boolean", - input_number: "input number", - input_select: "input select", - light: "Licht", - lock: "Schlösser", - media_player: "Medienplayer", - notify: "notification", - "switch": "Schalter", - vacuum: "Staubsauger", - water_heater: "Boiler" - }; - var ui$1 = { - components: { - date: { - day_types_short: { - daily: "täglich", - workdays: "Werktags", - weekend: "Wochenende" - }, - day_types_long: { - daily: "Jeden Tag", - workdays: "An Werktagen", - weekend: "Am Wochenende" - }, - days: "Tage", - tomorrow: "morgen", - repeated_days: "jeden {days}", - repeated_days_except: "täglich außer {excludedDays}", - days_range: "von {startDay} bis {endDay}", - next_week_day: "nächsten {weekday}" - }, - time: { - absolute: "um {time}", - interval: "von {startTime} bis {endTime}", - at_midnight: "um Mitternacht", - at_noon: "um Mittag", - at_sun_event: "beim {sunEvent}" - } - }, - panel: { - common: { - title: "Zeitplaner" - }, - overview: { - no_entries: "Es gibt keine Einträge, die angezeigt werden können", - backend_error: "Es konnte keine Verbindung mit der Schedulerkomponente hergestellt werden. Es muss als Integration installiert werden, bevor diese Karte verwendet werden kann.", - excluded_items: "{number}{if number is 1} ausgeschlossener Eintrag {else} ausgeschlossene Einträge", - hide_excluded: "Verstecke ausgeschlossene Einträge", - additional_tasks: "{number} weitere {if number is 1} Aufgabe {else} Aufgaben" - }, - entity_picker: { - no_groups_defined: "Es gibt keine Gruppe", - no_group_selected: "Wähle zuerst eine Gruppe aus", - no_entities_for_group: "Es gibt keine Entities in dieser Gruppe", - no_entity_selected: "Wähle zuerst eine Entity aus", - no_actions_for_entity: "Es gibt keine Aktionen für diese Entity", - make_scheme: "Erstelle Zeitplan", - multiple: "mehrere" - }, - time_picker: { - no_timeslot_selected: "Wähle zuerst ein Zeitfenster aus", - time_scheme: "Zeitplan", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "ist", - unequal_to: "ist nicht", - all: "alle", - any: "keine", - no_conditions_defined: "Es sind keine Bedingungen definiert", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "Verhalten nach Abschluß", - period: "Term" - } - } - }; - var de = { - services: services$1, - domains: domains$1, - ui: ui$1 - }; - - var de$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$1, - domains: domains$1, - ui: ui$1, - 'default': de - }); - - var services$2 = { - generic: { - parameter_to_value: "{parameter} to {value}", - action_with_parameter: "{action} with {parameter}" - }, - climate: { - set_temperature: "set temperature[ to {temperature}]", - set_temperature_hvac_mode_heat: "heat[ to {temperature}]", - set_temperature_hvac_mode_cool: "cool[ to {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "set mode[ to {hvac_mode}]", - set_preset_mode: "set preset[ to {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "close", - open_cover: "open", - set_cover_position: "set position[ to {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "set speed[ to {speed}]", - set_direction: "set direction[ to {direction}]", - oscillate: "set oscillation[ to {oscillate}]" - }, - humidifier: { - set_humidity: "set humidity[ to {humidity}]", - set_mode: "set mode[ to {mode}]" - }, - input_number: { - set_value: "set value[ to {value}]" - }, - input_select: { - select_option: "select option[ {option}]" - }, - select: { - select_option: "select option[ {option}]" - }, - light: { - turn_on: "turn on[ with {brightness} brightness]" - }, - media_player: { - select_source: "select source[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "execute" - }, - vacuum: { - start_pause: "start / pause" - }, - water_heater: { - set_operation_mode: "set mode[ to {operation_mode}]", - set_away_mode: "set away mode" - } - }; - var domains$2 = { - alarm_control_panel: "alarm control panel", - binary_sensor: "binary sensors", - climate: "climate", - cover: "covers", - fan: "fans", - group: "entity groups", - humidifier: "humidifiers", - input_boolean: "input boolean", - input_number: "input number", - input_select: "input select", - light: "lights", - lock: "locks", - media_player: "media players", - notify: "notification", - "switch": "switches", - vacuum: "vacuums", - water_heater: "water heaters" - }; - var ui$2 = { - components: { - date: { - day_types_short: { - daily: "daily", - workdays: "workdays", - weekend: "weekend" - }, - day_types_long: { - daily: "every day", - workdays: "on workdays", - weekend: "in the weekend" - }, - days: "days", - tomorrow: "tomorrow", - repeated_days: "every {days}", - repeated_days_except: "every day except {excludedDays}", - days_range: "from {startDay} to {endDay}", - next_week_day: "next {weekday}" - }, - time: { - absolute: "at {time}", - interval: "from {startTime} to {endTime}", - at_midnight: "at midnight", - at_noon: "at noon", - at_sun_event: "at {sunEvent}" - } - }, - panel: { - common: { - title: "Scheduler" - }, - overview: { - no_entries: "There are no items to show", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number} excluded {if number is 1} item {else} items", - hide_excluded: "hide excluded items", - additional_tasks: "{number} more {if number is 1} task {else} tasks" - }, - entity_picker: { - no_groups_defined: "There are no groups defined", - no_group_selected: "Select a group first", - no_entities_for_group: "There are no entities in this group", - no_entity_selected: "Select an entity first", - no_actions_for_entity: "There are no actions for this entity", - make_scheme: "make scheme", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Select a timeslot first", - time_scheme: "Scheme", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "is", - unequal_to: "is not", - all: "all", - any: "any", - no_conditions_defined: "There are no conditions defined", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "behaviour after completion", - period: "period" - }, - card_editor: { - tabs: { - entities: "Entities", - other: "Other" - }, - fields: { - title: { - heading: "Title of the card", - options: { - standard: "standard", - hidden: "hidden", - custom: "custom" - }, - custom_title: "Custom title" - }, - discover_existing: { - heading: "Show all schedules", - description: "This sets the 'discover existing' parameter. Previously created schedules will be automatically added to the card. " - }, - time_step: { - heading: "Time step", - description: "Resolution (in minutes) for creating schedules" - }, - sort_by: { - heading: "Sorting options", - description: "Order in which the schedules appear in the card", - options: { - relative_time: "Time remaining until next action", - title: "Displayed title of the schedule", - state: "Show active schedules on top" - } - }, - display_format_primary: { - heading: "Displayed primary info", - description: "Configure which label is used for schedules in the overview", - options: { - "default": "Schedule name", - entity_action: "Summary of task" - } - }, - display_format_secondary: { - heading: "Displayed secondary info", - description: "Configure what additional properties are visible in the overview", - options: { - relative_time: "Time remaining until next action", - time: "Configured time for next action", - days: "Repeated days of the week", - additional_tasks: "Number of additional tasks" - } - }, - show_header_toggle: { - heading: "Show header toggle", - description: "Show toggle switch at the top of the card for enabling/enabling all entities" - }, - tags: { - heading: "Tags", - description: "Use tags to divide schedules between multiple cards" - }, - entities: { - heading: "Included entities", - description: "Select the entities that you want to control using the scheduler. You can click on a group to open it. Note that some entities (such as sensors) can only be used for conditions, not for actions.", - included_number: "{number}/{total} selected" - } - } - } - } - }; - var en = { - services: services$2, - domains: domains$2, - ui: ui$2 - }; - - var en$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$2, - domains: domains$2, - ui: ui$2, - 'default': en - }); - - var services$3 = { - generic: { - parameter_to_value: "{parameter} a {value}", - action_with_parameter: "{action} con {parameter}" - }, - climate: { - set_temperature: "establecer temperatura[ a {temperature}]", - set_temperature_hvac_mode_heat: "calefacción[ a {temperature}]", - set_temperature_hvac_mode_cool: "frío[ a {temperature}]", - set_temperature_hvac_mode_heat_cool: "regular[ entre {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "establecer modo[ a {hvac_mode}]", - set_preset_mode: "establecer preajuste[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "cerrado", - open_cover: "abierto", - set_cover_position: "establecer posición[ a {position}]", - set_cover_tilt_position: "establecer inclinación[ a {tilt_position}]" - }, - fan: { - set_speed: "establecer velocidad [ a {speed}]", - set_direction: "establecer dirección[ a {direction}]", - oscillate: "establecer oscilación[ a {oscillate}]" - }, - humidifier: { - set_humidity: "establecer humedad[ a {humidity}]", - set_mode: "establecer modo[ a {mode}]" - }, - input_number: { - set_value: "establecer valor[ a {value}]" - }, - input_select: { - select_option: "seleccionar opción[ {option}]" - }, - select: { - select_option: "seleccionar opción[ {option}]" - }, - light: { - turn_on: "encender[ con brillo en {brightness}]" - }, - media_player: { - select_source: "seleccionar fuente[ {source}]" - }, - notify: { - notify: "enviar notificación" - }, - script: { - script: "ejecutar" - }, - vacuum: { - start_pause: "iniciar / pausar" - }, - water_heater: { - set_operation_mode: "establecer modo[ a {operation_mode}]", - set_away_mode: "establecer modo fuera de casa" - } - }; - var domains$3 = { - alarm_control_panel: "panel de control de alarma", - binary_sensor: "binary sensors", - climate: "climatización", - cover: "cortinas", - fan: "ventiladores", - group: "grupos", - humidifier: "humidificadores", - input_boolean: "input boolean", - input_number: "input number", - input_select: "input select", - light: "luces", - lock: "cerraduras", - media_player: "reproductores", - notify: "notification", - "switch": "interruptores", - vacuum: "aspiradores", - water_heater: "calentador de agua" - }; - var ui$3 = { - components: { - date: { - day_types_short: { - daily: "a diario", - workdays: "días hábiles", - weekend: "fin de semana" - }, - day_types_long: { - daily: "todos los días", - workdays: "en días hábiles", - weekend: "en el fin de semana" - }, - days: "días", - tomorrow: "mañana", - repeated_days: "cada {days}", - repeated_days_except: "cada dia excepto {excludedDays}", - days_range: "de {startDay} a {endDay}", - next_week_day: "próximo {weekday}" - }, - time: { - absolute: "a las {time}", - interval: "desde las {startTime} a las {endTime}", - at_midnight: "a la medianoche", - at_noon: "a la mediodía", - at_sun_event: "a la {sunEvent}" - } - }, - panel: { - common: { - title: "Programador" - }, - overview: { - no_entries: "No hay ningún elemento que mostrar", - backend_error: "Fallo de conexión con Scheduler component. Debe ser installado como integración antes de poder usar este panel.", - excluded_items: "{number} {if number is 1} elemento excluido {else} elementos excluidos", - hide_excluded: "ocultar elementos excluidos", - additional_tasks: "{number} {if number is 1} tarea adicional {else} tareas adicionales" - }, - entity_picker: { - no_groups_defined: "No hay ningún grupo definido", - no_group_selected: "selecciona un grupo primero", - no_entities_for_group: "no hay ninguna entidad en este grupo", - no_entity_selected: "selecciona una entidad primero", - no_actions_for_entity: "no hay acciones para esta entidad", - make_scheme: "crear planificación", - multiple: "Múltiple" - }, - time_picker: { - no_timeslot_selected: "selecciona un bloque de tiempo primero", - time_scheme: "Planificación", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "igual a", - unequal_to: "desigual a", - all: "todos", - any: "cualquiera", - no_conditions_defined: "no hay ninguna condición definida", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "acción después de la finalización", - period: "período" - } - } - }; - var es = { - services: services$3, - domains: domains$3, - ui: ui$3 - }; - - var es$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$3, - domains: domains$3, - ui: ui$3, - 'default': es - }); - - var services$4 = { - generic: { - parameter_to_value: "{parameter} {value} jaoks", - action_with_parameter: "{action} väärtusega {parameter}" - }, - climate: { - set_temperature: "vali temperatuur [{temperature}]", - set_temperature_hvac_mode_heat: "küte[ @ {temperature}]", - set_temperature_hvac_mode_cool: "jahutus [ @ {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "vali režiim [{hvac_mode}]", - set_preset_mode: "eelseade[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "sulge", - open_cover: "ava", - set_cover_position: "sea asendisse[{position}]", - set_cover_tilt_position: "sea ribide kalle [ asendisse {tilt_position}]" - }, - fan: { - set_speed: "vali kiirus[ @ {speed}]", - set_direction: "vali suund[ @ {direction}]", - oscillate: "vali hajutus[ @ {oscillate}]" - }, - humidifier: { - set_humidity: "sea niiskus[ {humidity}]", - set_mode: "vali režiim [{mode}]" - }, - input_number: { - set_value: "vali väärtus[ {value}]" - }, - input_select: { - select_option: "valik[ {option}]" - }, - select: { - select_option: "valik[ {option}]" - }, - light: { - turn_on: "lülita sisse[ heledusega {brightness}]" - }, - media_player: { - select_source: "vali sisend[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "käivita" - }, - vacuum: { - start_pause: "alusta/ootele" - }, - water_heater: { - set_operation_mode: "vali režiim [{operation_mode}]", - set_away_mode: "kodust ära" - } - }; - var domains$4 = { - alarm_control_panel: "valvepaneel", - binary_sensor: "binary sensors", - climate: "kliimaseade", - cover: "aknakatted", - fan: "ventilaatorid", - group: "grupid", - humidifier: "niisutajad", - input_boolean: "tõeväärtus", - input_number: "numbriline valik", - input_select: "valikmenüü", - light: "valgustid", - lock: "lukud", - media_player: "meediamängijad", - notify: "notification", - "switch": "lülitid", - vacuum: "tolmuimejad", - water_heater: "veeboilerid" - }; - var ui$4 = { - components: { - date: { - day_types_short: { - daily: "iga päev", - workdays: "tööpäevadel", - weekend: "nädalavahetusel" - }, - day_types_long: { - daily: "iga päev", - workdays: "tööpäevadel", - weekend: "nädalavahetusel" - }, - days: "päeva", - tomorrow: "homme", - repeated_days: "iga {days} järel", - repeated_days_except: "iga päev aga mitte {excludedDays}", - days_range: "{startDay} kuni {endDay}", - next_week_day: "järgmisel {weekday}" - }, - time: { - absolute: "{time}", - interval: "{startTime} kuni {endTime}", - at_midnight: "keskööl", - at_noon: "keskpäeval", - at_sun_event: "{sunEvent}" - } - }, - panel: { - common: { - title: "Ajastaja" - }, - overview: { - no_entries: "Ajastused puuduvad", - backend_error: "Ajastaja sidumine puudub. Sidumine tuleb luua enne selle kaardi kasutamist.", - excluded_items: "välja on jäetud {number} {if number is 1} ajastus {else} ajastust", - hide_excluded: "peida välja jäetud ajastused", - additional_tasks: "veel {number} {if number is 1} ajastus {else} ajastust" - }, - entity_picker: { - no_groups_defined: "Gruppe pole valitud", - no_group_selected: "Vali alustuseks grupid", - no_entities_for_group: "Selles grupis puuduvad olemid", - no_entity_selected: "Vali alustuseks olem", - no_actions_for_entity: "Selle olemi jaoks pole tegevusi", - make_scheme: "loo skeem", - multiple: "Mitu" - }, - time_picker: { - no_timeslot_selected: "Alustuseks vali ajavahemik", - time_scheme: "Kkeem", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "võrdub", - unequal_to: "ei võrdu", - all: "kõik", - any: "iga", - no_conditions_defined: "Tingimusi pole määratud", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "toiming peale käivitumist", - period: "periood" - } - } - }; - var et = { - services: services$4, - domains: domains$4, - ui: ui$4 - }; - - var et$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$4, - domains: domains$4, - ui: ui$4, - 'default': et - }); - - var services$5 = { - generic: { - parameter_to_value: "{parameter} vers {value}", - action_with_parameter: "{action} avec {parameter}" - }, - climate: { - set_temperature: "ajuster la température[ à {temperature}]", - set_temperature_hvac_mode_heat: "chauffe[ à {temperature}]", - set_temperature_hvac_mode_cool: "refroidit[ à {temperature}]", - set_temperature_hvac_mode_heat_cool: "régler[ à {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "ajuster le mode[ à {hvac_mode}]", - set_preset_mode: "choisir le pré-réglage[ {preset_mode}]", - set_fan_mode: "ajuster le mode de ventilation[ à {fan_mode}]" - }, - cover: { - close_cover: "fermer", - open_cover: "ouvrir", - set_cover_position: "ajuster la position[ à {position}]", - set_cover_tilt_position: "régler les volets[ à {tilt_position}]" - }, - fan: { - set_speed: "ajuster la vitesse[ à {speed}]", - set_direction: "ajuster l'orientation[ vers {direction}]", - oscillate: "ajuster l'oscillation[ à {oscillate}]" - }, - humidifier: { - set_humidity: "ajuster l'humidité[ à {humidity}]", - set_mode: "ajuster le mode[ à {mode}]" - }, - input_number: { - set_value: "ajuster la valeur[ à {value}]" - }, - input_select: { - select_option: "choisir l'option[ {option}]" - }, - select: { - select_option: "choisir l'option[ {option}]" - }, - light: { - turn_on: "allumer[ avec une luminosité de {brightness}]" - }, - media_player: { - select_source: "choisir la source[ {source}]" - }, - notify: { - notify: "envoyer une notification" - }, - script: { - script: "exécuter" - }, - vacuum: { - start_pause: "démarrer / pause" - }, - water_heater: { - set_operation_mode: "ajuster le mode[ à {operation_mode}]", - set_away_mode: "choisir le mode absent" - } - }; - var domains$5 = { - alarm_control_panel: "panneau de contrôle de l'alarme", - binary_sensor: "capteurs binaires", - climate: "thermostat", - cover: "volet", - fan: "ventilateur", - group: "groupe", - humidifier: "humidificateur", - input_boolean: "entrée booléenne", - input_number: "entrée numérique", - input_select: "entrée de sélection", - light: "lumière", - lock: "serrure", - media_player: "lecteur multimédia", - notify: "notification", - "switch": "interrupteur", - vacuum: "aspirateur", - water_heater: "chauffe eau" - }; - var ui$5 = { - components: { - date: { - day_types_short: { - daily: "quotidien", - workdays: "jours de travail", - weekend: "weekend" - }, - day_types_long: { - daily: "chaque jour", - workdays: "en semaine", - weekend: "le weekend" - }, - days: "jours", - tomorrow: "demain", - repeated_days: "chaque {days}", - repeated_days_except: "chaque jour sauf {excludedDays}", - days_range: "de {startDay} à {endDay}", - next_week_day: "{weekday} prochain" - }, - time: { - absolute: "à {time}", - interval: "de {startTime} à {endTime}", - at_midnight: "à minuit", - at_noon: "à midi", - at_sun_event: "au {sunEvent}" - } - }, - panel: { - common: { - title: "Planificateur" - }, - overview: { - no_entries: "il n'y a pas d'entrée à montrer", - backend_error: "Impossible de se connecter au composant du planificateur. Elle doit être installée en tant qu'intégration avant que cette carte puisse être utilisée.", - excluded_items: "{number} {if number is 1}entrée exclue{else}entrées exclues", - hide_excluded: "cacher les entrées exclues", - additional_tasks: "{number} {if number is 1}tâche à venir{else}tâches à venir" - }, - entity_picker: { - no_groups_defined: "Aucun groupe défini", - no_group_selected: "Choisir un groupe en premier", - no_entities_for_group: "Il n'y a pas d'entité dans ce groupe", - no_entity_selected: "Choisir une entité en premier", - no_actions_for_entity: "Il n'y a pas d'action pour cette entité", - make_scheme: "créer un schéma", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Choisir d'abord une plage horaire", - time_scheme: "Schéma", - time_input_mode: "contrôle temporel" - }, - conditions: { - equal_to: "égal à", - unequal_to: "pas égal à", - all: "tous", - any: "tout", - no_conditions_defined: "Il n'y a pas de condition définie", - track_conditions: "Ré-évaluer lorsque la condition change" - }, - options: { - repeat_type: "comportement après l'achèvement", - period: "période" - } - } - }; - var fr = { - services: services$5, - domains: domains$5, - ui: ui$5 - }; - - var fr$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$5, - domains: domains$5, - ui: ui$5, - 'default': fr - }); - - var services$6 = { - generic: { - parameter_to_value: "{parameter} ל {value}", - action_with_parameter: "{action} עם {parameter}" - }, - climate: { - set_temperature: "קבע טמפרטורה[ ל {temperature}]", - set_temperature_hvac_mode_heat: "חימום[ ל {temperature}]", - set_temperature_hvac_mode_cool: "קירור[ ל {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "קבע מצב עבודה[ ל {hvac_mode}]", - set_preset_mode: "קבע הגדרה[ ל {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "סגירה", - open_cover: "פתיחה", - set_cover_position: "קבע מיקום[ ל {position}]", - set_cover_tilt_position: "קבע הטיה[ ל {tilt_position}]" - }, - fan: { - set_speed: "קבע מהירות[ ל {speed}]", - set_direction: "קבע כיוון[ ל {direction}]", - oscillate: "קבע תנודה[ ל {oscillate}]" - }, - humidifier: { - set_humidity: "קבע לחות[ ל {humidity}]", - set_mode: "קבע מצב עבודה[ ל {mode}]" - }, - input_number: { - set_value: "קבע ערך[ ל {value}]" - }, - input_select: { - select_option: "בחר אפשרות[ {option}]" - }, - select: { - select_option: "בחר אפשרות[ {option}]" - }, - light: { - turn_on: "הדלקה[ בעוצמה של {brightness}]" - }, - media_player: { - select_source: "select source[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "בצע" - }, - vacuum: { - start_pause: "התחל / הפסק" - }, - water_heater: { - set_operation_mode: "קבע מצב עבודה[ ל {operation_mode}]", - set_away_mode: "קבע מצב מוץ לבית" - } - }; - var domains$6 = { - alarm_control_panel: "בקרת אזעקה", - binary_sensor: "binary sensors", - climate: "מזג אוויר", - cover: "תריסים", - fan: "מאווררים", - group: "קבוצות יישויות", - humidifier: "מכשירי אדים", - input_boolean: "כניסה בוליאנית", - input_number: "כניסה מספרית", - input_select: "בחירת כניסה", - light: "תאורה", - lock: "מנעולים", - media_player: "נגני מדיה", - notify: "notification", - "switch": "מפסקים", - vacuum: "שואבי אבק", - water_heater: "מחממי מים" - }; - var ui$6 = { - components: { - date: { - day_types_short: { - daily: "כל יום", - workdays: "ימי חול", - weekend: "סוף שבוע" - }, - day_types_long: { - daily: "כל יום", - workdays: "בימי חול", - weekend: "בסוף השבוע" - }, - days: "ימים", - tomorrow: "מחר", - repeated_days: "בכל {days}", - repeated_days_except: "בכל יום פרט ל {excludedDays}", - days_range: "מ- {startDay} ועד- {endDay}", - next_week_day: "הבא {weekday}" - }, - time: { - absolute: "בשעה {time}", - interval: "משעה {startTime} עד שעה {endTime}", - at_midnight: "בחצות הלילה", - at_noon: "בחצות היום", - at_sun_event: "ב {sunEvent}" - } - }, - panel: { - common: { - title: "לוח זמנים" - }, - overview: { - no_entries: "אין פריטים להצגה", - backend_error: "אין אפשרות להתחבר לרכיב התזמונים. נדרש להתקין את הרכיב באינטגרציה לפני השימוש בכרטיס.", - excluded_items: "{number} לא נכלל {if number is 1} פריט {else} פריטים", - hide_excluded: "הסתר פריטים לא כלולים", - additional_tasks: "{number} נוסף {if number is 1} משימה {else} משימות" - }, - entity_picker: { - no_groups_defined: "לא הוגדרו קבוצות", - no_group_selected: "בחר קבוצה תחילה", - no_entities_for_group: "אין יישויות בקבוצה זו", - no_entity_selected: "תחילה בחר יישות", - no_actions_for_entity: "אין פעולות עבור יישות זאת", - make_scheme: "בנה סכימה", - multiple: "מספר יישויות" - }, - time_picker: { - no_timeslot_selected: "בחר משבצת זמן קודם", - time_scheme: "סכימה", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "שווה ל", - unequal_to: "שונה מ", - all: "כל התנאים", - any: "אחד מהתנאים", - no_conditions_defined: "לא הוגדרו תנאים", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "התנהגות לאחר הפעלה", - period: "פרק זמן" - } - } - }; - var he = { - services: services$6, - domains: domains$6, - ui: ui$6 - }; - - var he$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$6, - domains: domains$6, - ui: ui$6, - 'default': he - }); - - var services$7 = { - generic: { - parameter_to_value: "{parameter} to {value}", - action_with_parameter: "{action} with {parameter}" - }, - climate: { - set_temperature: "hőmérséklet[ to {temperature}]", - set_temperature_hvac_mode_heat: "hőmérséklet[ to {temperature}]", - set_temperature_hvac_mode_cool: "hőmérséklet[ to {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "mód beállítása[ to {hvac_mode}]", - set_preset_mode: "preset beállítása[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "zárás", - open_cover: "nyitás", - set_cover_position: "változtass pozíciót[ to {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "set speed[ to {speed}]", - set_direction: "set direction[ to {direction}]", - oscillate: "set oscillation[ to {oscillate}]" - }, - humidifier: { - set_humidity: "set humidity[ to {humidity}]", - set_mode: "mód beállítása[ to {mode}]" - }, - input_number: { - set_value: "érték beállítása[ to {value}]" - }, - input_select: { - select_option: "opció kiválasztása[ {option}]" - }, - select: { - select_option: "opció kiválasztása[ {option}]" - }, - light: { - turn_on: "bekapcsolás[ with {brightness} brightness]" - }, - media_player: { - select_source: "forrás kiválasztása[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "kezdés" - }, - vacuum: { - start_pause: "start / pause" - }, - water_heater: { - set_operation_mode: "mód beállítása[ to {operation_mode}]", - set_away_mode: "set away mode" - } - }; - var domains$7 = { - alarm_control_panel: "alarm control panel", - binary_sensor: "binary sensors", - climate: "termosztát", - cover: "redőny", - fan: "ventilátor", - group: "csoportok", - humidifier: "humifiers", - input_boolean: "logikai bemenet", - input_number: "szám bemenet", - input_select: "legördülő bemenet", - light: "lámpa", - lock: "locks", - media_player: "lejátszó", - notify: "notification", - "switch": "kapcsoló", - vacuum: "pórszívó", - water_heater: "water heaters" - }; - var ui$7 = { - components: { - date: { - day_types_short: { - daily: "minden nap", - workdays: "munkanapokon", - weekend: "hétvégén" - }, - day_types_long: { - daily: "minden nap", - workdays: "munkanapokon", - weekend: "hétvégén" - }, - days: "Napokon", - tomorrow: "tomorrow", - repeated_days: "every {days}", - repeated_days_except: "every day except {excludedDays}", - days_range: "from {startDay} to {endDay}", - next_week_day: "következő {weekday}" - }, - time: { - absolute: "{time}-kor", - interval: "{startTime} - {endTime}", - at_midnight: "éjfélkor", - at_noon: "délben", - at_sun_event: "{sunEvent}kor" - } - }, - panel: { - common: { - title: "Időzítések" - }, - overview: { - no_entries: "Nincs megjeleníthető elem", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number} excluded {if number is 1} item {else} items", - hide_excluded: "hide excluded items", - additional_tasks: "még {number} feladat" - }, - entity_picker: { - no_groups_defined: "Nincsenek deffiniált csoportok", - no_group_selected: "Előbb egy csoportot szükséges választani", - no_entities_for_group: "Ebben a csoportban nem találhatók entitások", - no_entity_selected: "Előbb egy entitást szükséges választani", - no_actions_for_entity: "Ehhez az entitáshoz nem tartoznak műveletek", - make_scheme: "make scheme", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Select a timeslot first", - time_scheme: "Scheme", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "is", - unequal_to: "is not", - all: "all", - any: "any", - no_conditions_defined: "There are no conditions defined", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "behaviour after triggering", - period: "időszak" - } - } - }; - var hu = { - services: services$7, - domains: domains$7, - ui: ui$7 - }; - - var hu$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$7, - domains: domains$7, - ui: ui$7, - 'default': hu - }); - - var services$8 = { - generic: { - parameter_to_value: "{parameter} a {value}", - action_with_parameter: "{action} con {parameter}" - }, - climate: { - set_temperature: "imposta temperatura[ a {temperature}]", - set_temperature_hvac_mode_heat: "riscaldamento[ a {temperature}]", - set_temperature_hvac_mode_cool: "raffrescamento[ a {temperature}]", - set_temperature_hvac_mode_heat_cool: "regola[ a {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "imposta modalità[ a {hvac_mode}]", - set_preset_mode: "imposta programmazione[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "chiuso", - open_cover: "aperto", - set_cover_position: "imposta posizione[ su {position}]", - set_cover_tilt_position: "imposta inclinazione[ su {tilt_position}]" - }, - fan: { - set_speed: "imposta velocità[ a {speed}]", - set_direction: "imposta direzione[ a {direction}]", - oscillate: "imposta oscillazione[ a {oscillate}]" - }, - humidifier: { - set_humidity: "imposta umidità[ a {humidity}]", - set_mode: "imposta modalità[ a {mode}]" - }, - input_number: { - set_value: "imposta valore[ a {value}]" - }, - input_select: { - select_option: "seleziona opzione[ {option}]" - }, - select: { - select_option: "seleziona opzione[ {option}]" - }, - light: { - turn_on: "accendi[ con il {brightness} di luminosità]" - }, - media_player: { - select_source: "seleziona sorgente[ {source}]" - }, - notify: { - notify: "invia notifica" - }, - script: { - script: "esegui" - }, - vacuum: { - start_pause: "avvia / pausa" - }, - water_heater: { - set_operation_mode: "imposta modalità[ a {operation_mode}]", - set_away_mode: "imposta fuori casa" - } - }; - var domains$8 = { - alarm_control_panel: "pannello di controllo allarme", - binary_sensor: "binary sensors", - climate: "clima", - cover: "serrande", - fan: "ventole", - group: "gruppi", - humidifier: "umidificatori", - input_boolean: "input booleani", - input_number: "input numerici", - input_select: "input select", - light: "luci", - lock: "lucchetti", - media_player: "media player", - notify: "notification", - "switch": "interruttori", - vacuum: "aspirapolveri", - water_heater: "scaldabagno" - }; - var ui$8 = { - components: { - date: { - day_types_short: { - daily: "giornaliero", - workdays: "giorni lavorativi", - weekend: "weekend" - }, - day_types_long: { - daily: "ogni giorno", - workdays: "nei giorni lavorativi", - weekend: "nel weekend" - }, - days: "giorni", - tomorrow: "domani", - repeated_days: "ogni {days}", - repeated_days_except: "ogni giorno tranne {excludedDays}", - days_range: "{if startDay is domenica} dalla domenica {else} dal {startDay} {if endDay is domenica} alla domenica {else} al {endDay}", - next_week_day: "prossimo {weekday}" - }, - time: { - absolute: "alle {time}", - interval: "dalle {startTime} alle {endTime}", - at_midnight: "a mezzanotte", - at_noon: "a mezzogiorno", - at_sun_event: "al {sunEvent}" - } - }, - panel: { - common: { - title: "Schedulatore" - }, - overview: { - no_entries: "Non ci sono oggetti da visualizzare", - backend_error: "Impossibile connettersi con il componente scheduler. Deve essere installato come integrazione prima di poter utilizzare questa card.", - excluded_items: "{number} {if number is 1} oggetto escluso {else} oggetti esclusi", - hide_excluded: "Nascondi oggetti esclusi", - additional_tasks: "{number} attività in più" - }, - entity_picker: { - no_groups_defined: "Non ci sono gruppi definiti", - no_group_selected: "Seleziona prima un gruppo", - no_entities_for_group: "Non ci sono entità in questo gruppo", - no_entity_selected: "Seleziona prima un'entità", - no_actions_for_entity: "Non ci sono azioni per questa entità", - make_scheme: "crea schema", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Seleziona prima una fascia oraria", - time_scheme: "Schema", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "uguale", - unequal_to: "non uguale", - all: "tutte", - any: "qualunque", - no_conditions_defined: "Non ci sono condizioni definite", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "comportamento dopo il completamento", - period: "periodo" - } - } - }; - var it = { - services: services$8, - domains: domains$8, - ui: ui$8 - }; - - var it$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$8, - domains: domains$8, - ui: ui$8, - 'default': it - }); - - var services$9 = { - generic: { - parameter_to_value: "{parameter} naar {value}", - action_with_parameter: "{action} met {parameter}" - }, - climate: { - set_temperature: "temperatuur instellen[ naar {temperature}]", - set_temperature_hvac_mode_heat: "verwarmen[ naar {temperature}]", - set_temperature_hvac_mode_cool: "koelen[ naar {temperature}]", - set_temperature_hvac_mode_heat_cool: "reguleren[ naar {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "modus aanpassen[ naar {hvac_mode}]", - set_preset_mode: "programma[ {preset_mode}] instellen", - set_fan_mode: "ventilatiemodus aanpassen[ naar {fan_mode}]" - }, - cover: { - close_cover: "sluiten", - open_cover: "openen", - set_cover_position: "positie instellen[ naar {position}]", - set_cover_tilt_position: "hellingshoek instellen[ naar {tilt_position}]" - }, - fan: { - set_speed: "snelheid instellen[ op {speed}]", - set_direction: "richting instellen[ naar {direction}]", - oscillate: "zet oscillatie[ naar {oscillate}]" - }, - humidifier: { - set_humidity: "luchtvochtigheid instellen [ op {humidity}]", - set_mode: "modus aanpassen[ naar {mode}]" - }, - input_number: { - set_value: "waarde aanpassen[ naar {value}]" - }, - input_select: { - select_option: "selecteer optie[ {option}]" - }, - select: { - select_option: "selecteer optie[ {option}]" - }, - light: { - turn_on: "inschakelen[ met {brightness} helderheid]" - }, - media_player: { - select_source: "kies ingang[ {source}]" - }, - notify: { - notify: "notificatie sturen" - }, - script: { - script: "uitvoeren" - }, - vacuum: { - start_pause: "start / pauzeer" - }, - water_heater: { - set_operation_mode: "modus aanpassen[ naar {operation_mode}]", - set_away_mode: "stel afwezigheidsmode in" - } - }; - var domains$9 = { - alarm_control_panel: "alarmsystemen", - binary_sensor: "binaire sensoren", - climate: "verwarming", - cover: "zonwering", - fan: "ventilatie", - group: "groepen", - humidifier: "luchtbevochtigers", - input_boolean: "input_boolean", - input_number: "input_number", - input_select: "input_select", - select: "select", - light: "verlichting", - lock: "sloten", - media_player: "mediaspelers", - notify: "notificatie", - "switch": "schakelaars", - vacuum: "stofzuigers", - water_heater: "waterverwarming" - }; - var ui$9 = { - components: { - date: { - day_types_short: { - daily: "dagelijks", - workdays: "werkdagen", - weekend: "weekend" - }, - day_types_long: { - daily: "iedere dag", - workdays: "doordeweeks", - weekend: "in het weekend" - }, - days: "dagen", - tomorrow: "morgen", - repeated_days: "elke {days}", - repeated_days_except: "elke dag behalve {excludedDays}", - days_range: "van {startDay} tot {endDay}", - next_week_day: "volgende week {weekday}" - }, - time: { - absolute: "om {time}", - interval: "van {startTime} tot {endTime}", - at_midnight: "om middernacht", - at_noon: "om 12:00", - at_sun_event: "bij {sunEvent}" - } - }, - panel: { - common: { - title: "Tijdplanner" - }, - overview: { - no_entries: "Er zijn geen items aangemaakt", - backend_error: "Er kon geen verbinding worden gemaakt met het Scheduler component. Deze moet als integratie zijn geinstalleerd voordat deze kaart gebruikt kan worden.", - excluded_items: "{number} uitgesloten {if number is 1} item {else} items", - hide_excluded: "verberg uitgesloten items", - additional_tasks: "{number} overige {if number is 1} taak {else} taken" - }, - entity_picker: { - no_group_selected: "Selecteer eerst een groep", - no_entity_selected: "Selecteer eerst een entiteit", - no_groups_defined: "Er zijn geen groepen gedefinieerd", - no_entities_for_group: "Deze groep heeft geen entiteiten", - no_actions_for_entity: "Deze entiteit heeft geen acties", - make_scheme: "maak schema", - multiple: "Meerdere" - }, - time_picker: { - no_timeslot_selected: "Kies eerst een tijdsslot", - time_scheme: "Schema", - time_input_mode: "Invoermodus voor tijd" - }, - conditions: { - equal_to: "is", - unequal_to: "is niet", - all: "en", - any: "of", - no_conditions_defined: "Er zijn geen voorwaarden gedefinieerd", - track_conditions: "Herevalueer wanneer condities veranderen" - }, - options: { - repeat_type: "gedrag na voltooiing", - period: "periode" - } - } - }; - var nl = { - services: services$9, - domains: domains$9, - ui: ui$9 - }; - - var nl$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$9, - domains: domains$9, - ui: ui$9, - 'default': nl - }); - - var services$a = { - generic: { - parameter_to_value: "{parameter} til {value}", - action_with_parameter: "{action} med {parameter}" - }, - climate: { - set_temperature: "sett temperatur[ til {temperature}]", - set_temperature_hvac_mode_heat: "sett temperatur[ til {temperature}]", - set_temperature_hvac_mode_cool: "sett temperatur[ til {temperature}]", - set_temperature_hvac_mode_heat_cool: "reguler[ til {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "sett modus[ til {hvac_mode}]", - set_preset_mode: "sett forhåndsvalg[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "lukk", - open_cover: "åpne", - set_cover_position: "sett posisjon[ til {position}]", - set_cover_tilt_position: "sett vippestilling[ til {tilt_position}]" - }, - fan: { - set_speed: "sett hastighet[ til {speed}]", - set_direction: "sett retning[ til {direction}]", - oscillate: "sett svingning[ til {oscillate}]" - }, - humidifier: { - set_humidity: "sett luftfuktighet[ til {humidity}]", - set_mode: "sett modus[ til {mode}]" - }, - input_number: { - set_value: "sett verdi[ til {value}]" - }, - input_select: { - select_option: "velg[ {option}]" - }, - select: { - select_option: "velg[ {option}]" - }, - light: { - turn_on: "slå på[ med {brightness} lysstyrke]" - }, - media_player: { - select_source: "velg kilde[ {source}]" - }, - notify: { - notify: "send notifikasjon" - }, - script: { - script: "utfør" - }, - vacuum: { - start_pause: "start / pause" - }, - water_heater: { - set_operation_mode: "sett modus[ til {operation_mode}]", - set_away_mode: "sett bortemodus" - } - }; - var domains$a = { - alarm_control_panel: "alarmpanel", - binary_sensor: "binary sensors", - climate: "klima", - cover: "solskjerming", - fan: "vifter", - group: "grupper", - humidifier: "luftfuktere", - input_boolean: "input boolsk", - input_number: "input nummer", - input_select: "input valg", - light: "lys", - lock: "låser", - media_player: "mediaspillere", - notify: "notification", - "switch": "brytere", - vacuum: "støvsugere", - water_heater: "varmtvannsberedere" - }; - var ui$a = { - components: { - date: { - day_types_short: { - daily: "hver dag", - workdays: "ukedager", - weekend: "helg" - }, - day_types_long: { - daily: "hver dag", - workdays: "ukedager", - weekend: "helg" - }, - days: "Dager", - tomorrow: "imorgen", - repeated_days: "hver {days}", - repeated_days_except: "hver dag unntatt {excludedDays}", - days_range: "fra {startDay} til {endDay}", - next_week_day: "neste {weekday}" - }, - time: { - absolute: "kl. {time}", - interval: "fra {startTime} til {endTime}", - at_midnight: "ved midnatt", - at_noon: "kl. 12.00", - at_sun_event: "ved {sunEvent}" - } - }, - panel: { - common: { - title: "Tidsplan" - }, - overview: { - no_entries: "Det er ingen definerte tidsplaner å vise", - backend_error: "Kunne ikke koble til tidsplankomponenten. Den må installeres som en integrasjon før dette kortet kan benyttes.", - excluded_items: "{number} ekskludert {if number is 1} element {else} elementer", - hide_excluded: "skjul ekskluderte elementer", - additional_tasks: "{number} flere {if number is 1} oppgaver {else} oppgaver" - }, - entity_picker: { - no_groups_defined: "Ingen grupper definert", - no_group_selected: "Velg en gruppe først", - no_entities_for_group: "Det finnes ingen entiteter i denne gruppen", - no_entity_selected: "Velg en entitet først", - no_actions_for_entity: "Det finnes ingen handlinger for denne entiteten", - make_scheme: "lag tidsplan", - multiple: "Flere" - }, - time_picker: { - no_timeslot_selected: "Velg tidsluke først", - time_scheme: "Tidsplan", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "er", - unequal_to: "er ikke", - all: "alle", - any: "any", - no_conditions_defined: "Ingen vilkår definert", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "oppførsel etter fullføring", - period: "periode" - } - } - }; - var no = { - services: services$a, - domains: domains$a, - ui: ui$a - }; - - var no$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$a, - domains: domains$a, - ui: ui$a, - 'default': no - }); - - var services$b = { - generic: { - parameter_to_value: "{parameter} na {value}", - action_with_parameter: "{action} z {parameter}" - }, - climate: { - set_temperature: "ustaw temperaturę[ na {temperature}]", - set_temperature_hvac_mode_heat: "grzej[ do {temperature}]", - set_temperature_hvac_mode_cool: "chłodź[ do {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "ustaw tryb[ na {hvac_mode}]", - set_preset_mode: "ustaw preset[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "zamknij", - open_cover: "otwórz", - set_cover_position: "ustaw pozycję[ na {position}]", - set_cover_tilt_position: "ustaw pozycję lameli[ na {tilt_position}]" - }, - fan: { - set_speed: "ustaw prędkość[ na {speed}]", - set_direction: "ustaw kierunek[ na {direction}]", - oscillate: "ustaw oscylacje[ na {oscillate}]" - }, - humidifier: { - set_humidity: "ustaw wilgotność[ na {humidity}]", - set_mode: "ustaw tryb[ na {mode}]" - }, - input_number: { - set_value: "ustaw wartość[ na {value}]" - }, - input_select: { - select_option: "wybierz opcję[ {option}]" - }, - select: { - select_option: "wybierz opcję[ {option}]" - }, - light: { - turn_on: "zapal[ z jasnością {brightness}]" - }, - media_player: { - select_source: "wybierz źródło[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "wykonaj" - }, - vacuum: { - start_pause: "start / pauza" - }, - water_heater: { - set_operation_mode: "ustaw tryb[ na {operation_mode}]", - set_away_mode: "ustaw tryb nieobecności" - } - }; - var domains$b = { - alarm_control_panel: "panel kontrolny alarmu", - binary_sensor: "binary sensors", - climate: "klimatyzacja", - cover: "rolety", - fan: "wentylatory", - group: "grupy", - humidifier: "nawilżacze", - input_boolean: "wejście logiczne", - input_number: "wejście liczbowe", - input_select: "wybór wejścia", - light: "światła", - lock: "zamki", - media_player: "odtwarzacze", - notify: "notification", - "switch": "przełączniki", - vacuum: "odkurzacze", - water_heater: "podgrzewacze wody" - }; - var ui$b = { - components: { - date: { - day_types_short: { - daily: "codziennie", - workdays: "robocze", - weekend: "weekendy" - }, - day_types_long: { - daily: "codziennie", - workdays: "w dni robocze", - weekend: "podczas weekendu" - }, - days: "dni", - tomorrow: "jutro", - repeated_days: "co {days} dni", - repeated_days_except: "coddziennie z wyjątkiem {excludedDays}", - days_range: "od {startDay} do {endDay}", - next_week_day: "następna {weekday}" - }, - time: { - absolute: "o {time}", - interval: "od {startTime} do {endTime}", - at_midnight: "o północ", - at_noon: "o południe", - at_sun_event: "o {sunEvent}" - } - }, - panel: { - common: { - title: "Harmonogram" - }, - overview: { - no_entries: "Nie ma elementów do pokazania", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number} wykluczona {if number is 1} pozycja {else} pozycje", - hide_excluded: "ukryj wykluczone pozycje", - additional_tasks: "{number} dodatkowe {if number is 1} zadanie {else} zadań(nia)" - }, - entity_picker: { - no_groups_defined: "Nie ma zdefiniowanych grup", - no_group_selected: "Najpierw wybierz grupę", - no_entities_for_group: "Nie ma encji w tej grupie", - no_entity_selected: "Najpierw wybierz encję", - no_actions_for_entity: "Nie ma akcji dla tej encji", - make_scheme: "stwórz schemat", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Najpierw wybierz przedział czasowy", - time_scheme: "Schemat", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "jest równe ", - unequal_to: "nie jest równe", - all: "wszystkie", - any: "dowolny", - no_conditions_defined: "Nie ma zdefiniowanych warunków", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "zachowanie po zakończeniu", - period: "okres" - } - } - }; - var pl = { - services: services$b, - domains: domains$b, - ui: ui$b - }; - - var pl$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$b, - domains: domains$b, - ui: ui$b, - 'default': pl - }); - - var services$c = { - generic: { - parameter_to_value: "{parameter} para {value}", - action_with_parameter: "{action} com {parameter}" - }, - climate: { - set_temperature: "definir temperatura[ para {temperature}]", - set_temperature_hvac_mode_heat: "aquecimento[ para {temperature}]", - set_temperature_hvac_mode_cool: "arrefecimento[ para {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "definir modo[ para {hvac_mode}]", - set_preset_mode: "definir predefinição[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "fechar", - open_cover: "abrir", - set_cover_position: "definir posição[ para {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "definir velocidade[ para {speed}]", - set_direction: "definir direção[ para {direction}]", - oscillate: "definir oscilação[ para {oscillate}]" - }, - humidifier: { - set_humidity: "definir humidade[ para {humidity}]", - set_mode: "definir modo[ para {mode}]" - }, - input_number: { - set_value: "definir valor[ para {value}]" - }, - input_select: { - select_option: "selecionar opção[ {option}]" - }, - select: { - select_option: "selecionar opção[ {option}]" - }, - light: { - turn_on: "ligar[ com {brightness} brightness]" - }, - media_player: { - select_source: "selecionar origem[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "executar" - }, - vacuum: { - start_pause: "iniciar / pausar" - }, - water_heater: { - set_operation_mode: "definir modo[ para {operation_mode}]", - set_away_mode: "definir modo ausente" - } - }; - var domains$c = { - alarm_control_panel: "painel de controlo de alarme", - binary_sensor: "binary sensors", - climate: "ambiente", - cover: "estores", - fan: "ventiladores", - group: "grupos", - humidifier: "humidificadores", - input_boolean: "campo booleano", - input_number: "campo numérico", - input_select: "campo de opção", - light: "iluminação", - lock: "fechaduras", - media_player: "reprodutores de mídia", - notify: "notification", - "switch": "interruptores", - vacuum: "aspiradores", - water_heater: "aquecedores hidráulicos" - }; - var ui$c = { - components: { - date: { - day_types_short: { - daily: "todos", - workdays: "semana de trabalho", - weekend: "fim-de-semana" - }, - day_types_long: { - daily: "todos os dias", - workdays: "em dias de semana", - weekend: "no fim-de-semana" - }, - days: "dias", - tomorrow: "amanhã", - repeated_days: "a cada {days}", - repeated_days_except: "a cada dia exceto {excludedDays}", - days_range: "até {startDay} até {endDay}", - next_week_day: "próximo {weekday}" - }, - time: { - absolute: "Às {time}", - interval: "das {startTime} às {endTime}", - at_midnight: "ao meia-noite", - at_noon: "ao meio-dia", - at_sun_event: "ao {sunEvent}" - } - }, - panel: { - common: { - title: "Agenda" - }, - overview: { - no_entries: "Não existem itens a mostrar", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number}{if number is 1} item excluído {else} itens excluídos", - hide_excluded: "ocultar itens excluídos", - additional_tasks: "Mais {number} {if number is 1} tarefa {else} tarefas" - }, - entity_picker: { - no_groups_defined: "Não existem grupos definidos", - no_group_selected: "Selecione um grupo primeiro", - no_entities_for_group: "Não existem entidades neste grupo", - no_entity_selected: "Selecione uma entidade primeiro", - no_actions_for_entity: "Não existem ações para esta entidade", - make_scheme: "criar esquema", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "É necessário selecionar um período horário para escolher uma ação", - time_scheme: "Esquema", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "é", - unequal_to: "não é", - all: "todos(as)", - any: "qualquer", - no_conditions_defined: "Não existem condições definidas", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "comportamento após a conclusão", - period: "período" - } - } - }; - var pt = { - services: services$c, - domains: domains$c, - ui: ui$c - }; - - var pt$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$c, - domains: domains$c, - ui: ui$c, - 'default': pt - }); - - var services$d = { - generic: { - parameter_to_value: "{parameter} para {value}", - action_with_parameter: "{action} com {parameter}" - }, - climate: { - set_temperature: "definir temperatura[ para {temperature}]", - set_temperature_hvac_mode_heat: "aquecimento[ para {temperature}]", - set_temperature_hvac_mode_cool: "arrefecimento[ para {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "definir modo[ para {hvac_mode}]", - set_preset_mode: "definir predefinição[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "fechar", - open_cover: "abrir", - set_cover_position: "definir posição[ para {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "definir velocidade[ para {speed}]", - set_direction: "definir direção[ para {direction}]", - oscillate: "definir oscilação[ para {oscillate}]" - }, - humidifier: { - set_humidity: "definir humidade[ para {humidity}]", - set_mode: "definir modo[ para {mode}]" - }, - input_number: { - set_value: "definir valor[ para {value}]" - }, - input_select: { - select_option: "selecionar opção[ {option}]" - }, - select: { - select_option: "selecionar opção[ {option}]" - }, - light: { - turn_on: "ligar[ com {brightness} brightness]" - }, - media_player: { - select_source: "selecionar origem[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "executar" - }, - vacuum: { - start_pause: "iniciar / pausar" - }, - water_heater: { - set_operation_mode: "definir modo[ para {operation_mode}]", - set_away_mode: "definir modo ausente" - } - }; - var domains$d = { - alarm_control_panel: "painel de controlo de alarme", - binary_sensor: "binary sensors", - climate: "ambiente", - cover: "estores", - fan: "ventiladores", - group: "grupos", - humidifier: "humidificadores", - input_boolean: "campo booleano", - input_number: "campo numérico", - input_select: "campo de opção", - light: "iluminação", - lock: "fechaduras", - media_player: "reprodutores de mídia", - notify: "notification", - "switch": "interruptores", - vacuum: "aspiradores", - water_heater: "aquecedores hidráulicos" - }; - var ui$d = { - components: { - date: { - day_types_short: { - daily: "diário", - workdays: "semana de trabalho", - weekend: "fim-de-semana" - }, - day_types_long: { - daily: "todos os dias", - workdays: "em dias de semana", - weekend: "no fim-de-semana" - }, - days: "dias", - tomorrow: "amanhã", - repeated_days: "a cada {days}", - repeated_days_except: "a cada dia exceto {excludedDays}", - days_range: "até {startDay} até {endDay}", - next_week_day: "próximo {weekday}" - }, - time: { - absolute: "à {time}", - interval: "das {startTime} às {endTime}", - at_midnight: "ao meia-noite", - at_noon: "ao meio-dia", - at_sun_event: "ao {sunEvent}" - } - }, - panel: { - common: { - title: "Agenda" - }, - overview: { - no_entries: "Não existem itens a mostrar", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{number}{if number is 1} item excluído {else} itens excluídos", - hide_excluded: "ocultar itens excluídos", - additional_tasks: "Mais {number} {if number is 1} tarefa {else} tarefas" - }, - entity_picker: { - no_groups_defined: "Não existem grupos definidos", - no_group_selected: "Selecione um grupo primeiro", - no_entities_for_group: "Não existem entidades neste grupo", - no_entity_selected: "Selecione uma entidade primeiro", - no_actions_for_entity: "Não existem ações para esta entidade", - make_scheme: "criar esquema", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Selecionar um período horário primeiro", - time_scheme: "Esquema", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "é", - unequal_to: "não é", - all: "todos(as)", - any: "qualquer", - no_conditions_defined: "Não existem condições definidas", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "comportamento após a conclusão", - period: "período" - } - } - }; - var ptBr = { - services: services$d, - domains: domains$d, - ui: ui$d - }; - - var pt_br = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$d, - domains: domains$d, - ui: ui$d, - 'default': ptBr - }); - - var services$e = { - generic: { - parameter_to_value: "{parameter} la {value}", - action_with_parameter: "{action} cu {parameter}" - }, - climate: { - set_temperature: "setare temperatură[ la {temperature}]", - set_temperature_hvac_mode_heat: "încălzire[ la {temperature}]", - set_temperature_hvac_mode_cool: "răcire[ la {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "setare mod[ la {hvac_mode}]", - set_preset_mode: "setare preset[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "închidere", - open_cover: "deschidere", - set_cover_position: "setare poziție[ la {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "setare viteză[ la {speed}]", - set_direction: "setare direcție[ la {direction}]", - oscillate: "setare oscilare[ la {oscillate}]" - }, - humidifier: { - set_humidity: "setare umiditate[ la {humidity}]", - set_mode: "setare mod[ la {mode}]" - }, - input_number: { - set_value: "setare valoare[ la {value}]" - }, - input_select: { - select_option: "selectare opțiune[ {option}]" - }, - select: { - select_option: "selectare opțiune[ {option}]" - }, - light: { - turn_on: "pornire[ cu luminozitate {brightness}]" - }, - media_player: { - select_source: "selectare sursă[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "executare" - }, - vacuum: { - start_pause: "start / pauză" - }, - water_heater: { - set_operation_mode: "setare mod[ la {operation_mode}]", - set_away_mode: "setare mod plecat" - } - }; - var domains$e = { - alarm_control_panel: "panou control alarmă", - binary_sensor: "binary sensors", - climate: "climat", - cover: "jaluzele", - fan: "ventilatoare", - group: "grupuri", - humidifier: "umidificatoare", - input_boolean: "input boolean", - input_number: "input număr", - input_select: "input selecție", - light: "lumini", - lock: "încuietori", - media_player: "media playere", - notify: "notification", - "switch": "întrerupătoare", - vacuum: "aspiratoare", - water_heater: "încălzitoare apă" - }; - var ui$e = { - components: { - date: { - day_types_short: { - daily: "zilnic", - workdays: "zile lucrătoare", - weekend: "sfârșit de săptămână" - }, - day_types_long: { - daily: "zilnic", - workdays: "în timpul săptămânii", - weekend: "la sfârșit de săptămână" - }, - days: "zile", - tomorrow: "mâine", - repeated_days: "la fiecare {days} zile", - repeated_days_except: "zilnic cu excepția {excludedDays}", - days_range: "din {startDay} până în {endDay}", - next_week_day: "{weekday} viitoare" - }, - time: { - absolute: "la {time}", - interval: "de la {startTime} până la {endTime}", - at_midnight: "la miezul nopții", - at_noon: "la amiază", - at_sun_event: "la {sunEvent}" - } - }, - panel: { - common: { - title: "Planificator" - }, - overview: { - no_entries: "Nu există elemente de afișat", - backend_error: "Could not connect with the scheduler component. It needs to be installed as integration before this card can be used.", - excluded_items: "{if number is 1}un element exclus {else}{number} elemente excluse", - hide_excluded: "ascunde elementele excluse", - additional_tasks: "{if number is 1}o sarcină suplimentară {else}{number} sarcini suplimentare" - }, - entity_picker: { - no_groups_defined: "Nu există grupuri definite", - no_group_selected: "Prima dată selectați un grup", - no_entities_for_group: "Nu există entități definite în acest grup", - no_entity_selected: "Prima dată selectați o entitate", - no_actions_for_entity: "Nu există acțiuni pentru această entitate", - make_scheme: "creare schemă", - multiple: "Multiple" - }, - time_picker: { - no_timeslot_selected: "Prima dată selectați un interval orar", - time_scheme: "Schemă", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "este", - unequal_to: "nu este", - all: "tot", - any: "oricare", - no_conditions_defined: "Nu există condiții definite", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "comportament după declanșare", - period: "perioadă" - } - } - }; - var ro = { - services: services$e, - domains: domains$e, - ui: ui$e - }; - - var ro$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$e, - domains: domains$e, - ui: ui$e, - 'default': ro - }); - - var services$f = { - generic: { - parameter_to_value: "{parameter} к {value}", - action_with_parameter: "{action} с {parameter}" - }, - climate: { - set_temperature: "установить температуру[ {temperature}]", - set_temperature_hvac_mode_heat: "обогрев[ {temperature}]", - set_temperature_hvac_mode_cool: "охлаждение[ {temperature}]", - set_temperature_hvac_mode_heat_cool: "регулировать[ в пределах {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "установить режим[ {hvac_mode}]", - set_preset_mode: "выбрать набор настроек[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "закрыть", - open_cover: "открыть", - set_cover_position: "установить позицию[ {position}]", - set_cover_tilt_position: "установить наклон[ {tilt_position}]" - }, - fan: { - set_speed: "установить скорость[ {speed}]", - set_direction: "установить направление[ {direction}]", - oscillate: "установить колебание[ {oscillate}]" - }, - humidifier: { - set_humidity: "установить влажность[ {humidity}]", - set_mode: "установить режим[ {mode}]" - }, - input_number: { - set_value: "установить значение[ в {value}]" - }, - input_select: { - select_option: "установить опцию[ {option}]" - }, - select: { - select_option: "установить опцию[ {option}]" - }, - light: { - turn_on: "включить[ с {brightness} яркостью]" - }, - media_player: { - select_source: "выбрать источник[ {source}]" - }, - notify: { - notify: "послать сообщение" - }, - script: { - script: "запустить" - }, - vacuum: { - start_pause: "старт / пауза" - }, - water_heater: { - set_operation_mode: "установить режим[ {operation_mode}]", - set_away_mode: "установить режим вне дома" - } - }; - var domains$f = { - alarm_control_panel: "панель управления сигнализацией", - binary_sensor: "binary sensors", - climate: "климат", - cover: "жалюзи", - fan: "вентиляторы", - group: "группы", - humidifier: "увлажнители", - input_boolean: "логические", - input_number: "числовые", - input_select: "списки", - light: "освещение", - lock: "замки", - media_player: "медиа-плееры", - notify: "notification", - "switch": "розетки", - vacuum: "пылесосы", - water_heater: "подогреватели воды" - }; - var ui$f = { - components: { - date: { - day_types_short: { - daily: "ежедневно", - workdays: "рабочие дни", - weekend: "выходные" - }, - day_types_long: { - daily: "каждый день", - workdays: "по рабочим дням", - weekend: "в выходные" - }, - days: "дни", - tomorrow: "завтра", - repeated_days: "каждый {days}", - repeated_days_except: "каждый день кроме {excludedDays}", - days_range: "с {startDay} до {endDay}", - next_week_day: "в следующую {weekday}" - }, - time: { - absolute: "в {time}", - interval: "с {startTime} до {endTime}", - at_midnight: "в полночь", - at_noon: "в полдень", - at_sun_event: "в {sunEvent}" - } - }, - panel: { - common: { - title: "Планировщик" - }, - overview: { - no_entries: "Отсутствуют элементы", - backend_error: "Нет соединенияс scheduler component. Scheduler component должен быть установлен до применения этой карты.", - excluded_items: "{number} исключено {if number is 1} элемент {else} элементов", - hide_excluded: "скрыть исключенные элементы", - additional_tasks: "{number} больше {if number is 1} задача {else} задач" - }, - entity_picker: { - no_groups_defined: "Не определены группы", - no_group_selected: "Выберите группу", - no_entities_for_group: "Отсутствуют элементы в группе", - no_entity_selected: "Выберите элемент", - no_actions_for_entity: "Нет действий для этого элемента", - make_scheme: "создать схему", - multiple: "Множественный" - }, - time_picker: { - no_timeslot_selected: "Выберите временной слот", - time_scheme: "Cхему", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "равно", - unequal_to: "не равно", - all: "все", - any: "любое", - no_conditions_defined: "Не определены условия", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "поведение после срабатывания", - period: "период" - } - } - }; - var ru = { - services: services$f, - domains: domains$f, - ui: ui$f - }; - - var ru$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$f, - domains: domains$f, - ui: ui$f, - 'default': ru - }); - - var services$g = { - generic: { - parameter_to_value: "{parameter} na {value}", - action_with_parameter: "{action} s {parameter}" - }, - climate: { - set_temperature: "nastaviť teplotu[ na {temperature}]", - set_temperature_hvac_mode_heat: "vykurovanie[ na {temperature}]", - set_temperature_hvac_mode_cool: "chladenie[ na {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "nastaviť režim[ na {hvac_mode}]", - set_preset_mode: "nastaviť predvoľbu[ {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "zatvoriť", - open_cover: "otvoriť", - set_cover_position: "nastaviť polohu[ na {position}]", - set_cover_tilt_position: "nastaviť naklonenie[ na {tilt_position}]" - }, - fan: { - set_speed: "nastaviť rýchlosť[ na {speed}]", - set_direction: "nastaviť smer[ na {direction}]", - oscillate: "nastaviť osciláciu[ na {oscillate}]" - }, - humidifier: { - set_humidity: "nastaviť vlhkosť[ na {humidity}]", - set_mode: "nastaviť režim[ na {mode}]" - }, - input_number: { - set_value: "nastaviť hodnotu[ na {value}]" - }, - input_select: { - select_option: "vybrať možnosť[ {option}]" - }, - select: { - select_option: "vybrať možnosť[ {option}]" - }, - light: { - turn_on: "zapnúť[ na {brightness} jas]" - }, - media_player: { - select_source: "vybrať zdroj[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "spustiť" - }, - vacuum: { - start_pause: "štart / pauza" - }, - water_heater: { - set_operation_mode: "nastaviť režim[ na {operation_mode}]", - set_away_mode: "nastaviť mód neprítomný" - } - }; - var domains$g = { - alarm_control_panel: "ovládací panel alarmu", - binary_sensor: "binary sensors", - climate: "klimatizácia", - cover: "rolety", - fan: "ventilátory", - group: "skupiny", - humidifier: "zvlhčovače", - input_boolean: "input boolean", - input_number: "input number", - input_select: "input select", - light: "svetlá", - lock: "zámky", - media_player: "mediálne prehrávače", - notify: "notification", - "switch": "vypínače", - vacuum: "vysávače", - water_heater: "ohrievače vody" - }; - var ui$g = { - components: { - date: { - day_types_short: { - daily: "denne", - workdays: "pracovné dni", - weekend: "víkend" - }, - day_types_long: { - daily: "každý deň", - workdays: "cez pracovné dni", - weekend: "cez víkend" - }, - days: "dni", - tomorrow: "zajtra", - repeated_days: "každý {days}", - repeated_days_except: "každý deň okrem {excludedDays}", - days_range: "od {startDay} do {endDay}", - next_week_day: "budúcu {weekday}" - }, - time: { - absolute: "od {time}", - interval: "od {startTime} do {endTime}", - at_midnight: "od polnoci", - at_noon: "od obeda", - at_sun_event: "na {sunEvent}" - } - }, - panel: { - common: { - title: "Plánovač" - }, - overview: { - no_entries: "Žiadne položky k zobrazeniu", - backend_error: "Nepodarilo sa pripojiť k Scheduler Component. Musí byť nainštalovaný ako integrácia pred použitím tejto karty.", - excluded_items: "Vylúčené položky: {number}", - hide_excluded: "skryť vylúčené položky", - additional_tasks: "Ďalšie úlohy: {number}" - }, - entity_picker: { - no_groups_defined: "Nie sú definované žiadne skupiny", - no_group_selected: "Najprv vyberte skupinu", - no_entities_for_group: "V tejto skupine nie sú žiadne entity", - no_entity_selected: "Najprv vyberte entitu", - no_actions_for_entity: "Pre túto entitu neexistujú žiadne akcie", - make_scheme: "vytvoriť schému", - multiple: "Viacero" - }, - time_picker: { - no_timeslot_selected: "Najprv vyberte časový úsek", - time_scheme: "Schému", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "je", - unequal_to: "nie je", - all: "Všetko", - any: "žiadny", - no_conditions_defined: "Nie sú definované žiadne podmienky", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "správanie sa po spustení", - period: "obdobie" - } - } - }; - var sk = { - services: services$g, - domains: domains$g, - ui: ui$g - }; - - var sk$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$g, - domains: domains$g, - ui: ui$g, - 'default': sk - }); - - var services$h = { - generic: { - parameter_to_value: "{parameter} до {value}", - action_with_parameter: "{action} з {parameter}" - }, - climate: { - set_temperature: "встановити температуру[ to {temperature}]", - set_temperature_hvac_mode_heat: "нагрів[ to {temperature}]", - set_temperature_hvac_mode_cool: "охолодження[ to {temperature}]", - set_temperature_hvac_mode_heat_cool: "regulate[ to {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "встановити режим[ to {hvac_mode}]", - set_preset_mode: "вибрати пресет[ to {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "закрити", - open_cover: "відкрити", - set_cover_position: "встановити позицію[ to {position}]", - set_cover_tilt_position: "set tilt position[ to {tilt_position}]" - }, - fan: { - set_speed: "встановити швидкість[ to {speed}]", - set_direction: "встановити напрямок[ to {direction}]", - oscillate: "встановити коливання[ to {oscillate}]" - }, - humidifier: { - set_humidity: "встановити вологість[ to {humidity}]", - set_mode: "встановити режим[ to {mode}]" - }, - input_number: { - set_value: "встановити значення[ to {value}]" - }, - input_select: { - select_option: "встановити опцію[ {option}]" - }, - select: { - select_option: "встановити опцію[ {option}]" - }, - light: { - turn_on: "увімкнути[ з {brightness} якскравістю]" - }, - media_player: { - select_source: "вибрати джерело[ {source}]" - }, - notify: { - notify: "send notification" - }, - script: { - script: "виконати" - }, - vacuum: { - start_pause: "старт / пауза" - }, - water_heater: { - set_operation_mode: "встановити режим[ to {operation_mode}]", - set_away_mode: "встановити режим Не вдома" - } - }; - var domains$h = { - alarm_control_panel: "панель керування сигналізацією", - binary_sensor: "binary sensors", - climate: "клімат", - cover: "жалюзі", - fan: "вентилятори", - group: "групи", - humidifier: "зволожувачі", - input_boolean: "логічні", - input_number: "числові", - input_select: "списки", - light: "освітлення", - lock: "замки", - media_player: "медіаплеєри", - notify: "notification", - "switch": "вимикачі", - vacuum: "пилососи", - water_heater: "водонагрівачі" - }; - var ui$h = { - components: { - date: { - day_types_short: { - daily: "щоденно", - workdays: "робочі дні", - weekend: "вихідні" - }, - day_types_long: { - daily: "кожного дня", - workdays: "в робочі дні", - weekend: "по вихідних" - }, - days: "дні", - tomorrow: "завтра", - repeated_days: "кожні {days}", - repeated_days_except: "кожного дня окрім {excludedDays}", - days_range: "з {startDay} до {endDay}", - next_week_day: "наступної {weekday}" - }, - time: { - absolute: "о {time}", - interval: "з {startTime} до {endTime}", - at_midnight: "опівночі", - at_noon: "опівдні", - at_sun_event: "о {sunEvent}" - } - }, - panel: { - common: { - title: "Планувальник" - }, - overview: { - no_entries: "Елементи відсутні", - backend_error: "Не вдалося підключитися до компонента планувальника. Перш ніж використовувати цю карту, її потрібно встановити як інтеграцію.", - excluded_items: "{number} виключено {if number is 1} елемент {else} елементів", - hide_excluded: "сховати виключені елементи", - additional_tasks: "{number} більше {if number is 1} завдання {else} завдань" - }, - entity_picker: { - no_groups_defined: "Немає визначених груп", - no_group_selected: "Спершу виберіть групу", - no_entities_for_group: "В даній групі відсутні елементи", - no_entity_selected: "Спершу виберіть елемент", - no_actions_for_entity: "Немає дій для цього елемента", - make_scheme: "створити схему", - multiple: "Декілька" - }, - time_picker: { - no_timeslot_selected: "Спершу виберіть часовий проміжок", - time_scheme: "Cхему", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "дорівнює", - unequal_to: "не рівне", - all: "всі", - any: "будь-яке", - no_conditions_defined: "Не визначені умови", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "поведінка після спрацювання", - period: "період" - } - } - }; - var uk = { - services: services$h, - domains: domains$h, - ui: ui$h - }; - - var uk$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$h, - domains: domains$h, - ui: ui$h, - 'default': uk - }); - - var services$i = { - generic: { - parameter_to_value: "{parameter} 至 {value}", - action_with_parameter: "{action} 使用 {parameter}" - }, - climate: { - set_temperature: "设定温度[ 至 {temperature}]", - set_temperature_hvac_mode_heat: "制热模式[ 至 {temperature}]", - set_temperature_hvac_mode_cool: "制冷模式[ 至 {temperature}]", - set_temperature_hvac_mode_heat_cool: "调节[ 至 {target_temp_low} - {target_temp_high}]", - set_hvac_mode: "设定模式[ 为 {hvac_mode}]", - set_preset_mode: "设定预设模式[ 为 {preset_mode}]", - set_fan_mode: "set fan mode[ to {fan_mode}]" - }, - cover: { - close_cover: "关闭", - open_cover: "打开", - set_cover_position: "设定位置[ 至 {position}]", - set_cover_tilt_position: "设定倾斜位置[ 至 {tilt_position}]" - }, - fan: { - set_speed: "设定风速[ 至 {speed}]", - set_direction: "设定方向[ 至 {direction}]", - oscillate: "设置摇摆[ 至 {oscillate}]" - }, - humidifier: { - set_humidity: "设定湿度[ 至 {humidity}]", - set_mode: "设定模式[ 为 {mode}]" - }, - input_number: { - set_value: "设定数值[ 至 {value}]" - }, - input_select: { - select_option: "选择选项[ {option}]" - }, - select: { - select_option: "选择选项[ {option}]" - }, - light: { - turn_on: "打开[ 并设定亮度为 {brightness}]" - }, - media_player: { - select_source: "选择播放源[ {source}]" - }, - notify: { - notify: "发送通知" - }, - script: { - script: "执行" - }, - vacuum: { - start_pause: "开始 / 暂停" - }, - water_heater: { - set_operation_mode: "设定模式[ 为 {operation_mode}]", - set_away_mode: "设定离开模式" - } - }; - var domains$i = { - alarm_control_panel: "警戒控制面板", - binary_sensor: "binary sensors", - climate: "空调/地暖", - cover: "窗帘", - fan: "风扇/空气净化器", - group: "实体组", - humidifier: "空气加湿器", - input_boolean: "输入二元选择器", - input_number: "输入数值", - input_select: "输入选择", - light: "灯具", - lock: "门锁", - media_player: "媒体播放器", - notify: "notification", - "switch": "开关", - vacuum: "扫地机/吸尘器", - water_heater: "热水器" - }; - var ui$i = { - components: { - date: { - day_types_short: { - daily: "每日", - workdays: "工作日", - weekend: "周末" - }, - day_types_long: { - daily: "每一天", - workdays: "在工作日", - weekend: "在周末" - }, - days: "天", - tomorrow: "明天", - repeated_days: "每 {days}", - repeated_days_except: "每天,除了 {excludedDays}", - days_range: "从 {startDay} 至 {endDay}", - next_week_day: "下{weekday}" - }, - time: { - absolute: "在 {time}", - interval: "从 {startTime} 至 {endTime}", - at_midnight: "在午夜", - at_noon: "在正午", - at_sun_event: "在 {sunEvent}" - } - }, - panel: { - common: { - title: "计划任务" - }, - overview: { - no_entries: "无事项", - backend_error: "计划任务组件关联失败。本卡片使用前,需先安装计划任务组件和集成.", - excluded_items: "{number} 除外 {if number is 1} 事项 {else} 事项", - hide_excluded: "隐藏除外事项", - additional_tasks: "{number} 更多 {if number is 1} 任务 {else} 任务" - }, - entity_picker: { - no_groups_defined: "未添加需执行计划任务的群组", - no_group_selected: "请选择群组", - no_entities_for_group: "群组不含实体", - no_entity_selected: "请选择实体", - no_actions_for_entity: "该实体不含可执行的动作", - make_scheme: "制定计划", - multiple: "多选" - }, - time_picker: { - no_timeslot_selected: "请选择时间段", - time_scheme: "议程", - time_input_mode: "Time control mode" - }, - conditions: { - equal_to: "是", - unequal_to: "非", - all: "全部", - any: "任一", - no_conditions_defined: "未定义条件", - track_conditions: "Re-evaluate when conditions change" - }, - options: { - repeat_type: "触发后的行为", - period: "时期" - } - } - }; - var zhHans = { - services: services$i, - domains: domains$i, - ui: ui$i - }; - - var zh_Hans = /*#__PURE__*/Object.freeze({ - __proto__: null, - services: services$i, - domains: domains$i, - ui: ui$i, - 'default': zhHans - }); - - const languages = { - cs: cs$1, - de: de$1, - en: en$1, - es: es$1, - et: et$1, - es_419: es$1, - fr: fr$1, - he: he$1, - hu: hu$1, - it: it$1, - nb: no$1, - nl: nl$1, - nn: no$1, - no: no$1, - pl: pl$1, - pt: pt$1, - pt_BR: pt_br, - ro: ro$1, - sk: sk$1, - ru: ru$1, - uk: uk$1, - 'zh-Hans': zh_Hans, - }; - function localize(string, locale, search = '', replace = '') { - let translated; - try { - if (locale.language == 'test') - return 'TRANSLATED'; - translated = string.split('.').reduce((o, i) => o[i], languages[locale.language]); - if (!translated) - translated = string.split('.').reduce((o, i) => o[i], languages['en']); - } - catch (e) { - try { - translated = string.split('.').reduce((o, i) => o[i], languages['en']); - } - catch (e) { - translated = ''; - } - } - if (search !== '' && replace !== '' && translated) { - if (!Array.isArray(search)) - search = [search]; - if (!Array.isArray(replace)) - replace = [replace]; - for (let i = 0; i < search.length; i++) { - translated = translated.replace(String(search[i]), String(replace[i])); - const res = translated.match(/\{if ([a-z]+) is ([^\}]+)\}\ ?([^\{]+)\ ?\{else\}\ ?([^\{]+)/i); - if (res && String(search[i]).replace(/[\{\}']+/g, '') == res[1]) { - const is_match = String(replace[i]) == res[2]; - if (is_match) - translated = translated.replace(res[0], res[3]); - else - translated = translated.replace(res[0], res[4]); - } - } - } - // if (!translated) { - // console.log(`missing translation for ${string}`); - // } - return translated; + .card-content > *:last-child { + margin-bottom: 0; } - - const commonStyle = i ` - .card-header { - display: flex; - justify-content: space-between; - } - .card-header .name { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - display: flex; - } - .card-header ha-switch { - padding: 5px; - } - .card-header ha-icon-button { - position: absolute; - right: 6px; - top: 6px; - } - .card-content { - flex: 1; - } - .card-content > *:first-child { - margin-top: 0; - } - .card-content > *:last-child { - margin-bottom: 0; - } - div.text-field, div.secondary { - color: var(--secondary-text-color); - } - .disabled { - color: var(--disabled-text-color); - } - div.header { - color: var(--secondary-text-color); - text-transform: uppercase; - font-weight: 500; - font-size: 12px; - margin: 20px 0px 0px 0px; - display: flex; - flex-direction: row; - } - div.header .switch { - text-transform: none; - font-weight: normal; - font-size: 14px; - display: flex; - flex-grow: 1; - justify-content: flex-end; - } - div.header ha-switch { - display: flex; - align-self: center; - margin: 0px 8px; - line-height: 24px; - } - mwc-button { - margin: 2px 0px; - } - mwc-button.active { - background: var(--primary-color); - --mdc-theme-primary: var(--text-primary-color); - border-radius: 4px; - } - mwc-button ha-icon { - margin-right: 11px; - } - mwc-button.warning { - --mdc-theme-primary: var(--error-color); - } - div.checkbox-container { - display: grid; - grid-template-columns: max-content 1fr max-content; - grid-template-rows: min-content; - grid-template-areas: "checkbox slider value"; - grid-gap: 0px 10px; - } - div.checkbox-container div.checkbox { - grid-area: checkbox; - display: flex; - align-items: center;x - } - div.checkbox-container div.slider { - grid-area: slider; - display: flex; - align-items: center; - } - div.checkbox-container div.value { - grid-area: value; - min-width: 40px; - display: flex; - align-items: center; - } - a { - color: var(--primary-color); - } - a:visited { - color: var(--accent-color); - } - `; - - const SubscribeMixin = (superClass) => { - class SubscribeClass extends superClass { - connectedCallback() { - super.connectedCallback(); - this.__checkSubscribed(); - } - disconnectedCallback() { - super.disconnectedCallback(); - if (this.__unsubs) { - while (this.__unsubs.length) { - const unsub = this.__unsubs.pop(); - if (unsub instanceof Promise) { - unsub.then(unsubFunc => unsubFunc()); - } - else { - unsub(); - } - } - this.__unsubs = undefined; - } - } - updated(changedProps) { - super.updated(changedProps); - if (changedProps.has('hass')) { - this.__checkSubscribed(); - } - } - hassSubscribe() { - return []; - } - __checkSubscribed() { - if (this.__unsubs !== undefined || !this.isConnected || this.hass === undefined) { - return; - } - this.__unsubs = this.hassSubscribe(); - } - } - __decorate([ - e$3({ attribute: false }) - ], SubscribeClass.prototype, "hass", void 0); - return SubscribeClass; - }; - - const fetchSchedules = (hass) => hass.callWS({ - type: 'scheduler', - }); - const fetchScheduleItem = (hass, schedule_id) => hass.callWS({ - type: 'scheduler/item', - schedule_id: schedule_id, - }); - const saveSchedule = (hass, config) => { - return hass.callApi('POST', 'scheduler/add', config); - }; - const editSchedule = (hass, config) => { - return hass.callApi('POST', 'scheduler/edit', config); - }; - const deleteSchedule = (hass, schedule_id) => { - return hass.callApi('POST', 'scheduler/remove', { schedule_id: schedule_id }); - }; - const fetchTags = (hass) => hass.callWS({ - type: 'scheduler/tags', - }); - function showErrorDialog(target, error) { - A$1(target, 'show-dialog', { - dialogTag: 'dialog-error', - dialogImport: () => Promise.resolve().then(function () { return dialogError; }), - dialogParams: { error: error }, - }); - } - function handleError(err, el) { - const errorMessage = T ` - Something went wrong!
- ${err.body.message}

- ${err.error}

- Please report the bug. - `; - showErrorDialog(el, errorMessage); + div.text-field, div.secondary { + color: var(--secondary-text-color); } - - function matchPattern(pattern, value) { - let res = false; - if (pattern.match(/^[a-z0-9_\.]+$/)) { - res = !pattern.includes('.') && value.includes('.') ? pattern == g$1(value) : pattern == value; - } - else { - try { - if ((pattern.startsWith('/') && pattern.endsWith('/')) || pattern.indexOf('*') !== -1) { - if (!pattern.startsWith('/')) { - pattern = pattern.replace(/\./g, '.').replace(/\*/g, '.*'); - pattern = `/^${pattern}$/`; - } - const regex = new RegExp(pattern.slice(1, -1)); - res = regex.test(value); - } - } - catch (e) { } - } - return res; + .disabled { + color: var(--disabled-text-color); } - - function entityFilter(entity_id, config) { - var _a; - const applyFilter = (value, filter) => { - return (((filter.include || []).some(e => matchPattern(e, value)) || - Object.keys(filter.customize || {}).some(e => matchPattern(e, value))) && - !(filter.exclude || []).some(e => matchPattern(e, value))); - }; - return ((_a = config.groups) === null || _a === void 0 ? void 0 : _a.some(group => applyFilter(entity_id, group))) || applyFilter(entity_id, config); + div.header { + color: var(--secondary-text-color); + text-transform: uppercase; + font-weight: 500; + font-size: 12px; + margin: 20px 0px 0px 0px; + display: flex; + flex-direction: row; } - - const binarySensorIcon = (stateObj) => { - if (stateObj) - return re(Object.assign(Object.assign({}, stateObj), { state: 'off' })) || 'mdi:radiobox-blank'; - else - return 'mdi:radiobox-blank'; - }; - const sensorIcon = (stateObj) => { - var _a; - const deviceClass = stateObj.attributes.device_class || ''; - switch (deviceClass) { - case 'humidity': - return 'mdi:water-percent'; - case 'illuminance': - return 'mdi:brightness-5'; - case 'temperature': - return 'mdi:thermometer'; - case 'power': - return 'mdi:flash'; - case 'pressure': - return 'mdi:gauge'; - case 'signal_strength': - return 'mdi:wifi'; - default: - return ((_a = stateObj.attributes.unit_of_measurement) === null || _a === void 0 ? void 0 : _a.includes('°')) ? 'mdi:thermometer' : 'mdi:eye'; - } - }; - const coverIcon = (stateObj, state) => { - const closedState = state == 'closed'; - switch (stateObj.attributes.device_class) { - case 'garage': - return closedState ? 'mdi:garage' : 'mdi:garage-open'; - case 'door': - return closedState ? 'mdi:door-closed' : 'mdi:door-open'; - case 'blind': - return closedState ? 'mdi:blinds' : 'mdi:blinds-open'; - case 'window': - return closedState ? 'mdi:window-closed' : 'mdi:window-open'; - default: - return closedState ? 'mdi:window-shutter' : 'mdi:window-shutter-open'; - } - }; - const domainIcons = { - alarm_control_panel: 'hass:alarm-light-outline', - automation: 'hass:playlist-play', - binary_sensor: 'hass:radiobox-blank', - calendar: 'hass:calendar', - camera: 'hass:camera', - climate: 'hass:home-thermometer-outline', - cover: 'hass:window-shutter', - device_tracker: 'hass:account', - fan: 'hass:fan', - group: 'hass:google-circles-communities', - humidifier: 'hass:air-humidifier', - input_boolean: 'hass:drawing', - input_number: 'hass:ray-vertex', - input_select: 'hass:format-list-bulleted', - select: 'hass:format-list-bulleted', - input_text: 'hass:textbox', - light: 'hass:lightbulb-outline', - lock: 'hass:lock-open-outline', - media_player: 'hass:cast-connected', - number: 'hass:ray-vertex', - notify: 'hass:message-text-outline', - person: 'hass:account-outline', - proximity: 'hass:map-marker-distance', - remote: 'hass:remote', - scene: 'hass:palette-outline', - script: 'hass:file-document', - sensor: 'hass:eye', - sun: 'hass:white-balance-sunny', - switch: 'hass:flash', - timer: 'hass:timer', - vacuum: 'hass:robot-vacuum', - water_heater: 'hass:water-boiler', - }; - const standardIcon = (entity_id, hass) => { - const domain = g$1(entity_id); - const stateObj = hass.states[entity_id]; - switch (domain) { - case 'binary_sensor': - return binarySensorIcon(stateObj); - case 'cover': - return coverIcon(stateObj); - case 'sensor': - return sensorIcon(stateObj); - default: - if (domain in domainIcons) - return domainIcons[domain]; - return 'hass:folder-outline'; - } - }; - - function compareActions(actionA, actionB, allowVars = false) { - const isOptional = (variable, action) => { - return (Object.keys(action.variables || {}).includes(variable) && - action.variables[variable].type == EVariableType.Level && - action.variables[variable].optional); - }; - //actions should have the same service - if (actionA.service !== actionB.service) - return false; - const serviceDataA = Object.keys(actionA.service_data || {}); - const variablesA = Object.keys(actionA.variables || {}); - const serviceDataB = Object.keys(actionB.service_data || {}); - const variablesB = Object.keys(actionB.variables || {}); - const argsA = [...new Set([...serviceDataA, ...variablesA])]; - const argsB = [...new Set([...serviceDataB, ...variablesB])]; - const allArgs = [...new Set([...argsA, ...argsB])]; - return allArgs.every(arg => { - // both actions must have the parameter in common - if (!argsA.includes(arg)) - return isOptional(arg, actionB); - if (!argsB.includes(arg)) - return isOptional(arg, actionA); - // if its a fixed parameter it must be equal - if (serviceDataA.filter(e => !variablesA.includes(e)).includes(arg) && - serviceDataB.filter(e => !variablesB.includes(e)).includes(arg)) - return actionA.service_data[arg] === actionB.service_data[arg]; - // if both are variables they are assumed to be equal - if (variablesA.includes(arg) && variablesB.includes(arg)) - return true; - if (!allowVars) - return false; - // compare a fixed value with variable - const value = serviceDataA.includes(arg) ? actionA.service_data[arg] : actionB.service_data[arg]; - const variable = variablesA.includes(arg) ? actionA.variables[arg] : actionB.variables[arg]; - if (variable.type === EVariableType.List) { - return variable.options.some(e => e.value === value); - } - else if (variable.type === EVariableType.Level) - return !isNaN(value); - else if (variable.type == EVariableType.Text) - return true; - return false; - }); + div.header .switch { + text-transform: none; + font-weight: normal; + font-size: 14px; + display: flex; + flex-grow: 1; + justify-content: flex-end; } - - const numericAttribute = (stateObj, attribute, fallback) => { - if (typeof attribute == 'number') - return attribute; - if (!isDefined(stateObj) || !isDefined(stateObj.attributes[attribute])) - return fallback; - const val = stateObj.attributes[attribute]; - if (typeof val == 'number') - return val; - return fallback; - }; - const listAttribute = (stateObj, attribute, initializer = []) => { - if (!isDefined(stateObj) || !isDefined(stateObj.attributes[attribute])) - return initializer; - const val = stateObj.attributes[attribute]; - if (Array.isArray(val)) - return val.map(e => String(e)); - return initializer; - }; - const stringAttribute = (stateObj, attribute, initializer = '') => { - if (!isDefined(stateObj) || !isDefined(stateObj.attributes[attribute])) - return initializer; - const val = stateObj.attributes[attribute]; - if (typeof val == 'string') - return val; - return initializer; - }; - - const parseVariable = (config, stateObj, hass) => { - const res = 'template' in config && isDefined(config.template) - ? Object.assign(Object.assign({}, omit(config, 'template')), config.template(stateObj, hass)) : Object.assign({}, config); - if ('options' in res) { - return parseListVariable(res, stateObj); - } - else if ('min' in res && 'max' in res) { - return parseLevelVariable(res, stateObj); - } - else { - return res; - } - }; - const parseListVariable = (config, stateObj) => { - if (typeof config.options == 'string') { - let res = listAttribute(stateObj, config.options); - return { - options: res.map(e => Object({ value: e })), - }; - } - else if (Array.isArray(config.options)) { - return { - options: config.options.map(e => Object({ value: e })), - }; - } - else { - return { - options: Object.entries(config.options).map(([k, v]) => Object(Object.assign({ value: k }, v))), - }; - } - }; - const parseLevelVariable = (config, stateObj) => { - let result = pick(config, ['unit', 'optional', 'scale_factor']); - if (isDefined(config.min)) - result = Object.assign(Object.assign({}, result), { min: numericAttribute(stateObj, config.min) }); - if (isDefined(config.max)) - result = Object.assign(Object.assign({}, result), { max: numericAttribute(stateObj, config.max) }); - if (isDefined(config.step)) - result = Object.assign(Object.assign({}, result), { step: numericAttribute(stateObj, config.step) }); - if (isDefined(config.unit) && config.unit == 'unit_of_measurement') - result = Object.assign(Object.assign({}, result), { unit: stringAttribute(stateObj, config.unit, '') }); - return result; - }; - - function levelVariable(...config) { - //factory function to create LevelVariable from configuration - const min = config.map(e => e.min).filter(isDefined); - const max = config.map(e => e.max).filter(isDefined); - const step = config.map(e => e.step).filter(isDefined); - const scale_factor = unique(config.map(e => e.scale_factor).filter(isDefined)); - const optional = config.map(e => e.optional).filter(isDefined); - const unit = config.map(e => e.unit).filter(isDefined); - const name = config.map(e => e.name).filter(isDefined); - const stepSize = step.length ? Math.max(...step) : 1; - const round = (val) => { - val = Math.round(val / stepSize) * stepSize; - return parseFloat(val.toPrecision(12)); - }; - const variable = { - type: EVariableType.Level, - min: round(min.length ? Math.min(...min) : 0), - max: round(max.length ? Math.max(...max) : 255), - step: stepSize, - scale_factor: scale_factor.length == 1 ? scale_factor[0] : 1, - optional: (optional.length && optional.every(e => e)) || false, - unit: unit.length ? unit.reduce((_acc, val) => val) : '', - name: name.length ? name.reduce((_acc, val) => val) : undefined, - }; - return variable; - } - function levelVariableDisplay(value, variable) { - let val = Number(value); - if (isNaN(val)) - return ''; - if (variable.scale_factor != 1) { - val = val / variable.scale_factor; - val = Math.round(val / variable.step) * variable.step; - val = parseFloat(val.toPrecision(12)); - if (val > variable.max) - val = variable.max; - else if (val < variable.min) - val = variable.min; - } - return `${val}${variable.unit}`; + div.header ha-switch { + display: flex; + align-self: center; + margin: 0px 8px; + line-height: 24px; } - - const colorModesToSupportedFeatures = (colorModes) => { - if (!colorModes || !Array.isArray(colorModes)) - return 0; - let features = colorModes.map(mode => { - switch (mode) { - case 'brightness': - case 'color_temp': - case 'hs': - case 'xy': - case 'rgb': - case 'rgbw': - case 'rgbww': - return 1; - case 'unknown': - case 'onoff': - case 'white': - default: - return 0; - } - }); - features = unique(features); - return features.reduce((acc, val) => acc | val, 0); - }; - const computeSupportedFeatures = (stateObj) => { - if (!stateObj) - return 0; - const domain = g$1(stateObj.entity_id); - switch (domain) { - case 'light': - return colorModesToSupportedFeatures(stateObj.attributes.supported_color_modes); - default: - return stateObj.attributes.supported_features || 0; - } - }; - - const temperatureVariable = (stateObj, hass) => { - const tempUnit = hass.config.unit_system.temperature; - const isFahrenHeit = tempUnit.includes('F'); - return levelVariable({ - min: numericAttribute(stateObj, 'min_temp', isFahrenHeit ? 45 : 7), - max: numericAttribute(stateObj, 'max_temp', isFahrenHeit ? 95 : 35), - step: numericAttribute(stateObj, 'target_temp_step', isFahrenHeit ? 1 : 0.1), - unit: tempUnit, - }); - }; - const actionList = { - alarm_control_panel: { - alarm_disarm: {}, - alarm_arm_home: { - supported_feature: 1, - }, - alarm_arm_away: { - supported_feature: 2, - }, - alarm_arm_night: { - supported_feature: 4, - }, - alarm_arm_custom_bypass: { - supported_feature: 16, - }, - }, - automation: { - turn_on: {}, - turn_off: {}, - trigger: {}, - }, - climate: { - turn_off: { - condition: stateObj => !listAttribute(stateObj, 'hvac_modes').includes('off'), - }, - _turn_off: { - service: 'set_hvac_mode', - service_data: { - hvac_mode: 'off', - }, - condition: stateObj => listAttribute(stateObj, 'hvac_modes').includes('off'), - }, - set_temperature: { - variables: { - temperature: {}, - }, - supported_feature: 1, - condition: stateObj => !['heat', 'cool', 'heat_cool'].some(e => listAttribute(stateObj, 'hvac_modes').includes(e)), - }, - heat: { - service: 'set_temperature', - service_data: { - hvac_mode: 'heat', - }, - variables: { - temperature: { - template: temperatureVariable, - }, - }, - supported_feature: 1, - condition: stateObj => listAttribute(stateObj, 'hvac_modes').includes('heat'), - }, - cool: { - service: 'set_temperature', - service_data: { - hvac_mode: 'cool', - }, - variables: { - temperature: { - template: temperatureVariable, - }, - }, - supported_feature: 1, - condition: stateObj => listAttribute(stateObj, 'hvac_modes').includes('cool'), - }, - regulate: { - service: 'set_temperature', - service_data: { - hvac_mode: 'heat_cool', - }, - variables: { - target_temp_low: { - template: temperatureVariable, - }, - target_temp_high: { - template: temperatureVariable, - }, - }, - supported_feature: 1, - condition: stateObj => listAttribute(stateObj, 'hvac_modes').includes('heat_cool'), - }, - set_mode: { - service: 'set_hvac_mode', - variables: { - hvac_mode: { - template: stateObj => { - const supportedFeatures = numericAttribute(stateObj, 'supported_features') || 0; - let modes = listAttribute(stateObj, 'hvac_modes'); - if (supportedFeatures & 1) - modes = modes.filter(e => !['heat', 'cool', 'heat_cool', 'off'].includes(e)); - return { options: modes }; - }, - }, - }, - }, - set_preset: { - service: 'set_preset_mode', - variables: { - preset_mode: { - options: 'preset_modes', - }, - }, - supported_feature: 16, - }, - set_fan_mode: { - service: 'set_fan_mode', - variables: { - fan_mode: { - options: 'fan_modes', - }, - }, - }, - }, - cover: { - close: { - service: 'close_cover', - supported_feature: 2, - }, - open: { - service: 'open_cover', - supported_feature: 1, - }, - set_position: { - service: 'set_cover_position', - variables: { - position: { - min: 0, - max: 100, - step: 1, - unit: '%', - }, - }, - supported_feature: 4, - }, - set_tilt_position: { - service: 'set_cover_tilt_position', - variables: { - tilt_position: { - min: 0, - max: 100, - step: 1, - unit: '%', - }, - }, - supported_feature: 128, - }, - }, - fan: { - turn_on: {}, - turn_off: {}, - set_percentage: { - service: 'set_percentage', - variables: { - percentage: { - min: 0, - max: 100, - step: 1, - unit: '%', - }, - }, - supported_feature: 1, - }, - set_oscillation: { - service: 'oscillate', - variables: { - oscillating: { - options: ['True', 'False'], - }, - }, - supported_feature: 2, - }, - set_direction: { - variables: { - direction: { - options: ['forward', 'reverse'], - }, - }, - supported_feature: 4, - }, - set_preset: { - service: 'set_preset_mode', - variables: { - preset_mode: { - options: 'preset_modes', - }, - }, - supported_feature: 8, - }, - }, - humidifier: { - turn_on: {}, - turn_off: {}, - set_humidity: { - variables: { - humidity: { - min: 'min_humidity', - max: 'max_humidity', - step: 1, - unit: '%', - }, - }, - }, - set_mode: { - variables: { - mode: { - options: 'available_modes', - }, - }, - supported_feature: 1, - }, - }, - input_boolean: { - turn_on: {}, - turn_off: {}, - }, - input_number: { - set_value: { - variables: { - value: { - min: 'min', - max: 'max', - step: 'step', - unit: 'unit_of_measurement', - }, - }, - }, - }, - input_select: { - select_option: { - variables: { - option: { - options: 'options', - }, - }, - }, - }, - light: { - turn_on: { - condition: stateObj => computeSupportedFeatures(stateObj) == 0, - }, - _turn_on: { - variables: { - brightness: { - min: 0, - max: 100, - step: 1, - unit: '%', - scale_factor: 2.55, - optional: true, - }, - }, - condition: stateObj => computeSupportedFeatures(stateObj) != 0, - }, - turn_off: {}, - }, - lock: { - lock: {}, - unlock: {}, - }, - media_player: { - turn_on: { supported_feature: 128 }, - turn_off: { supported_feature: 256 }, - select_source: { - variables: { - source: { - options: 'source_list', - }, - }, - supported_feature: 2048, - }, - }, - notify: { - '{entity_id}': { - variables: { - title: {}, - message: { - multiline: true, - }, - }, - }, - }, - number: { - set_value: { - variables: { - value: { - min: 'min', - max: 'max', - step: 'step', - }, - }, - }, - }, - scene: { - turn_on: {}, - }, - script: { - turn_on: {}, - turn_off: {}, - '{entity_id}': {}, - }, - select: { - select_option: { - variables: { - option: { - options: 'options', - }, - }, - }, - }, - switch: { - turn_on: {}, - turn_off: {}, - }, - vacuum: { - turn_on: { supported_feature: 1 }, - start: { - supported_feature: 8192, - }, - play_pause: { - supported_feature: 4, - }, - }, - water_heater: { - set_temperature: { - variables: { - temperature: { - template: temperatureVariable, - }, - }, - }, - set_mode: { - service: 'set_operation_mode', - variables: { - operation_mode: { - options: 'operation_list', - }, - }, - supported_feature: 2, - }, - set_away_mode: { - variables: { - away_mode: { - options: ['on', 'off'], - }, - }, - supported_feature: 4, - }, - }, - }; - - function listVariable(...config) { - //factory function to create ListVariable from configuration - const commonOptions = config[0].options - .map(e => e.value) - .filter(option => config.map(e => e.options).every(list => list.map(e => e.value).includes(option))); - const options = commonOptions.map(val => { - const name = config - .map(e => e.options.find(o => o.value == val)) - .filter(isDefined) - .map(e => e.name) - .filter(isDefined); - const icon = config - .map(e => e.options.find(o => o.value == val)) - .filter(isDefined) - .map(e => e.icon) - .filter(isDefined); - let item = { - value: val, - name: name.length ? name.reduce((_acc, val) => val) : undefined, - icon: icon.length ? icon.reduce((_acc, val) => val) : undefined, - }; - return item; - }); - const name = config.map(e => e.name).filter(isDefined); - const variable = { - type: EVariableType.List, - name: name.length ? name.reduce((_acc, val) => val) : undefined, - options: options, - }; - return variable; - } - function listVariableDisplay(value, variable) { - const option = variable.options.find(e => e.value == value); - return option ? option.name || option.value : ''; + mwc-button { + margin: 2px 0px; } - - function textVariable(...config) { - //factory function to create ListVariable from configuration - const name = config.map(e => e.name).filter(isDefined); - const variable = { - type: EVariableType.Text, - name: name.length ? name.reduce((_acc, val) => val) : undefined, - multiline: config.some(e => e.multiline), - }; - return variable; - } - function textVariableDisplay(value, _variable) { - return String(value); + mwc-button.active { + background: var(--primary-color); + --mdc-theme-primary: var(--text-primary-color); + border-radius: 4px; + } + mwc-button ha-icon { + margin-right: 11px; } - - const actionNamesList = { - alarm_control_panel: { - alarm_disarm: 'ui.card.alarm_control_panel.disarm', - alarm_arm_home: 'ui.card.alarm_control_panel.arm_home', - alarm_arm_away: 'ui.card.alarm_control_panel.arm_away', - alarm_arm_night: 'ui.card.alarm_control_panel.arm_night', - alarm_arm_custom_bypass: 'ui.card.alarm_control_panel.arm_custom_bypass', - }, - automation: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - trigger: 'ui.card.script.run', - }, - climate: { - turn_off: 'ui.card.vacuum.actions.turn_off', - heat: 'services.climate.set_temperature_hvac_mode_heat', - cool: 'services.climate.set_temperature_hvac_mode_cool', - regulate: 'services.climate.set_temperature_hvac_mode_heat_cool', - set_temperature: 'services.climate.set_temperature', - set_mode: 'services.climate.set_hvac_mode', - set_preset: 'services.climate.set_preset_mode', - set_fan_mode: 'services.climate.set_fan_mode', - }, - cover: { - close: 'services.cover.close_cover', - open: 'services.cover.open_cover', - set_position: 'services.cover.set_cover_position', - set_tilt: 'services.cover.set_cover_tilt_position', - }, - fan: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - set_speed: 'services.fan.set_speed', - set_oscillation: 'services.fan.oscillate', - set_direction: 'services.fan.set_direction', - set_preset: 'services.climate.set_preset_mode', - }, - humidifier: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - set_humidity: 'services.humidifier.set_humidity', - set_mode: 'services.humidifier.set_mode', - }, - input_boolean: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - }, - input_number: { - set_value: 'services.input_number.set_value', - }, - input_select: { - select_option: 'services.input_select.select_option', - }, - light: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - }, - lock: { - lock: 'ui.card.lock.lock', - unlock: 'ui.card.lock.unlock', - }, - media_player: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - select_source: 'services.media_player.select_source', - }, - notify: { - '{entity_id}': 'services.notify.notify', - }, - number: { - set_value: 'services.input_number.set_value', - }, - scene: { - turn_on: 'ui.card.vacuum.actions.turn_on', - }, - script: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - '{entity_id}': 'services.script.script', - }, - select: { - select_option: 'services.input_select.select_option', - }, - switch: { - turn_on: 'ui.card.vacuum.actions.turn_on', - turn_off: 'ui.card.vacuum.actions.turn_off', - }, - vacuum: { - turn_on: 'ui.card.vacuum.actions.turn_on', - start: 'ui.card.vacuum.start_cleaning', - play_pause: 'services.vacuum.start_pause', - }, - water_heater: { - set_temperature: 'services.climate.set_temperature', - set_mode: 'services.water_heater.set_operation_mode', - set_away_mode: 'services.water_heater.set_away_mode', - }, - }; - const actionName = (domain, action, hass) => { - if (domain in actionNamesList && action in actionNamesList[domain]) { - let item = actionNamesList[domain][action]; - if (item instanceof Function) { - item = item(action); - } - return item.startsWith('services') ? localize(item, getLocale(hass)) : hass.localize(item); - } - return action; - }; - - const coverIcon$1 = (action, stateObj) => { - const closedState = action == 'close'; - switch (stateObj === null || stateObj === void 0 ? void 0 : stateObj.attributes.device_class) { - case 'garage': - return closedState ? 'mdi:garage' : 'mdi:garage-open'; - case 'door': - return closedState ? 'mdi:door-closed' : 'mdi:door-open'; - case 'blind': - return closedState ? 'mdi:blinds' : 'mdi:blinds-open'; - case 'window': - return closedState ? 'mdi:window-closed' : 'mdi:window-open'; - default: - return closedState ? 'mdi:window-shutter' : 'mdi:window-shutter-open'; - } - }; - const actionIcons = { - alarm_control_panel: { - alarm_disarm: 'mdi:lock-open-variant-outline', - alarm_arm_home: 'mdi:home-outline', - alarm_arm_away: 'mdi:exit-run', - alarm_arm_night: 'mdi:power-sleep', - alarm_arm_custom_bypass: 'mdi:shield-lock-outline', - }, - automation: { - turn_on: 'mdi:power', - turn_off: 'mdi:power-off', - trigger: 'mdi:play', - }, - climate: { - turn_off: 'mdi:power-off', - heat: 'mdi:fire', - cool: 'mdi:snowflake', - regulate: 'mdi:thermometer', - set_temperature: 'mdi:thermometer', - set_mode: 'mdi:cog-transfer-outline', - set_preset: 'mdi:cloud-download-outline', - set_fan_mode: 'mdi:fan', - }, - cover: { - close: coverIcon$1, - open: coverIcon$1, - set_position: 'mdi:ray-vertex', - set_tilt_position: 'mdi:valve', - }, - fan: { - turn_on: 'mdi:power', - turn_off: 'mdi:power-off', - set_percentage: 'mdi:weather-windy', - set_oscillation: 'mdi:arrow-left-right', - set_direction: 'mdi:cog-clockwise', - set_preset_mode: 'mdi:cloud-download-outline', - }, - humidifier: { - turn_on: 'mdi:power', - turn_off: 'mdi:power-off', - set_humidity: 'mdi:water-percent', - set_mode: 'mdi:cog-transfer-outline', - }, - input_boolean: { - turn_on: 'mdi:flash', - turn_off: 'mdi:flash-off', - }, - input_number: { - set_value: 'mdi:counter', - }, - input_select: { - select_option: 'mdi:counter', - }, - light: { - turn_on: 'mdi:lightbulb', - turn_off: 'mdi:lightbulb-off', - }, - lock: { - lock: 'mdi:lock-outline', - unlock: 'mdi:lock-open-variant-outline', - }, - media_player: { - turn_on: 'mdi:power', - turn_off: 'mdi:power-off', - select_source: 'hass:music-box-multiple-outline', - }, - notify: { - '{entity_id}': 'mdi:message-alert', - }, - number: { - set_value: 'mdi:counter', - }, - scene: { - turn_on: 'mdi:play', - }, - script: { - turn_on: 'mdi:flash', - turn_off: 'mdi:flash-off', - '{entity_id}': 'mdi:play', - }, - select: { - select_option: 'mdi:counter', - }, - switch: { - turn_on: 'mdi:flash', - turn_off: 'mdi:flash-off', - }, - vacuum: { - turn_on: 'mdi:power', - start: 'mdi:play-circle-outline', - play_pause: 'mdi:play-circule-outline', - }, - water_heater: { - set_temperature: 'mdi:thermometer', - set_mode: 'mdi:cog-transfer-outline', - set_away_mode: 'mdi:car-traction-control', - }, - }; - const actionIcon = (domain, action, stateObj) => { - if (domain in actionIcons && action in actionIcons[domain]) { - let item = actionIcons[domain][action]; - if (item instanceof Function) { - item = item(action, stateObj); - } - return item; - } - return DefaultActionIcon; - }; - - const variableList = { - climate: { - temperature: 'ui.card.weather.attributes.temperature', - target_temp_low: 'ui.panel.lovelace.editor.card.generic.minimum', - target_temp_high: 'ui.panel.lovelace.editor.card.generic.maximum', - hvac_mode: 'ui.card.climate.operation', - preset_mode: 'ui.card.climate.preset_mode', - fan_mode: 'ui.card.climate.fan_mode', - }, - cover: { - position: 'ui.card.cover.position', - tilt_position: 'ui.card.cover.tilt_position', - }, - fan: { - percentage: 'ui.card.fan.speed', - oscillating: 'ui.card.fan.oscillate', - direction: 'ui.card.fan.direction', - preset_mode: 'ui.card.fan.preset_mode', - }, - humidifier: { - humidity: 'ui.card.humidifier.humidity', - mode: 'ui.card.humidifier.mode', - }, - input_number: { - value: 'ui.panel.config.helpers.types.input_number', - }, - input_select: { - option: 'ui.components.dialogs.input_select.options', - }, - light: { - brightness: 'ui.card.light.brightness', - }, - media_player: { - source: 'ui.card.media_player.source', - }, - notify: { - title: 'ui.panel.config.automation.editor.actions.type.device_id.extra_fields.title', - message: 'ui.panel.config.automation.editor.actions.type.device_id.extra_fields.message', - }, - number: { - value: 'ui.panel.config.helpers.types.input_number', - }, - select: { - option: 'ui.components.dialogs.input_select.options', - }, - water_heater: { - temperature: 'ui.card.weather.attributes.temperature', - operation_mode: 'ui.card.water_heater.operation', - away_mode: 'ui.card.water_heater.away_mode', - }, - }; - const getVariableName = (domain, variable, hass) => { - if (domain in variableList && variable in variableList[domain]) { - return hass.localize(variableList[domain][variable]); - } - return variable; - }; - - const variableOptions = { - climate: { - hvac_mode: { - off: 'component.climate.state._.off', - heat: 'component.climate.state._.heat', - cool: 'component.climate.state._.cool', - heat_cool: 'component.climate.state._.heat_cool', - dry: 'component.climate.state._.dry', - fan_only: 'component.climate.state._.fan_only', - }, - preset_mode: { - activity: 'state_attributes.climate.preset_mode.activity', - away: 'state_attributes.climate.preset_mode.away', - boost: 'state_attributes.climate.preset_mode.boost', - comfort: 'state_attributes.climate.preset_mode.comfort', - eco: 'state_attributes.climate.preset_mode.eco', - home: 'state_attributes.climate.preset_mode.home', - none: 'state_attributes.climate.preset_mode.none', - sleep: 'state_attributes.climate.preset_mode.sleep', - }, - }, - fan: { - direction: { - forward: 'ui.card.fan.forward', - reverse: 'ui.card.fan.reverse', - }, - oscillating: { - True: 'state.default.on', - False: 'state.default.off', - }, - }, - humidifier: { - mode: { - auto: 'state_attributes.humidifier.mode.auto', - away: 'state_attributes.humidifier.mode.away', - baby: 'state_attributes.humidifier.mode.baby', - boost: 'state_attributes.humidifier.mode.boost', - comfort: 'state_attributes.humidifier.mode.comfort', - eco: 'state_attributes.humidifier.mode.eco', - home: 'state_attributes.humidifier.mode.home', - normal: 'state_attributes.humidifier.mode.normal', - sleep: 'state_attributes.humidifier.mode.sleep', - }, - }, - water_heater: { - operation_mode: { - off: 'component.water_heater.state._.off', - eco: 'component.water_heater.state._.eco', - electric: 'component.water_heater.state._.electric', - gas: 'component.water_heater.state._.gas', - heat_pump: 'component.water_heater.state._.heat_pump', - high_demand: 'component.water_heater.state._.high_demand', - performance: 'component.water_heater.state._.performance', - }, - away_mode: { - on: 'state.default.on', - off: 'state.default.off', - }, - }, - }; - const getVariableOptions = (domain, variable) => { - if (domain in variableOptions && variable in variableOptions[domain]) - return Object.keys(variableOptions[domain][variable]); - return []; - }; - const getVariableOptionName = (domain, variable, option, hass) => { - if (domain in variableOptions && variable in variableOptions[domain] && option in variableOptions[domain][variable]) - return hass.localize(variableOptions[domain][variable][option]); - return option; - }; - - const actionIcons$1 = { - climate: { - hvac_mode: { - off: 'mdi:power-off', - heat: 'mdi:fire', - cool: 'mdi:snowflake', - heat_cool: 'mdi:thermometer', - auto: 'mdi:autorenew', - dry: 'mdi:water-percent', - fan_only: 'mdi:fan', - }, - preset_mode: { - activity: 'mdi:account-alert-outline', - away: 'mdi:car-traction-control', - boost: 'mdi:rocket-launch-outline', - comfort: 'mdi:car-seat-cooler', - eco: 'mdi:leaf', - home: 'mdi:home-outline', - none: 'mdi:cancel', - sleep: 'mdi:sleep', - }, - }, - fan: { - direction: { - forward: 'mdi:autorenew', - reverse: 'mdi:sync', - }, - oscillating: { - True: 'mdi:toggle-switch-outline', - False: 'mdi:toggle-switch-off-outline', - }, - }, - humidifier: { - mode: { - auto: 'mdi:autorenew', - away: 'mdi:car-traction-control', - baby: 'mdi:baby-bottle-outline', - boost: 'mdi:rocket-launch-outline', - comfort: 'mdi:car-seat-cooler', - eco: 'mdi:leaf', - home: 'mdi:home-outline', - normal: 'mdi:account-outline', - sleep: 'mdi:sleep', - }, - }, - water_heater: { - operation_mode: { - off: 'mdi:power-off', - eco: 'mdi:leaf', - electric: 'mdi:lightning-bolt', - gas: 'mdi:fire', - heat_pump: 'mdi:hvac', - high_demand: 'mdi:water-plus-outline', - performance: 'mdi:rocket-launch-outline', - }, - away_mode: { - on: 'mdi:toggle-switch-outline', - off: 'mdi:toggle-switch-off-outline', - }, - }, - }; - const getVariableOptionIcon = (domain, variable, option) => { - if (domain in actionIcons$1 && variable in actionIcons$1[domain] && option in actionIcons$1[domain][variable]) - return actionIcons$1[domain][variable][option]; - return; - }; - - function computeVariables(variables) { - if (!Object.keys(variables || {}).length) - return undefined; - return Object.entries(variables) - .map(([field, variable]) => { - if ('options' in variable) { - return [field, listVariable(variable)]; - } - else if ('min' in variable || 'max' in variable) { - return [field, levelVariable(variable)]; - } - else { - return [field, textVariable(variable)]; - } - }) - .reduce((obj, [key, val]) => (val ? Object.assign(obj, { [key]: val }) : obj), {}); + mwc-button.warning { + --mdc-theme-primary: var(--error-color); } - - function computeMergedVariable(...variables) { - const types = unique(variables.map(e => e.type).filter(isDefined)); - if (!types.length) { - variables = Object.values(computeVariables(Object.assign({}, ...variables))); - return computeMergedVariable(...variables); - } - if (types.length > 1) - return undefined; - if (types[0] == EVariableType.Level) { - return levelVariable(...variables); - } - else if (types[0] == EVariableType.List) { - return listVariable(...variables); - } - else - return textVariable(...variables); + div.checkbox-container { + display: grid; + grid-template-columns: max-content 1fr max-content; + grid-template-rows: min-content; + grid-template-areas: "checkbox slider value"; + grid-gap: 0px 10px; } - - function computeCommonActions(actionLists) { - //calculate actions that are in common for all - if (actionLists.length == 1) - return actionLists[0]; - let commonActions = actionLists[0].filter(action => actionLists.slice(1).every(list => list.some(e => compareActions(action, e)))); - commonActions = commonActions - .map(action => { - const mergedVariables = Object.entries(action.variables || {}) - .map(([field, variable]) => { - //compute action per entity - const actions = actionLists.map(e => e.find(k => compareActions(k, action))); - //remove the variable if it is not in common - if (!actions.every(e => e && e.variables && field in e.variables)) { - return [field, undefined]; - } - const variables = actions.map(e => e.variables[field]); - if (!variables.every(e => variable.type == e.type)) - return [field, undefined]; - //compute intersection of variables - return [field, computeMergedVariable(...variables)]; - }) - .reduce((obj, [key, val]) => (val ? Object.assign(obj, { [key]: val }) : obj), {}); - if (Object.values(mergedVariables).find(e => e.type == EVariableType.List && !e.options.length)) - return undefined; - action = Object.assign(Object.assign({}, action), { variables: mergedVariables }); - return action; - }) - .filter(isDefined); - return commonActions; + div.checkbox-container div.checkbox { + grid-area: checkbox; + display: flex; + align-items: center;x } - - function groupActions(hass, entity, entityActions) { - const entities = entity && entity.attributes.entity_id && Array.isArray(entity.attributes.entity_id) - ? entity.attributes.entity_id - : []; - entityActions = entityActions.map((actions, i) => { - //filter by supported_features - const stateObj = hass.states[entities[i]]; - const supportedFeatures = computeSupportedFeatures(stateObj); - actions = actions - .filter(e => !e.supported_feature || e.supported_feature & supportedFeatures) - .map(action => omit(action, 'supported_feature')); - return actions; - }); - //find matches - const mixedDomains = [...new Set(entities.map(e => g$1(e)))].length > 1; - if (mixedDomains) { - entityActions = entityActions.map(actionList => { - return actionList.map(action => { - if (b$1(action.service) == 'turn_on' || b$1(action.service) == 'turn_off') { - return Object.assign(Object.assign({}, action), { service: 'homeassistant' + '.' + b$1(action.service), icon: b$1(action.service) == 'turn_on' ? 'flash' : 'flash-off' }); - } - return action; - }); - }); - } - if (!entityActions.length) - return []; - const commonActions = computeCommonActions(entityActions); - return commonActions; - } - const groupStates = (_hass, _stateObj, entityStates) => { - if (!entityStates.length) - return null; - if (!entityStates.every(e => e.type == entityStates[0].type)) - return null; - if (entityStates[0].type == EVariableType.List) - return listVariable(...entityStates); - else if (entityStates[0].type == EVariableType.Level) - return levelVariable(...entityStates); - else - return null; - }; - - const standardActions = (entity_id, hass, filterCapabilities = true) => { - const domain = g$1(entity_id); - if (domain == 'group') { - const stateObj = hass.states[entity_id]; - const subEntities = listAttribute(stateObj, 'entity_id'); - if (!subEntities.length) - return []; - const subActions = subEntities.map(e => standardActions(e, hass, filterCapabilities)); - return groupActions(hass, stateObj, subActions); - } - //not supported by standard configuration - if (!Object.keys(actionList).includes(domain)) - return []; - return Object.entries(actionList[domain]) - .map(([id, config]) => parseAction(id, config, entity_id, hass, filterCapabilities)) - .filter(isDefined); - }; - const parseAction = (id, config, entity_id, hass, filterCapabilities) => { - const domain = g$1(entity_id); - const stateObj = hass.states[entity_id]; - if (config.condition && !config.condition(stateObj)) - return; - if (id.startsWith('_')) - id = id = id.substring(1); - let action = { - name: '', - icon: DefaultActionIcon, - service: config.service ? `${domain}.${config.service}` : `${domain}.${id}`, - service_data: config.service_data, - }; - if (config.supported_feature) { - const supportedFeature = config.supported_feature instanceof Function ? config.supported_feature(stateObj) : config.supported_feature; - action = Object.assign(Object.assign({}, action), { supported_feature: supportedFeature }); - } - action = Object.assign(Object.assign({}, action), { name: actionName(domain, id, hass), icon: actionIcon(domain, id, stateObj) }); - Object.keys(config.variables || {}).forEach(key => { - action = Object.assign(Object.assign({}, action), { variables: Object.assign(Object.assign({}, action.variables), { [key]: parseActionVariable(domain, key, config.variables[key], stateObj, hass, filterCapabilities) }) }); - }); - //strip actions having no selectable options - if (Object.values(action.variables || {}).some(e => e.type == EVariableType.List && !e.options.length)) - return; - //insert entity ID for services notify / script - const match = action.service.match(/^[a-z_]+\.(\{entity_id\})$/); - if (match) - action = Object.assign(Object.assign({}, action), { service: action.service.replace(match[1], b$1(entity_id)) }); - return action; - }; - const parseActionVariable = (domain, variable, variableConfig, stateObj, hass, filterCapabilities) => { - let config = parseVariable(variableConfig, stateObj, hass); - config = Object.assign(Object.assign({}, config), { name: getVariableName(domain, variable, hass) }); - if ('options' in config && isDefined(config.options)) { - let options = [...config.options]; - if (!filterCapabilities) { - const extraOptions = getVariableOptions(domain, variable).filter(k => !options.map(e => e.value).includes(k)); - options = [...options, ...extraOptions.map(e => Object({ value: e }))]; - } - options = options.map(e => Object.assign(e, { - name: e.name ? e.name : getVariableOptionName(domain, variable, e.value, hass), - icon: e.icon ? e.icon : getVariableOptionIcon(domain, variable, e.value), - })); - config = Object.assign(Object.assign({}, config), { options: options }); - return listVariable(config); - } - else if ('min' in config && isDefined(config.min) && 'max' in config && isDefined(config.max)) { - return levelVariable(config); - } - else { - return textVariable(config); - } - }; - - const wildcardPattern = /\{[^\}]+\}/g; - const parameterPattern = /\[([^\]]+)\]/; - function computeActionDisplay(action) { - let name = action.name; - if (!name) - name = PrettyPrintName(b$1(action.service)); - const res = name.match(parameterPattern); - if (res) { - let replacement = res[1]; - const matches = res[1].match(wildcardPattern); - if (matches && - matches.length && - matches.every(wildcard => { - const field = wildcard.substring(1, wildcard.length - 1); - if (!Object.keys(action.service_data || {}).includes(field)) - return false; - let value = ''; - if (Object.keys(action.variables || {}).includes(field)) { - if (action.variables[field].type == EVariableType.Level) - value = levelVariableDisplay(action.service_data[field], action.variables[field]); - else if (action.variables[field].type == EVariableType.List) - value = listVariableDisplay(action.service_data[field], action.variables[field]); - else - value = textVariableDisplay(action.service_data[field], action.variables[field]); - } - else { - value = action.service_data[field]; - } - replacement = replacement.replace(wildcard, value); - return true; - })) { - return name.replace(res[0], replacement); - } - else { - return name.replace(res[0], ''); - } - } - return name || ''; + div.checkbox-container div.slider { + grid-area: slider; + display: flex; + align-items: center; } - - function parseString(str) { - return str - .replace(/_/g, ' ') - .trim() - .toLowerCase(); - } - function computeActions(entity_id, hass, config) { - if (Array.isArray(entity_id)) { - let actions = entity_id.map(e => computeActions(e, hass, config)); - return computeCommonActions(actions); - } - const stateObj = hass.states[entity_id]; - //fetch standard actions for entity - let actions = config.standard_configuration ? standardActions(entity_id, hass) : []; - //get excluded actions for entity - const excludedActions = flatten(Object.entries(config.customize) - .filter(([a]) => matchPattern(a, entity_id)) - .sort((a, b) => b[0].length - a[0].length) - .map(([, b]) => b.exclude_actions) - .filter(isDefined)); - if (excludedActions.length) { - actions = actions.filter(e => !excludedActions.some(a => parseString(computeActionDisplay(e)).includes(a))); - } - //get customizations for entity - const customizedActions = flatten(Object.entries(config.customize) - .filter(([a]) => matchPattern(a, entity_id)) - .sort((a, b) => b[0].length - a[0].length) - .map(([, b]) => b.actions) - .filter(isDefined)); - if (customizedActions.length) { - customizedActions.forEach(action => { - //ensure services have domain prefixed - if (!g$1(action.service).length) - action = Object.assign(Object.assign({}, action), { service: g$1(entity_id) + '.' + b$1(action.service) }); - //ensure service call has no entity_id - if (action.service_data) - action = Object.assign(Object.assign({}, action), { service_data: omit(action.service_data, 'entity_id') }); - let res = actions.findIndex(e => compareActions(e, action)); - if (res < 0) { - //try to find it in unfiltered list of built-in actions - let allActions = config.standard_configuration ? standardActions(entity_id, hass, false) : []; - const match = allActions.find(e => compareActions(e, action)); - if (match) { - actions = [...actions, match]; - res = actions.length - 1; - } - } - if (res >= 0) { - //standard action should be overwritten - Object.assign(actions, { - [res]: Object.assign(Object.assign({}, actions[res]), omit(action, 'variables')), - }); - if (Object.keys(action.variables || {}).length) { - let variableConfig = actions[res].variables || {}; - //merge variable config - variableConfig = Object.entries(variableConfig) - .map(([field, variable]) => { - return Object.keys(action.variables).includes(field) - ? [field, Object.assign(Object.assign({}, variable), action.variables[field])] - : [field, action.variables[field]]; - }) - .reduce((obj, [key, val]) => (val ? Object.assign(obj, { [key]: val }) : obj), {}); - //add new variables - const newVariables = Object.keys(action.variables).filter(e => !Object.keys(variableConfig).includes(e)); - variableConfig = Object.assign(Object.assign({}, variableConfig), computeVariables(pick(action.variables, newVariables))); - Object.assign(actions, { - [res]: Object.assign(Object.assign({}, actions[res]), { variables: variableConfig }), - }); - } - } - else { - //add a new action - action = Object.assign(Object.assign({}, action), { variables: computeVariables(action.variables) }); - actions.push(action); - } - }); - } - //filter by supported_features - const supportedFeatures = computeSupportedFeatures(stateObj); - actions = actions.filter(e => !e.supported_feature || e.supported_feature & supportedFeatures); - //list variable with 1 option is not really a variable - actions = actions.map(action => { - if (Object.keys(action.variables || {}).length) { - Object.keys(action.variables).forEach(field => { - if (action.variables[field].type == EVariableType.List && - action.variables[field].options.length == 1) { - action = Object.assign(Object.assign({}, action), { service_data: Object.assign(Object.assign({}, action.service_data), { [field]: action.variables[field].options[0].value }), variables: omit(action.variables, field) }); - } - }); - } - return action; - }); - return actions; + div.checkbox-container div.value { + grid-area: value; + min-width: 40px; + display: flex; + align-items: center; } - - function importAction(action, hass) { - const id = action.entity_id || action.service; - const service = action.service; - const serviceData = action.service_data || {}; - const serviceArgs = Object.keys(serviceData); - let actions = standardActions(id, hass, false); - let matches = actions.filter(e => compareActions(action, e, true)); - if (matches.length == 1) - actions = matches; - else { - //only find actions with matching service name - actions = actions.filter(e => e.service == service); - // if action has a fixed argument, it should be provided to be a match - actions = actions.filter(e => Object.keys(e.service_data || {}).every(k => serviceArgs.includes(k))); - } - if (actions.length > 1) { - //the match is ambiguous, check service_data to find the action with best overlap - actions.sort((a, b) => { - const fixedArgsOverlapA = Object.entries(a.service_data || {}) - .map(([k, v]) => (k in serviceData ? (serviceData[k] == v ? 1 : -1) : 0)) - .reduce((sum, e) => sum + e, 0); - const fixedArgsOverlapB = Object.entries(b.service_data || {}) - .map(([k, v]) => (k in serviceData ? (serviceData[k] == v ? 1 : -1) : 0)) - .reduce((sum, e) => sum + e, 0); - //if one of the services has more fixed serviceArgs in common, it is preferred - if (fixedArgsOverlapA > fixedArgsOverlapB) - return -1; - if (fixedArgsOverlapA < fixedArgsOverlapB) - return 1; - const serviceDataA = unique([...Object.keys(a.service_data || {}), ...Object.keys(a.variables || {})]); - const serviceDataB = unique([...Object.keys(b.service_data || {}), ...Object.keys(b.variables || {})]); - const overlapA = serviceArgs.filter(e => serviceDataA.includes(e)).length; - const overlapB = serviceArgs.filter(e => serviceDataB.includes(e)).length; - //if one of the services has more variable serviceArgs in common, it is preferred - if (overlapA > overlapB) - return -1; - if (overlapA < overlapB) - return 1; - const extraKeysA = serviceDataA.filter(e => !serviceArgs.includes(e)).length; - const extraKeysB = serviceDataB.filter(e => !serviceArgs.includes(e)).length; - //if one of the services has less extra serviceArgs, it is preferred - if (extraKeysA > extraKeysB) - return 1; - if (extraKeysA < extraKeysB) - return -1; - return 0; - }); - } - if (actions.length) { - // add option to the list if it is not existing - let variables = Object.assign({}, (actions[0].variables || {})); - Object.entries(serviceData).forEach(([key, val]) => { - if (!Object.keys(variables || {}).includes(key)) - return; - if (variables[key].type != EVariableType.List) - return; - variables = Object.assign(Object.assign({}, variables), { [key]: variables[key].options.some(e => e.value == val) - ? variables[key] - : Object.assign(Object.assign({}, variables[key]), { options: [...variables[key].options, { value: val }] }) }); - }); - return Object.assign(Object.assign({}, actions[0]), { service_data: Object.assign(Object.assign({}, (actions[0].service_data || {})), serviceData), variables: variables }); - } - else { - //unknown action, add from config - return { - service: service, - service_data: action.service_data, - }; - } + a { + color: var(--primary-color); } - - function parseEntity(entity_id, hass, config) { - const stateObj = entity_id in hass.states ? hass.states[entity_id] : undefined; - let entity = { - id: entity_id, - name: stateObj ? stateObj.attributes.friendly_name || b$1(entity_id) : DeadEntityName, - icon: stateObj ? stateObj.attributes.icon : DeadEntityIcon, - }; - if (!stateObj && g$1(entity_id) == NotifyDomain) { - let name = b$1(entity_id); - let icon = standardIcon(entity_id, hass); - if (name.includes('mobile_app_')) { - name = name.split('mobile_app_').pop(); - if (`device_tracker.${name}` in hass.states) { - const deviceTracker = hass.states[`device_tracker.${name}`]; - name = deviceTracker.attributes.friendly_name || name; - icon = 'hass:cellphone-text'; - } - } - entity = Object.assign(Object.assign({}, entity), { name: name, icon: icon }); - } - if ((config.standard_configuration === undefined || config.standard_configuration) && !entity.icon) { - entity = Object.assign(Object.assign({}, entity), { icon: standardIcon(entity_id, hass) }); - } - else if (!entity.icon) { - entity = Object.assign(Object.assign({}, entity), { icon: DefaultEntityIcon }); - } - if (config.customize) { - const customize = Object.entries(config.customize) - .filter(([pattern]) => matchPattern(pattern, entity.id)) - .sort((a, b) => b[0].length - a[0].length) - .map(([, v]) => v) - .forEach(el => { - entity = Object.assign(Object.assign({}, entity), pick(el, ['name', 'icon'])); - }); - } - return entity; + a:visited { + color: var(--accent-color); } - - const weekdayArray = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']; - const formatWeekday = (date, locale, short) => { - const supportLocaleString = () => { - try { - new Date().toLocaleDateString('i'); - } - catch (e) { - return e.name === 'RangeError'; - } - return false; - }; - if (typeof date !== 'object') { - let _date = new Date(2017, 1, 26); - _date.setDate(_date.getDate() + date); - date = _date; - } - if (supportLocaleString()) { - return date.toLocaleDateString(locale.language, { - weekday: short ? 'short' : 'long', - }); - } - else { - const weekday = date.getDay(); - return short ? weekdayArray[weekday].substr(0, 3) : weekdayArray[weekday]; - } - }; - - function weekdayToList(weekday) { - let list = weekday - .map(e => { - switch (e) { - case 'mon': - return 1; - case 'tue': - return 2; - case 'wed': - return 3; - case 'thu': - return 4; - case 'fri': - return 5; - case 'sat': - return 6; - case 'sun': - return 7; - default: - return; - } - }) - .filter(e => e); - return list; + `,is=e=>{class i extends e{connectedCallback(){super.connectedCallback(),this.__checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then(e=>e()):e()}this.__unsubs=void 0}}updated(e){super.updated(e),e.has("hass")&&this.__checkSubscribed()}hassSubscribe(){return[]}__checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&(this.__unsubs=this.hassSubscribe())}}return t([ae({attribute:!1})],i.prototype,"hass",void 0),i},ss=e=>e.callWS({type:"scheduler"}),as=(e,t)=>e.callWS({type:"scheduler/item",schedule_id:t}),os=e=>e.callWS({type:"scheduler/tags"});function ns(e,t){const i=N` + Something went wrong!
+ ${e.body.message}

+ ${e.error}

+ Please report the bug. + `;Me(t,"show-dialog",{dialogTag:"dialog-error",dialogImport:()=>Promise.resolve().then((function(){return Ja})),dialogParams:{error:i}})}function rs(e,t){let i=!1;if(e.match(/^[a-z0-9_\.]+$/))i=!e.includes(".")&&t.includes(".")?e==Ae(t):e==t;else try{if(e.startsWith("/")&&e.endsWith("/")||-1!==e.indexOf("*")){e.startsWith("/")||(e=`/^${e=e.replace(/\./g,".").replace(/\*/g,".*")}$/`);i=new RegExp(e.slice(1,-1)).test(t)}}catch(e){}return i}function ls(e,t){var i;const s=(e,t)=>((t.include||[]).some(t=>rs(t,e))||Object.keys(t.customize||{}).some(t=>rs(t,e)))&&!(t.exclude||[]).some(t=>rs(t,e));return(null===(i=t.groups)||void 0===i?void 0:i.some(t=>s(e,t)))||s(e,t)}const cs={alarm_control_panel:"hass:alarm-light-outline",automation:"hass:playlist-play",binary_sensor:"hass:radiobox-blank",calendar:"hass:calendar",camera:"hass:camera",climate:"hass:home-thermometer-outline",cover:"hass:window-shutter",device_tracker:"hass:account",fan:"hass:fan",group:"hass:google-circles-communities",humidifier:"hass:air-humidifier",input_boolean:"hass:drawing",input_number:"hass:ray-vertex",input_select:"hass:format-list-bulleted",select:"hass:format-list-bulleted",input_text:"hass:textbox",light:"hass:lightbulb-outline",lock:"hass:lock-open-outline",media_player:"hass:cast-connected",number:"hass:ray-vertex",notify:"hass:message-text-outline",person:"hass:account-outline",proximity:"hass:map-marker-distance",remote:"hass:remote",scene:"hass:palette-outline",script:"hass:file-document",sensor:"hass:eye",sun:"hass:white-balance-sunny",switch:"hass:flash",timer:"hass:timer",vacuum:"hass:robot-vacuum",water_heater:"hass:water-boiler"},ds=(e,t)=>{const i=Ae(e),s=t.states[e];switch(i){case"binary_sensor":return(e=>e&&Be(Object.assign(Object.assign({},e),{state:"off"}))||"mdi:radiobox-blank")(s);case"cover":return((e,t)=>{const i="closed"==t;switch(e.attributes.device_class){case"garage":return i?"mdi:garage":"mdi:garage-open";case"door":return i?"mdi:door-closed":"mdi:door-open";case"blind":return i?"mdi:blinds":"mdi:blinds-open";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:window-shutter":"mdi:window-shutter-open"}})(s);case"sensor":return(e=>{var t;switch(e.attributes.device_class||""){case"humidity":return"mdi:water-percent";case"illuminance":return"mdi:brightness-5";case"temperature":return"mdi:thermometer";case"power":return"mdi:flash";case"pressure":return"mdi:gauge";case"signal_strength":return"mdi:wifi";default:return(null===(t=e.attributes.unit_of_measurement)||void 0===t?void 0:t.includes("°"))?"mdi:thermometer":"mdi:eye"}})(s);default:return i in cs?cs[i]:"hass:folder-outline"}};function us(e,t,i=!1){const s=(e,t)=>Object.keys(t.variables||{}).includes(e)&&t.variables[e].type==Ie.Level&&t.variables[e].optional;if(e.service!==t.service)return!1;const a=Object.keys(e.service_data||{}),o=Object.keys(e.variables||{}),n=Object.keys(t.service_data||{}),r=Object.keys(t.variables||{}),l=[...new Set([...a,...o])],c=[...new Set([...n,...r])];return[...new Set([...l,...c])].every(d=>{if(!l.includes(d))return s(d,t);if(!c.includes(d))return s(d,e);if(a.filter(e=>!o.includes(e)).includes(d)&&n.filter(e=>!r.includes(e)).includes(d))return e.service_data[d]===t.service_data[d];if(o.includes(d)&&r.includes(d))return!0;if(!i)return!1;const u=a.includes(d)?e.service_data[d]:t.service_data[d],h=o.includes(d)?e.variables[d]:t.variables[d];return h.type===Ie.List?h.options.some(e=>e.value===u):h.type===Ie.Level?!isNaN(u):h.type==Ie.Text})}const hs=(e,t,i)=>{if("number"==typeof t)return t;if(!it(e)||!it(e.attributes[t]))return i;const s=e.attributes[t];return"number"==typeof s?s:i},ms=(e,t,i=[])=>{if(!it(e)||!it(e.attributes[t]))return i;const s=e.attributes[t];return Array.isArray(s)?s.map(e=>String(e)):i},ps=(e,t,i="")=>{if(!it(e)||!it(e.attributes[t]))return i;const s=e.attributes[t];return"string"==typeof s?s:i},_s=(e,t,i)=>{const s="template"in e&&it(e.template)?Object.assign(Object.assign({},Qe(e,"template")),e.template(t,i)):Object.assign({},e);return"options"in s?vs(s,t):"min"in s&&"max"in s?gs(s,t):s},vs=(e,t)=>{if("string"==typeof e.options){return{options:ms(t,e.options).map(e=>Object({value:e}))}}return Array.isArray(e.options)?{options:e.options.map(e=>Object({value:e}))}:{options:Object.entries(e.options).map(([e,t])=>Object(Object.assign({value:e},t)))}},gs=(e,t)=>{let i=Xe(e,["unit","optional","scale_factor"]);return it(e.min)&&(i=Object.assign(Object.assign({},i),{min:hs(t,e.min)})),it(e.max)&&(i=Object.assign(Object.assign({},i),{max:hs(t,e.max)})),it(e.step)&&(i=Object.assign(Object.assign({},i),{step:hs(t,e.step)})),it(e.unit)&&"unit_of_measurement"==e.unit&&(i=Object.assign(Object.assign({},i),{unit:ps(t,e.unit,"")})),i};function fs(...e){const t=e.map(e=>e.min).filter(it),i=e.map(e=>e.max).filter(it),s=e.map(e=>e.step).filter(it),a=tt(e.map(e=>e.scale_factor).filter(it)),o=e.map(e=>e.optional).filter(it),n=e.map(e=>e.unit).filter(it),r=e.map(e=>e.name).filter(it),l=s.length?Math.max(...s):1,c=e=>(e=Math.round(e/l)*l,parseFloat(e.toPrecision(12)));return{type:Ie.Level,min:c(t.length?Math.min(...t):0),max:c(i.length?Math.max(...i):255),step:l,scale_factor:1==a.length?a[0]:1,optional:o.length&&o.every(e=>e)||!1,unit:n.length?n.reduce((e,t)=>t):"",name:r.length?r.reduce((e,t)=>t):void 0}}function ys(e,t){let i=Number(e);return isNaN(i)?"":(1!=t.scale_factor&&(i/=t.scale_factor,i=Math.round(i/t.step)*t.step,i=parseFloat(i.toPrecision(12)),i>t.max?i=t.max:i{if(!e)return 0;switch(Ae(e.entity_id)){case"light":return(e=>{if(!e||!Array.isArray(e))return 0;let t=e.map(e=>{switch(e){case"brightness":case"color_temp":case"hs":case"xy":case"rgb":case"rgbw":case"rgbww":return 1;case"unknown":case"onoff":case"white":default:return 0}});return t=tt(t),t.reduce((e,t)=>e|t,0)})(e.attributes.supported_color_modes);default:return e.attributes.supported_features||0}},ws=(e,t)=>{const i=t.config.unit_system.temperature,s=i.includes("F");return fs({min:hs(e,"min_temp",s?45:7),max:hs(e,"max_temp",s?95:35),step:hs(e,"target_temp_step",s?1:.1),unit:i})},ks={alarm_control_panel:{alarm_disarm:{},alarm_arm_home:{supported_feature:1},alarm_arm_away:{supported_feature:2},alarm_arm_night:{supported_feature:4},alarm_arm_custom_bypass:{supported_feature:16}},automation:{turn_on:{},turn_off:{},trigger:{}},climate:{turn_off:{condition:e=>!ms(e,"hvac_modes").includes("off")},_turn_off:{service:"set_hvac_mode",service_data:{hvac_mode:"off"},condition:e=>ms(e,"hvac_modes").includes("off")},set_temperature:{variables:{temperature:{}},supported_feature:1,condition:e=>!["heat","cool","heat_cool"].some(t=>ms(e,"hvac_modes").includes(t))},heat:{service:"set_temperature",service_data:{hvac_mode:"heat"},variables:{temperature:{template:ws}},supported_feature:1,condition:e=>ms(e,"hvac_modes").includes("heat")},cool:{service:"set_temperature",service_data:{hvac_mode:"cool"},variables:{temperature:{template:ws}},supported_feature:1,condition:e=>ms(e,"hvac_modes").includes("cool")},regulate:{service:"set_temperature",service_data:{hvac_mode:"heat_cool"},variables:{target_temp_low:{template:ws},target_temp_high:{template:ws}},supported_feature:1,condition:e=>ms(e,"hvac_modes").includes("heat_cool")},set_mode:{service:"set_hvac_mode",variables:{hvac_mode:{template:e=>{const t=hs(e,"supported_features")||0;let i=ms(e,"hvac_modes");return 1&t&&(i=i.filter(e=>!["heat","cool","heat_cool","off"].includes(e))),{options:i}}}}},set_preset:{service:"set_preset_mode",variables:{preset_mode:{options:"preset_modes"}},supported_feature:16},set_fan_mode:{service:"set_fan_mode",variables:{fan_mode:{options:"fan_modes"}}}},cover:{close:{service:"close_cover",supported_feature:2},open:{service:"open_cover",supported_feature:1},set_position:{service:"set_cover_position",variables:{position:{min:0,max:100,step:1,unit:"%"}},supported_feature:4},set_tilt_position:{service:"set_cover_tilt_position",variables:{tilt_position:{min:0,max:100,step:1,unit:"%"}},supported_feature:128}},fan:{turn_on:{},turn_off:{},set_percentage:{service:"set_percentage",variables:{percentage:{min:0,max:100,step:1,unit:"%"}},supported_feature:1},set_oscillation:{service:"oscillate",variables:{oscillating:{options:["True","False"]}},supported_feature:2},set_direction:{variables:{direction:{options:["forward","reverse"]}},supported_feature:4},set_preset:{service:"set_preset_mode",variables:{preset_mode:{options:"preset_modes"}},supported_feature:8}},humidifier:{turn_on:{},turn_off:{},set_humidity:{variables:{humidity:{min:"min_humidity",max:"max_humidity",step:1,unit:"%"}}},set_mode:{variables:{mode:{options:"available_modes"}},supported_feature:1}},input_boolean:{turn_on:{},turn_off:{}},input_number:{set_value:{variables:{value:{min:"min",max:"max",step:"step",unit:"unit_of_measurement"}}}},input_select:{select_option:{variables:{option:{options:"options"}}}},light:{turn_on:{condition:e=>0==bs(e)},_turn_on:{variables:{brightness:{min:0,max:100,step:1,unit:"%",scale_factor:2.55,optional:!0}},condition:e=>0!=bs(e)},turn_off:{}},lock:{lock:{},unlock:{}},media_player:{turn_on:{supported_feature:128},turn_off:{supported_feature:256},select_source:{variables:{source:{options:"source_list"}},supported_feature:2048}},notify:{"{entity_id}":{variables:{title:{},message:{multiline:!0}}}},number:{set_value:{variables:{value:{min:"min",max:"max",step:"step"}}}},scene:{turn_on:{}},script:{turn_on:{},turn_off:{},"{entity_id}":{}},select:{select_option:{variables:{option:{options:"options"}}}},switch:{turn_on:{},turn_off:{}},vacuum:{turn_on:{supported_feature:1},start:{supported_feature:8192},play_pause:{supported_feature:4}},water_heater:{set_temperature:{variables:{temperature:{template:ws}}},set_mode:{service:"set_operation_mode",variables:{operation_mode:{options:"operation_list"}},supported_feature:2},set_away_mode:{variables:{away_mode:{options:["on","off"]}},supported_feature:4}}};function xs(...e){const t=e[0].options.map(e=>e.value).filter(t=>e.map(e=>e.options).every(e=>e.map(e=>e.value).includes(t))).map(t=>{const i=e.map(e=>e.options.find(e=>e.value==t)).filter(it).map(e=>e.name).filter(it),s=e.map(e=>e.options.find(e=>e.value==t)).filter(it).map(e=>e.icon).filter(it);return{value:t,name:i.length?i.reduce((e,t)=>t):void 0,icon:s.length?s.reduce((e,t)=>t):void 0}}),i=e.map(e=>e.name).filter(it);return{type:Ie.List,name:i.length?i.reduce((e,t)=>t):void 0,options:t}}function $s(e,t){const i=t.options.find(t=>t.value==e);return i?i.name||i.value:""}function js(...e){const t=e.map(e=>e.name).filter(it);return{type:Ie.Text,name:t.length?t.reduce((e,t)=>t):void 0,multiline:e.some(e=>e.multiline)}}const Os={alarm_control_panel:{alarm_disarm:"ui.card.alarm_control_panel.disarm",alarm_arm_home:"ui.card.alarm_control_panel.arm_home",alarm_arm_away:"ui.card.alarm_control_panel.arm_away",alarm_arm_night:"ui.card.alarm_control_panel.arm_night",alarm_arm_custom_bypass:"ui.card.alarm_control_panel.arm_custom_bypass"},automation:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off",trigger:"ui.card.script.run"},climate:{turn_off:"ui.card.vacuum.actions.turn_off",heat:"services.climate.set_temperature_hvac_mode_heat",cool:"services.climate.set_temperature_hvac_mode_cool",regulate:"services.climate.set_temperature_hvac_mode_heat_cool",set_temperature:"services.climate.set_temperature",set_mode:"services.climate.set_hvac_mode",set_preset:"services.climate.set_preset_mode",set_fan_mode:"services.climate.set_fan_mode"},cover:{close:"services.cover.close_cover",open:"services.cover.open_cover",set_position:"services.cover.set_cover_position",set_tilt:"services.cover.set_cover_tilt_position"},fan:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off",set_speed:"services.fan.set_speed",set_oscillation:"services.fan.oscillate",set_direction:"services.fan.set_direction",set_preset:"services.climate.set_preset_mode"},humidifier:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off",set_humidity:"services.humidifier.set_humidity",set_mode:"services.humidifier.set_mode"},input_boolean:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off"},input_number:{set_value:"services.input_number.set_value"},input_select:{select_option:"services.input_select.select_option"},light:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off"},lock:{lock:"ui.card.lock.lock",unlock:"ui.card.lock.unlock"},media_player:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off",select_source:"services.media_player.select_source"},notify:{"{entity_id}":"services.notify.notify"},number:{set_value:"services.input_number.set_value"},scene:{turn_on:"ui.card.vacuum.actions.turn_on"},script:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off","{entity_id}":"services.script.script"},select:{select_option:"services.input_select.select_option"},switch:{turn_on:"ui.card.vacuum.actions.turn_on",turn_off:"ui.card.vacuum.actions.turn_off"},vacuum:{turn_on:"ui.card.vacuum.actions.turn_on",start:"ui.card.vacuum.start_cleaning",play_pause:"services.vacuum.start_pause"},water_heater:{set_temperature:"services.climate.set_temperature",set_mode:"services.water_heater.set_operation_mode",set_away_mode:"services.water_heater.set_away_mode"}},Ss=(e,t,i)=>{if(e in Os&&t in Os[e]){let s=Os[e][t];return s instanceof Function&&(s=s(t)),s.startsWith("services")?es(s,ct(i)):i.localize(s)}return t},zs=(e,t)=>{const i="close"==e;switch(null==t?void 0:t.attributes.device_class){case"garage":return i?"mdi:garage":"mdi:garage-open";case"door":return i?"mdi:door-closed":"mdi:door-open";case"blind":return i?"mdi:blinds":"mdi:blinds-open";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:window-shutter":"mdi:window-shutter-open"}},Es={alarm_control_panel:{alarm_disarm:"mdi:lock-open-variant-outline",alarm_arm_home:"mdi:home-outline",alarm_arm_away:"mdi:exit-run",alarm_arm_night:"mdi:power-sleep",alarm_arm_custom_bypass:"mdi:shield-lock-outline"},automation:{turn_on:"mdi:power",turn_off:"mdi:power-off",trigger:"mdi:play"},climate:{turn_off:"mdi:power-off",heat:"mdi:fire",cool:"mdi:snowflake",regulate:"mdi:thermometer",set_temperature:"mdi:thermometer",set_mode:"mdi:cog-transfer-outline",set_preset:"mdi:cloud-download-outline",set_fan_mode:"mdi:fan"},cover:{close:zs,open:zs,set_position:"mdi:ray-vertex",set_tilt_position:"mdi:valve"},fan:{turn_on:"mdi:power",turn_off:"mdi:power-off",set_percentage:"mdi:weather-windy",set_oscillation:"mdi:arrow-left-right",set_direction:"mdi:cog-clockwise",set_preset_mode:"mdi:cloud-download-outline"},humidifier:{turn_on:"mdi:power",turn_off:"mdi:power-off",set_humidity:"mdi:water-percent",set_mode:"mdi:cog-transfer-outline"},input_boolean:{turn_on:"mdi:flash",turn_off:"mdi:flash-off"},input_number:{set_value:"mdi:counter"},input_select:{select_option:"mdi:counter"},light:{turn_on:"mdi:lightbulb",turn_off:"mdi:lightbulb-off"},lock:{lock:"mdi:lock-outline",unlock:"mdi:lock-open-variant-outline"},media_player:{turn_on:"mdi:power",turn_off:"mdi:power-off",select_source:"hass:music-box-multiple-outline"},notify:{"{entity_id}":"mdi:message-alert"},number:{set_value:"mdi:counter"},scene:{turn_on:"mdi:play"},script:{turn_on:"mdi:flash",turn_off:"mdi:flash-off","{entity_id}":"mdi:play"},select:{select_option:"mdi:counter"},switch:{turn_on:"mdi:flash",turn_off:"mdi:flash-off"},vacuum:{turn_on:"mdi:power",start:"mdi:play-circle-outline",play_pause:"mdi:play-circule-outline"},water_heater:{set_temperature:"mdi:thermometer",set_mode:"mdi:cog-transfer-outline",set_away_mode:"mdi:car-traction-control"}},Cs=(e,t,i)=>{if(e in Es&&t in Es[e]){let s=Es[e][t];return s instanceof Function&&(s=s(t,i)),s}return"flash"},As={climate:{temperature:"ui.card.weather.attributes.temperature",target_temp_low:"ui.panel.lovelace.editor.card.generic.minimum",target_temp_high:"ui.panel.lovelace.editor.card.generic.maximum",hvac_mode:"ui.card.climate.operation",preset_mode:"ui.card.climate.preset_mode",fan_mode:"ui.card.climate.fan_mode"},cover:{position:"ui.card.cover.position",tilt_position:"ui.card.cover.tilt_position"},fan:{percentage:"ui.card.fan.speed",oscillating:"ui.card.fan.oscillate",direction:"ui.card.fan.direction",preset_mode:"ui.card.fan.preset_mode"},humidifier:{humidity:"ui.card.humidifier.humidity",mode:"ui.card.humidifier.mode"},input_number:{value:"ui.panel.config.helpers.types.input_number"},input_select:{option:"ui.components.dialogs.input_select.options"},light:{brightness:"ui.card.light.brightness"},media_player:{source:"ui.card.media_player.source"},notify:{title:"ui.panel.config.automation.editor.actions.type.device_id.extra_fields.title",message:"ui.panel.config.automation.editor.actions.type.device_id.extra_fields.message"},number:{value:"ui.panel.config.helpers.types.input_number"},select:{option:"ui.components.dialogs.input_select.options"},water_heater:{temperature:"ui.card.weather.attributes.temperature",operation_mode:"ui.card.water_heater.operation",away_mode:"ui.card.water_heater.away_mode"}},Ds=(e,t,i)=>e in As&&t in As[e]?i.localize(As[e][t]):t,Ms={climate:{hvac_mode:{off:"component.climate.state._.off",heat:"component.climate.state._.heat",cool:"component.climate.state._.cool",heat_cool:"component.climate.state._.heat_cool",dry:"component.climate.state._.dry",fan_only:"component.climate.state._.fan_only"},preset_mode:{activity:"state_attributes.climate.preset_mode.activity",away:"state_attributes.climate.preset_mode.away",boost:"state_attributes.climate.preset_mode.boost",comfort:"state_attributes.climate.preset_mode.comfort",eco:"state_attributes.climate.preset_mode.eco",home:"state_attributes.climate.preset_mode.home",none:"state_attributes.climate.preset_mode.none",sleep:"state_attributes.climate.preset_mode.sleep"}},fan:{direction:{forward:"ui.card.fan.forward",reverse:"ui.card.fan.reverse"},oscillating:{True:"state.default.on",False:"state.default.off"}},humidifier:{mode:{auto:"state_attributes.humidifier.mode.auto",away:"state_attributes.humidifier.mode.away",baby:"state_attributes.humidifier.mode.baby",boost:"state_attributes.humidifier.mode.boost",comfort:"state_attributes.humidifier.mode.comfort",eco:"state_attributes.humidifier.mode.eco",home:"state_attributes.humidifier.mode.home",normal:"state_attributes.humidifier.mode.normal",sleep:"state_attributes.humidifier.mode.sleep"}},water_heater:{operation_mode:{off:"component.water_heater.state._.off",eco:"component.water_heater.state._.eco",electric:"component.water_heater.state._.electric",gas:"component.water_heater.state._.gas",heat_pump:"component.water_heater.state._.heat_pump",high_demand:"component.water_heater.state._.high_demand",performance:"component.water_heater.state._.performance"},away_mode:{on:"state.default.on",off:"state.default.off"}}},Ts=(e,t,i,s)=>e in Ms&&t in Ms[e]&&i in Ms[e][t]?s.localize(Ms[e][t][i]):i,Ns={climate:{hvac_mode:{off:"mdi:power-off",heat:"mdi:fire",cool:"mdi:snowflake",heat_cool:"mdi:thermometer",auto:"mdi:autorenew",dry:"mdi:water-percent",fan_only:"mdi:fan"},preset_mode:{activity:"mdi:account-alert-outline",away:"mdi:car-traction-control",boost:"mdi:rocket-launch-outline",comfort:"mdi:car-seat-cooler",eco:"mdi:leaf",home:"mdi:home-outline",none:"mdi:cancel",sleep:"mdi:sleep"}},fan:{direction:{forward:"mdi:autorenew",reverse:"mdi:sync"},oscillating:{True:"mdi:toggle-switch-outline",False:"mdi:toggle-switch-off-outline"}},humidifier:{mode:{auto:"mdi:autorenew",away:"mdi:car-traction-control",baby:"mdi:baby-bottle-outline",boost:"mdi:rocket-launch-outline",comfort:"mdi:car-seat-cooler",eco:"mdi:leaf",home:"mdi:home-outline",normal:"mdi:account-outline",sleep:"mdi:sleep"}},water_heater:{operation_mode:{off:"mdi:power-off",eco:"mdi:leaf",electric:"mdi:lightning-bolt",gas:"mdi:fire",heat_pump:"mdi:hvac",high_demand:"mdi:water-plus-outline",performance:"mdi:rocket-launch-outline"},away_mode:{on:"mdi:toggle-switch-outline",off:"mdi:toggle-switch-off-outline"}}},Ls=(e,t,i)=>{if(e in Ns&&t in Ns[e]&&i in Ns[e][t])return Ns[e][t][i]};function Is(e){if(Object.keys(e||{}).length)return Object.entries(e).map(([e,t])=>"options"in t?[e,xs(t)]:"min"in t||"max"in t?[e,fs(t)]:[e,js(t)]).reduce((e,[t,i])=>i?Object.assign(e,{[t]:i}):e,{})}function Ps(...e){const t=tt(e.map(e=>e.type).filter(it));return t.length?t.length>1?void 0:t[0]==Ie.Level?fs(...e):t[0]==Ie.List?xs(...e):js(...e):(e=Object.values(Is(Object.assign({},...e))),Ps(...e))}function qs(e){if(1==e.length)return e[0];let t=e[0].filter(t=>e.slice(1).every(e=>e.some(e=>us(t,e))));return t=t.map(t=>{const i=Object.entries(t.variables||{}).map(([i,s])=>{const a=e.map(e=>e.find(e=>us(e,t)));if(!a.every(e=>e&&e.variables&&i in e.variables))return[i,void 0];const o=a.map(e=>e.variables[i]);return o.every(e=>s.type==e.type)?[i,Ps(...o)]:[i,void 0]}).reduce((e,[t,i])=>i?Object.assign(e,{[t]:i}):e,{});if(!Object.values(i).find(e=>e.type==Ie.List&&!e.options.length))return t=Object.assign(Object.assign({},t),{variables:i})}).filter(it),t}const Rs=(e,t,i=!0)=>{const s=Ae(e);if("group"==s){const s=t.states[e],a=ms(s,"entity_id");if(!a.length)return[];const o=a.map(e=>Rs(e,t,i));return function(e,t,i){const s=t&&t.attributes.entity_id&&Array.isArray(t.attributes.entity_id)?t.attributes.entity_id:[];return i=i.map((t,i)=>{const a=e.states[s[i]],o=bs(a);return t=t.filter(e=>!e.supported_feature||e.supported_feature&o).map(e=>Qe(e,"supported_feature"))}),[...new Set(s.map(e=>Ae(e)))].length>1&&(i=i.map(e=>e.map(e=>"turn_on"==De(e.service)||"turn_off"==De(e.service)?Object.assign(Object.assign({},e),{service:"homeassistant."+De(e.service),icon:"turn_on"==De(e.service)?"flash":"flash-off"}):e))),i.length?qs(i):[]}(t,s,o)}return Object.keys(ks).includes(s)?Object.entries(ks[s]).map(([s,a])=>Us(s,a,e,t,i)).filter(it):[]},Us=(e,t,i,s,a)=>{const o=Ae(i),n=s.states[i];if(t.condition&&!t.condition(n))return;e.startsWith("_")&&(e=e=e.substring(1));let r={name:"",icon:"flash",service:t.service?`${o}.${t.service}`:`${o}.${e}`,service_data:t.service_data};if(t.supported_feature){const e=t.supported_feature instanceof Function?t.supported_feature(n):t.supported_feature;r=Object.assign(Object.assign({},r),{supported_feature:e})}if(r=Object.assign(Object.assign({},r),{name:Ss(o,e,s),icon:Cs(o,e,n)}),Object.keys(t.variables||{}).forEach(e=>{r=Object.assign(Object.assign({},r),{variables:Object.assign(Object.assign({},r.variables),{[e]:Hs(o,e,t.variables[e],n,s,a)})})}),Object.values(r.variables||{}).some(e=>e.type==Ie.List&&!e.options.length))return;const l=r.service.match(/^[a-z_]+\.(\{entity_id\})$/);return l&&(r=Object.assign(Object.assign({},r),{service:r.service.replace(l[1],De(i))})),r},Hs=(e,t,i,s,a,o)=>{let n=_s(i,s,a);if(n=Object.assign(Object.assign({},n),{name:Ds(e,t,a)}),"options"in n&&it(n.options)){let i=[...n.options];if(!o){const s=((e,t)=>e in Ms&&t in Ms[e]?Object.keys(Ms[e][t]):[])(e,t).filter(e=>!i.map(e=>e.value).includes(e));i=[...i,...s.map(e=>Object({value:e}))]}return i=i.map(i=>Object.assign(i,{name:i.name?i.name:Ts(e,t,i.value,a),icon:i.icon?i.icon:Ls(e,t,i.value)})),n=Object.assign(Object.assign({},n),{options:i}),xs(n)}return"min"in n&&it(n.min)&&"max"in n&&it(n.max)?fs(n):js(n)},Vs=/\{[^\}]+\}/g,Fs=/\[([^\]]+)\]/;function Bs(e){let t=e.name;t||(t=nt(De(e.service)));const i=t.match(Fs);if(i){let s=i[1];const a=i[1].match(Vs);return a&&a.length&&a.every(t=>{const i=t.substring(1,t.length-1);if(!Object.keys(e.service_data||{}).includes(i))return!1;let a="";return a=Object.keys(e.variables||{}).includes(i)?e.variables[i].type==Ie.Level?ys(e.service_data[i],e.variables[i]):e.variables[i].type==Ie.List?$s(e.service_data[i],e.variables[i]):function(e,t){return String(e)}(e.service_data[i],e.variables[i]):e.service_data[i],s=s.replace(t,a),!0})?t.replace(i[0],s):t.replace(i[0],"")}return t||""}function Ys(e,t,i){if(Array.isArray(e)){return qs(e.map(e=>Ys(e,t,i)))}const s=t.states[e];let a=i.standard_configuration?Rs(e,t):[];const o=et(Object.entries(i.customize).filter(([t])=>rs(t,e)).sort((e,t)=>t[0].length-e[0].length).map(([,e])=>e.exclude_actions).filter(it));o.length&&(a=a.filter(e=>!o.some(t=>{return(i=Bs(e),i.replace(/_/g," ").trim().toLowerCase()).includes(t);var i})));const n=et(Object.entries(i.customize).filter(([t])=>rs(t,e)).sort((e,t)=>t[0].length-e[0].length).map(([,e])=>e.actions).filter(it));n.length&&n.forEach(s=>{Ae(s.service).length||(s=Object.assign(Object.assign({},s),{service:Ae(e)+"."+De(s.service)})),s.service_data&&(s=Object.assign(Object.assign({},s),{service_data:Qe(s.service_data,"entity_id")}));let o=a.findIndex(e=>us(e,s));if(o<0){const n=(i.standard_configuration?Rs(e,t,!1):[]).find(e=>us(e,s));n&&(a=[...a,n],o=a.length-1)}if(o>=0){if(Object.assign(a,{[o]:Object.assign(Object.assign({},a[o]),Qe(s,"variables"))}),Object.keys(s.variables||{}).length){let e=a[o].variables||{};e=Object.entries(e).map(([e,t])=>Object.keys(s.variables).includes(e)?[e,Object.assign(Object.assign({},t),s.variables[e])]:[e,s.variables[e]]).reduce((e,[t,i])=>i?Object.assign(e,{[t]:i}):e,{});const t=Object.keys(s.variables).filter(t=>!Object.keys(e).includes(t));e=Object.assign(Object.assign({},e),Is(Xe(s.variables,t))),Object.assign(a,{[o]:Object.assign(Object.assign({},a[o]),{variables:e})})}}else s=Object.assign(Object.assign({},s),{variables:Is(s.variables)}),a.push(s)});const r=bs(s);return a=a.filter(e=>!e.supported_feature||e.supported_feature&r),a=a.map(e=>(Object.keys(e.variables||{}).length&&Object.keys(e.variables).forEach(t=>{e.variables[t].type==Ie.List&&1==e.variables[t].options.length&&(e=Object.assign(Object.assign({},e),{service_data:Object.assign(Object.assign({},e.service_data),{[t]:e.variables[t].options[0].value}),variables:Qe(e.variables,t)}))}),e)),a}function Ws(e,t){const i=e.entity_id||e.service,s=e.service,a=e.service_data||{},o=Object.keys(a);let n=Rs(i,t,!1),r=n.filter(t=>us(e,t,!0));if(1==r.length?n=r:(n=n.filter(e=>e.service==s),n=n.filter(e=>Object.keys(e.service_data||{}).every(e=>o.includes(e)))),n.length>1&&n.sort((e,t)=>{const i=Object.entries(e.service_data||{}).map(([e,t])=>e in a?a[e]==t?1:-1:0).reduce((e,t)=>e+t,0),s=Object.entries(t.service_data||{}).map(([e,t])=>e in a?a[e]==t?1:-1:0).reduce((e,t)=>e+t,0);if(i>s)return-1;if(in.includes(e)).length,c=o.filter(e=>r.includes(e)).length;if(l>c)return-1;if(l!o.includes(e)).length,u=r.filter(e=>!o.includes(e)).length;return d>u?1:d{Object.keys(e||{}).includes(t)&&e[t].type==Ie.List&&(e=Object.assign(Object.assign({},e),{[t]:e[t].options.some(e=>e.value==i)?e[t]:Object.assign(Object.assign({},e[t]),{options:[...e[t].options,{value:i}]})}))}),Object.assign(Object.assign({},n[0]),{service_data:Object.assign(Object.assign({},n[0].service_data||{}),a),variables:e})}return{service:s,service_data:e.service_data}}function Gs(e,t,i){const s=e in t.states?t.states[e]:void 0;let a={id:e,name:s?s.attributes.friendly_name||De(e):"(unknown entity)",icon:s?s.attributes.icon:"help-circle-outline"};if(!s&&"notify"==Ae(e)){let i=De(e),s=ds(e,t);if(i.includes("mobile_app_")&&(i=i.split("mobile_app_").pop(),"device_tracker."+i in t.states)){i=t.states["device_tracker."+i].attributes.friendly_name||i,s="hass:cellphone-text"}a=Object.assign(Object.assign({},a),{name:i,icon:s})}if(void 0!==i.standard_configuration&&!i.standard_configuration||a.icon?a.icon||(a=Object.assign(Object.assign({},a),{icon:"folder-outline"})):a=Object.assign(Object.assign({},a),{icon:ds(e,t)}),i.customize){Object.entries(i.customize).filter(([e])=>rs(e,a.id)).sort((e,t)=>t[0].length-e[0].length).map(([,e])=>e).forEach(e=>{a=Object.assign(Object.assign({},a),Xe(e,["name","icon"]))})}return a}const Zs=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Ks=(e,t,i)=>{if("object"!=typeof e){let t=new Date(2017,1,26);t.setDate(t.getDate()+e),e=t}if((()=>{try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1})())return e.toLocaleDateString(t.language,{weekday:i?"short":"long"});{const t=e.getDay();return i?Zs[t].substr(0,3):Zs[t]}};function Js(e){return e.includes("daily")?Ue.Daily:e.includes("workday")?Ue.Workday:e.includes("weekend")?Ue.Weekend:Ue.Custom}var Xs;!function(e){e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24"}(Xs||(Xs={}));const Qs=e=>{if(e.time_format===Xs.language||e.time_format===Xs.system){const t=e.time_format===Xs.language?e.language:void 0,i=(new Date).toLocaleString(t);return i.includes("AM")||i.includes("PM")}return e.time_format===Xs.am_pm};function ea(e,t,i){return i===Xs.am_pm||!i&&t.time_format===Xs.am_pm?Se(e,"h:mm A"):i===Xs.twenty_four||!i&&t.time_format===Xs.twenty_four?Se(e,"shortTime"):(()=>{try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1})()?e.toLocaleTimeString(t.language,{hour:"numeric",minute:"2-digit",hour12:Qs(t)}):Qs(t)?ea(e,t,Xs.am_pm):ea(e,t,Xs.twenty_four)}function ta(e){let t=new Date;const i=(e||"").match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})/);null!==i&&t.setFullYear(Number(i[1]),Number(i[2])-1,Number(i[3]));const s=(e||"").match(/([0-9]{2}):([0-9]{2})(:([0-9]{2}))?$/);return null!==s&&t.setHours(Number(s[1]),Number(s[2]),s.length>4?Number(s[4]):t.getSeconds()),t}const ia=(e,t,i)=>dt(t.display_options&&t.display_options.primary_info?t.display_options.primary_info:"{entity}: {action}").map(s=>oa(s,e,t,i)),sa=(e,t,i)=>dt(t.display_options&&t.display_options.secondary_info?t.display_options.secondary_info:["relative-time","additional-tasks"]).map(s=>oa(s,e,t,i)),aa=(e,t,i)=>{if(t.display_options&&t.display_options.icon&&"entity"==t.display_options.icon){const s=ra(e,t,i);return 1==tt(s.map(e=>e.icon)).length?s[0].icon:ds(s[0].id,i)}return na(e,t,i).icon},oa=(e,t,i,s)=>{switch(e){case"default":return oa("name",t,i,s)||`${oa("entity",t,i,s)}: ${oa("action",t,i,s)}`;case"name":return t.name||"";case"relative-time":return"";case"additional-tasks":return t.timeslots.length>1?"+"+es("ui.panel.overview.additional_tasks",ct(s),"{number}",String(t.timeslots.length-1)):"";case"time":return ot(((e,t)=>{const i=e=>{const i=Je(e);if(!i)return e;const s=i.event==Re.Sunrise?t.localize("ui.panel.config.automation.editor.conditions.type.sun.sunrise").toLowerCase():t.localize("ui.panel.config.automation.editor.conditions.type.sun.sunset").toLowerCase();if(Math.abs(Ge(i.offset,t))<300)return es("ui.components.time.at_sun_event",ct(t),"{sunEvent}",s);const a="-"==i.sign?t.localize("ui.panel.config.automation.editor.conditions.type.sun.before").slice(0,-1).toLowerCase():t.localize("ui.panel.config.automation.editor.conditions.type.sun.after").slice(0,-1).toLowerCase();return`${ea(ta(i.offset),ct(t),Ee.twenty_four)} ${a} ${s}`};if(e.stop){const s=Je(e.start)?i(e.start):ea(ta(e.start),ct(t)),a=Je(e.stop)?i(e.stop):ea(ta(e.stop),ct(t));return es("ui.components.time.interval",ct(t),["{startTime}","{endTime}"],[s,a])}{const s=e.start;if(Je(s))return i(s);{const e=ta(s);return es("ui.components.time.absolute",ct(t),"{time}",ea(e,ct(t)))}}})(t.timeslots[t.next_entries[0]],s));case"days":return ot(((e,t)=>{if(!t)return"";switch(Js(e)){case Ue.Daily:return es("ui.components.date.day_types_long.daily",ct(t));case Ue.Workday:return es("ui.components.date.day_types_long.workdays",ct(t));case Ue.Weekend:return es("ui.components.date.day_types_long.weekend",ct(t));case Ue.Custom:const i=e.map(e=>{switch(e){case"mon":return 1;case"tue":return 2;case"wed":return 3;case"thu":return 4;case"fri":return 5;case"sat":return 6;case"sun":return 7;default:return}}).filter(e=>e),s=function(e){const t=[];for(let i=0;i!i.includes(e));return es("ui.components.date.repeated_days_except",ct(t),"{excludedDays}",Ks(e.pop(),ct(t)))}const o=i.map(e=>Ks(e,ct(t)));if(i.length>=3&&a>=3){const e=s.reduce((e,t,i)=>t==a?i:e,0);o.splice(e,a,es("ui.components.date.days_range",ct(t),["{startDay}","{endDay}"],[o[e],o[e+a-1]]))}const n=o.length>1?`${o.slice(0,-1).join(", ")} ${t.localize("ui.common.and")} ${o.pop()}`:""+o.pop();return es("ui.components.date.repeated_days",ct(t),"{days}",n);default:return""}})(t.weekdays,s));case"entity":const a=ra(t,i,s),o=tt(a.map(e=>Ae(e.id)));return 1==a.length?ot(nt(a[0].name||"")):1==o.length?`${a.length}x ${es("domains."+o[0],ct(s))||o[0]}`:a.length+"x entities";case"action":return ot(Bs(na(t,i,s)));case"tags":return(t.tags||[]).map(e=>`${e}`).join("");default:const n=/\{([^\}]+)\}/;let r;for(;r=n.exec(e);)e=e.replace(r[0],String(oa(String(r[1]),t,i,s)));return e}},na=(e,t,i)=>{const s=e.timeslots[e.next_entries[0]],a=Ys(s.actions[0].entity_id||s.actions[0].service,i,t).filter(e=>us(e,s.actions[0],!0)).reduce((e,t)=>t,void 0);return a?Object.assign(Object.assign({},a),{service_data:Object.assign(Object.assign({},a.service_data),Object.entries(s.actions[0].service_data||{}).filter(([e])=>Object.keys(a.variables||{}).includes(e)).reduce((e,[t,i])=>Object.assign(e,{[t]:i}),{}))}):Ws(s.actions[0],i)},ra=(e,t,i)=>tt(e.timeslots[e.next_entries[0]].actions.map(e=>e.entity_id||e.service)).map(e=>Gs(e,i,t));function la(e,t,i){const s=e.getFullYear()==(new Date).getFullYear(),a=()=>{try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1};return i?Se(e,"isoDate"):s?a()?new Intl.DateTimeFormat(t.language,{month:"long",day:"numeric"}).format(e):Se(e,"MMMM D"):a()?new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"}).format(e):Se(e,"MMMM D, YYYY")}var ca=window&&window.__assign||function(){return(ca=Object.assign||function(e){for(var t,i=1,s=arguments.length;i{this.requestUpdate()},1e3*e),this.updateInterval=e}set hass(e){this._hass=e,this.startRefreshTimer(this.updateInterval)}relativeTime(e){if(!this._hass)return"";const t=new Date;let i=(t.getTime()-e.getTime())/1e3;const s=i>=0?"past":"future";i=Math.abs(i);const a=Math.round(i);if("future"==s&&a>0){if(i/3600>=6){const i=t.setHours(0,0,0,0),s=Math.floor((e.valueOf()-i.valueOf())/864e5);let a="";s>14?a=la(e,ct(this._hass)):s>7?a=es("ui.components.date.next_week_day",ct(this._hass),"{weekday}",Ks(e,ct(this._hass))):1==s?a=es("ui.components.date.tomorrow",ct(this._hass)):s>0&&(a=Ks(e,ct(this._hass)));let o=es("ui.components.time.absolute",ct(this._hass),"{time}",ea(e,ct(this._hass)));return 12==e.getHours()&&0==e.getMinutes()?o=es("ui.components.time.at_noon",ct(this._hass)):0==e.getHours()&&0==e.getMinutes()&&(o=es("ui.components.time.at_midnight",ct(this._hass))),String(a+" "+o).trim()}if(Math.round(i/60)>60&&Math.round(i/60)<120){const e=Math.round(i/60-60),t=this._hass.localize("ui.common.and");return`${new Intl.RelativeTimeFormat(ct(this._hass).language,{numeric:"auto"}).format(1,"hour")} ${t} ${Intl.NumberFormat(ct(this._hass).language,{style:"unit",unit:"minute",unitDisplay:"long"}).format(e)}`}if(Math.round(i)>60&&Math.round(i)<120){const e=Math.round(i-60),t=this._hass.localize("ui.common.and");return`${new Intl.RelativeTimeFormat(ct(this._hass).language,{numeric:"auto"}).format(1,"minute")} ${t} ${Intl.NumberFormat(ct(this._hass).language,{style:"unit",unit:"second",unitDisplay:"long"}).format(e)}`}}const o=function(e,t,i){void 0===t&&(t=Date.now()),void 0===i&&(i={});var s=ca(ca({},da),i||{}),a=(+e-+t)/1e3;if(Math.abs(a)0)return{value:Math.round(d),unit:"year"};var u=12*d+l.getMonth()-c.getMonth();if(Math.round(Math.abs(u))>0)return{value:Math.round(u),unit:"month"};var h=a/604800;return{value:Math.round(h),unit:"week"}}(e);return new Intl.RelativeTimeFormat(ct(this._hass).language,{numeric:"auto"}).format(o.value,o.unit)}render(){if(!this._hass||!this.datetime)return N``;const e=new Date,t=Math.round((this.datetime.valueOf()-e.valueOf())/1e3);let i=60;return Math.abs(t)<=150&&(i=Math.max(Math.ceil(Math.abs(t))/10,2)),this.updateInterval!=i&&this.startRefreshTimer(i),N` + ${ot(this.relativeTime(this.datetime))} + `}};t([ae()],ua.prototype,"_hass",void 0),t([ae()],ua.prototype,"datetime",void 0),ua=t([ie("my-relative-time")],ua);const ha=e=>new Date(e.timestamps[e.next_entries[0]]).valueOf(),ma=(e,t)=>{var i;if(!e.timeslots.every(e=>e.actions.every(e=>ls(e.entity_id||e.service,t))))return!1;const s=dt(t.tags);return!s.length||(!!(e.tags||[]).some(e=>s.includes(e))||!(!s.includes("none")||(null===(i=e.tags)||void 0===i?void 0:i.length)))},pa=(e,t)=>!!t.discover_existing||!!e&&ma(e,t),_a=(e,t,i)=>({primaryInfo:ia(e,t,i),secondaryInfo:sa(e,t,i),icon:aa(e,t,i)});let va=class extends(is(ee)){constructor(){super(...arguments),this.showDiscovered=!1,this.scheduleDisplayInfo={},this.connectionError=!1}hassSubscribe(){return this.loadSchedules(),[this.hass.connection.subscribeMessage(e=>this.updateScheduleItem(e),{type:"scheduler_updated"})]}async updateScheduleItem(e){as(this.hass,e.schedule_id).then(t=>{var i;const s=null===(i=this.schedules)||void 0===i?void 0:i.find(t=>t.schedule_id==e.schedule_id);let a=[...this.schedules||[]];this.scheduleDisplayInfo=Object.assign(Object.assign({},this.scheduleDisplayInfo),{[t.schedule_id]:_a(t,this.config,this.hass)}),t&&pa(t,this.config)?a=s?ha(s)==ha(t)?a.map(e=>e.schedule_id==t.schedule_id?t:e):this.sortSchedules(a.map(e=>e.schedule_id==t.schedule_id?t:e)):this.sortSchedules([...a,t]):s&&(a=a.filter(t=>t.schedule_id!=e.schedule_id)),this.schedules=[...a]})}async loadSchedules(){ss(this.hass).then(e=>{const t=e.filter(e=>pa(e,this.config));let i={};Object.keys(t).forEach(e=>{i=Object.assign(Object.assign({},i),{[t[e].schedule_id]:_a(t[e],this.config,this.hass)})}),this.scheduleDisplayInfo=i,this.schedules=this.sortSchedules(t)}).catch(e=>{this.schedules=[],this.connectionError=!0})}shouldUpdate(e){const t=e.get("hass"),i=e.get("config");return t&&1==e.size&&this.schedules?this.schedules.some(e=>JSON.stringify(t.states[e.entity_id])!==JSON.stringify(this.hass.states[e.entity_id])):(i&&this.config&&(i.discover_existing!==this.config.discover_existing||i.tags!==this.config.tags)&&(async()=>{await this.loadSchedules()})(),!0)}render(){return this.hass&&this.config&&this.schedules?N` + +
+
+ ${this.config.title?"string"==typeof this.config.title?this.config.title:es("ui.panel.common.title",ct(this.hass)):""} +
+ ${this.schedules.length&&this.config.show_header_toggle?N` + + `:""} +
+
+ ${this.renderRows()} +
+ ${!1!==this.config.show_add_button?N` +
+ ${this.hass.localize("ui.components.area-picker.add_dialog.add")} + +
+ `:""} +
+ `:N``}renderRows(){if(!this.config||!this.hass||!this.schedules)return N``;if(this.connectionError)return N` +
+ + ${es("ui.panel.overview.backend_error",ct(this.hass))} + +
+ `;if(!Object.keys(this.schedules).length)return N` +
+ ${es("ui.panel.overview.no_entries",ct(this.hass))} +
+ `;const e=this.schedules.filter(e=>ma(e,this.config)),t=this.schedules.filter(e=>!ma(e,this.config));return N` + ${e.map(e=>this.renderScheduleRow(e))} + ${Object.keys(t).length?this.showDiscovered?N` + ${t.map(e=>this.renderScheduleRow(e))} +
+ +
+ `:N` +
+ +
+ `:""} + `}renderScheduleRow(e){var t,i,s;if(!this.hass)return N``;if(!e||!e.next_entries.length||!Object.keys(this.scheduleDisplayInfo).includes(e.schedule_id))return"NOT_RUNNING"!==this.hass.config.state?N` + + Defective schedule entity: ${e.entity_id} + + `:N` + + ${this.hass.localize("ui.panel.lovelace.warning.starting")} + + `;const a=this.scheduleDisplayInfo[e.schedule_id],o=(null===(t=this.hass.states[e.entity_id])||void 0===t?void 0:t.state)||"";return N` +
this.editItemClick(e.schedule_id)} + > + +
+ ${this.renderDisplayItems(e,a.primaryInfo)} +
+ ${this.renderDisplayItems(e,a.secondaryInfo)} +
+
+ this.toggleDisabled(t,e.entity_id)} + > + +
+ `}renderDisplayItems(e,t){const i=t=>{const i=t.split("");if(i.length>1)return N` + ${i[0]?pt(i[0]):""} + + + ${i[1]?pt(i[1]):""} + `;const s=t.split(/([^<]*<\/tag>)/g);return s.length>1?s.filter(e=>e.length).map(e=>{const t=e.match(/([^<]*)<\/tag>/g);return t?pt(`${t[0]}`):e}):pt(t)};return t.filter(it).map(e=>N` + ${i(e)}
+ `)}sortSchedules(e){var t;const i=dt(null===(t=this.config)||void 0===t?void 0:t.sort_by);if(i.includes("relative-time")&&(e=(e=>{const t=[...e];return t.sort((e,t)=>{const i=ha(e),s=ha(t),a=(new Date).valueOf(),o=i=a?1:i>=a&&ss?o?-1:1:i{const i=[...e];return i.sort((e,i)=>at(t[e.schedule_id].primaryInfo.join(""),t[i.schedule_id].primaryInfo.join(""))),i})(e,this.scheduleDisplayInfo)),i.includes("state")){const t=i.includes("relative-time");e=((e,t,i)=>{const s=[...e];return s.sort((e,s)=>{var a,o;const n=null===(a=t.states[e.entity_id])||void 0===a?void 0:a.state,r=null===(o=t.states[s.entity_id])||void 0===o?void 0:o.state,l=["on","triggered"].includes(n),c=["on","triggered"].includes(r);if(l&&!c)return-1;if(!l&&c)return 1;if(i){if("off"!=n&&"off"==r)return 1;if("off"==n&&"off"!=r)return-1}return 0}),s})(e,this.hass,t)}return e}toggleDisabled(e,t){if(!this.hass||!t)return;e.stopPropagation();const i=!e.target.checked;this.hass.callService("switch",i?"turn_on":"turn_off",{entity_id:t})}toggleDisableAll(e){if(!this.hass||!this.schedules)return;const t=e.target.checked;this.schedules.filter(e=>this.showDiscovered?pa(e,this.config):ma(e,this.config)).forEach(e=>{this.hass.callService("switch",t?"turn_on":"turn_off",{entity_id:e.entity_id})})}computeHeaderToggleState(){if(!this.schedules)return!1;return this.schedules.filter(e=>this.showDiscovered?pa(e,this.config):ma(e,this.config)).some(e=>{var t;return["on","triggered"].includes((null===(t=this.hass.states[e.entity_id])||void 0===t?void 0:t.state)||"")})}editItemClick(e){const t=new CustomEvent("editClick",{detail:e});this.dispatchEvent(t)}newItemClick(){const e=new CustomEvent("newClick");this.dispatchEvent(e)}};va.styles=r` + ${ts} + hui-warning { + padding: 10px 0px; } - function weekdayType(weekday) { - if (weekday.includes('daily')) - return EDayType.Daily; - if (weekday.includes('workday')) - return EDayType.Workday; - if (weekday.includes('weekend')) - return EDayType.Weekend; - return EDayType.Custom; + button.show-more { + color: var(--primary-color); + text-align: left; + cursor: pointer; + background: none; + border-width: initial; + border-style: none; + border-color: initial; + border-image: initial; + font: inherit; + } + button.show-more:focus { + outline: none; + text-decoration: underline; } - const computeDaysDisplay = (weekdays, hass) => { - function findSequence(list) { - const len = []; - for (let i = 0; i < list.length - 1; i++) { - let j = i + 1; - while (list[j] - list[j - 1] == 1) - j++; - len.push(j - i); - } - return len; - } - if (!hass) - return ''; - switch (weekdayType(weekdays)) { - case EDayType.Daily: - return localize('ui.components.date.day_types_long.daily', getLocale(hass)); - case EDayType.Workday: - return localize('ui.components.date.day_types_long.workdays', getLocale(hass)); - case EDayType.Weekend: - return localize('ui.components.date.day_types_long.weekend', getLocale(hass)); - case EDayType.Custom: - const list = weekdayToList(weekdays); - const seq = findSequence(list); - const len = Math.max(...seq); - if (list.length == 6) { - const missing = [1, 2, 3, 4, 5, 6, 7].filter(e => !list.includes(e)); - return localize('ui.components.date.repeated_days_except', getLocale(hass), '{excludedDays}', formatWeekday(missing.pop(), getLocale(hass))); - } - const dayNames = list.map(e => formatWeekday(e, getLocale(hass))); - if (list.length >= 3 && len >= 3) { - const start = seq.reduce((obj, e, i) => (e == len ? i : obj), 0); - dayNames.splice(start, len, localize('ui.components.date.days_range', getLocale(hass), ['{startDay}', '{endDay}'], [dayNames[start], dayNames[start + len - 1]])); - } - const daysString = dayNames.length > 1 - ? `${dayNames.slice(0, -1).join(', ')} ${hass.localize('ui.common.and')} ${dayNames.pop()}` - : `${dayNames.pop()}`; - return localize('ui.components.date.repeated_days', getLocale(hass), '{days}', daysString); - default: - return ''; - } - }; + div.schedule-row { + display: flex; + align-items: center; + flex-direction: row; + cursor: pointer; + margin: 20px 0px; + } + div.schedule-row .info { + margin-left: 16px; + flex: 1 0 60px; + } + div.schedule-row .info, + div.schedule-row .info > * { + color: var(--primary-text-color); + transition: color 0.2s ease-in-out; + } + div.schedule-row .secondary { + display: block; + color: var(--secondary-text-color); + transition: color 0.2s ease-in-out; + } + div.schedule-row ha-icon { + flex: 0 0 40px; + color: var(--state-icon-color); + transition: color 0.2s ease-in-out; + } + div.schedule-row ha-switch { + padding: 13px 5px; + } + div.schedule-row hui-warning { + flex: 1 0 40px; + } + div.schedule-row span.filter-tag { + background: rgba(var(--rgb-primary-color), 0.54); + color: var(--primary-text-color); + height: 24px; + border-radius: 12px; + font-size: 12px; + font-weight: 500; + line-height: 18px; + padding: 0px 10px; + display: inline-flex; + align-items: center; + box-sizing: border-box; + margin: 4px 2px 0px 2px; + transition: color 0.2s ease-in-out, background 0.2s ease-in-out; + } + div.schedule-row.disabled { + --primary-text-color: var(--disabled-text-color); + --secondary-text-color: var(--disabled-text-color); + --state-icon-color: var(--disabled-text-color); + } + div.schedule-row span.filter-tag { + background: rgba(var(--rgb-primary-color), 0.3); + } + `,t([ae()],va.prototype,"config",void 0),t([ae()],va.prototype,"showDiscovered",void 0),t([ae()],va.prototype,"schedules",void 0),va=t([ie("scheduler-entities-card")],va);var ga="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",fa="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";const ya={alarm_control_panel:"domains.alarm_control_panel",automation:"ui.dialogs.quick-bar.commands.navigation.automation",binary_sensor:"domains.binary_sensor",calendar:"panel.calendar",climate:"domains.climate",cover:"domains.cover",fan:"domains.fan",group:"domains.group",humidifier:"domains.humidifier",input_boolean:"domains.input_boolean",input_number:"domains.input_number",input_select:"domains.input_select",light:"domains.light",lock:"domains.lock",media_player:"domains.media_player",notify:"domains.notify",person:"ui.dialogs.quick-bar.commands.navigation.person",scene:"ui.dialogs.quick-bar.commands.navigation.scene",script:"ui.dialogs.quick-bar.commands.navigation.script",sensor:"ui.panel.config.devices.entities.sensor",sun:"ui.panel.config.automation.editor.conditions.type.sun.label",switch:"domains.switch",vacuum:"domains.vacuum",water_heater:"domains.water_heater"},ba=(e,t)=>{if(e in ya){const i=ya[e],s=i.startsWith("domains")?es(i,ct(t)):t.localize(i);if(s)return s}return e};function wa(e,t,i){let s=[];t.groups&&t.groups.forEach(t=>{e.find(e=>ls(e,t))&&(s=[...s,{name:t.name,icon:t.icon||"folder-outline",entities:e.filter(e=>ls(e,t))}])});const a=e.filter(e=>!s.some(t=>t.entities.includes(e)));return a.map(Ae).filter((e,t,i)=>i.indexOf(e)===t).forEach(e=>{s=[...s,{name:ba(e,i),icon:(void 0===t.standard_configuration||t.standard_configuration)&&e in cs?cs[e]:"folder-outline",entities:a.filter(t=>ls(t,{include:[e],exclude:[]}))}]}),s}const ka={options:["on","off"]},xa={alarm_control_panel:{template:e=>{let t=["disarmed","triggered"];const i=hs(e,"supported_features")||0;return 2&i&&(t=[...t,"armed_away"]),1&i&&(t=[...t,"armed_home"]),4&i&&(t=[...t,"armed_night"]),16&i&&(t=[...t,"armed_custom_bypass"]),{options:t}}},binary_sensor:ka,climate:{options:"hvac_modes"},calendar:ka,cover:{options:["open","closed"]},device_tracker:{options:["home","not_home"]},fan:ka,humidifier:ka,input_boolean:ka,input_number:{min:"min",max:"max",unit:"unit_of_measurement",step:"step"},input_select:{options:"options"},light:ka,lock:{options:["locked","unlocked"]},number:{min:"min",max:"max",step:"step"},person:{template:(e,t)=>{let i=Object.keys(t.states).filter(e=>"zone"==Ae(e)).map(De);return{options:[...new Set(["home","not_home",...i])]}}},proximity:{unit:"unit_of_measurement"},select:{options:"options"},sensor:{template:e=>e&&!isNaN(Number(e.state))?"%"==ps(e,"unit_of_measurement")?{min:0,max:100,unit:"%",step:1}:{unit:"unit_of_measurement"}:{}},sun:{options:["below_horizon","above_horizon"]},switch:ka,water_heater:{options:"operation_list"}},$a=(e,t)=>Be(Object.assign(Object.assign({},e),{state:t})),ja=(e,t)=>{const i="closed"==t;switch(e.attributes.device_class){case"garage":return i?"mdi:garage":"mdi:garage-open";case"door":return i?"mdi:door-closed":"mdi:door-open";case"blind":return i?"mdi:blinds":"mdi:blinds-open";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:window-shutter":"mdi:window-shutter-open"}},Oa={alarm_control_panel:{disarmed:"mdi:lock-open-variant-outline",armed_away:"mdi:exit-run",armed_home:"mdi:home-outline",armed_night:"mdi:power-sleep",triggered:"mdi:alarm-light-outline"},binary_sensor:{on:$a,off:$a},calendar:{on:"mdi:flash",off:"mdi:flash-off"},climate:{off:"mdi:power-off",heat:"mdi:fire",cool:"mdi:snowflake",heat_cool:"mdi:thermometer",auto:"mdi:autorenew",dry:"mdi:water-percent",fan_only:"mdi:fan"},cover:{closed:ja,open:ja},device_tracker:{home:"mdi:home-outline",not_home:"mdi:exit-run"},fan:{on:"mdi:power",off:"mdi:power-off"},humidifier:{on:"mdi:power",off:"mdi:power-off"},input_boolean:{on:"mdi:flash",off:"mdi:flash-off"},light:{on:"mdi:lightbulb",off:"mdi:lightbulb-off"},lock:{unlocked:"mdi:lock-outline",locked:"mdi:lock-open-variant-outline"},person:(e,t,i)=>{let s={home:"mdi:home-outline",not_home:"mdi:exit-run"};return Object.keys(i.states).filter(e=>"zone"==Ae(e)).forEach(e=>{const t=De(e),a=i.states[e].attributes.icon;a&&(s[t]=a)}),t in s?s[t]:"mdi:flash"},sensor:{unit:"attributes.unit_of_measurement"},sun:{below_horizon:"mdi:weather-sunny-off",above_horizon:"mdi:weather-sunny"},switch:{on:"mdi:flash",off:"mdi:flash-off"}},Sa=(e,t,i,s)=>{const a=Ae(e.entity_id);if(t||(t=e.state),a in Oa){if(t in Oa[a]){const s=Oa[a][t];return"string"==typeof s?s:s(e,t,i)}if("function"==typeof Oa[a])return Oa[a](e,t,i)}return s||"folder-outline"};function za(e,t){const i=Ae(e),s=t.states[e];if(!s)return null;if("group"==i){const i=t.states[e],s=ms(i,"entity_id");if(!s.length)return null;const o=s.map(e=>za(e,t));return o.every(it)?(a=o).length&&a.every(e=>e.type==a[0].type)?a[0].type==Ie.List?xs(...a):a[0].type==Ie.Level?fs(...a):null:null:null}var a;if(!Object.keys(xa).includes(i))return null;let o=_s(xa[i],s,t);if("options"in o&&it(o.options)){let e=[...o.options];return e=e.map(e=>Object.assign(e,{icon:e.icon?e.icon:Sa(s,e.value,t,"flash"),name:e.name?e.name:Ea(s,e.value,t)})),o=Object.assign(Object.assign({},o),{options:e}),e.length?xs(o):null}return"min"in o&&it(o.min)&&"max"in o&&it(o.max)?fs(o):js(o)}const Ea=(e,t,i)=>{const s=Ae(e.entity_id);return e.attributes.device_class&&i.localize(`component.${s}.state.${e.attributes.device_class}.${t}`)||i.localize(`component.${s}.state._.${t}`)||t};function Ca(e,t,i){let s=i.standard_configuration?za(e,t):null;const a=Object.entries(i.customize).filter(([t])=>rs(t,e)).sort((e,t)=>t[0].length-e[0].length).map(([,e])=>e.states).filter(it);return a.length&&a.forEach(e=>{s=Array.isArray(e)?xs({options:e.map(e=>Object({value:e}))}):fs(e)}),s}function Aa(e,t,i={filterActions:!0,filterStates:!1}){let s=Object.keys(e.states).filter(e=>ls(e,t));return"notify"in e.services&&(s=[...s,...Object.keys(e.services.notify).map(e=>"notify."+e).filter(e=>ls(e,t))]),i.filterActions&&i.filterStates?s=s.filter(i=>Ys(i,e,t).length||Ca(i,e,t)):i.filterActions?s=s.filter(i=>Ys(i,e,t).length):i.filterStates&&(s=s.filter(i=>Ca(i,e,t))),s}function Da(e,t){return e.id||e.value||t}let Ma=class extends ee{constructor(){super(...arguments),this.items=[],this.value=null}render(){return this.items.length?this.items.map((e,t)=>this.renderButton(e,t)):N` +
+ +
+ `}renderButton(e,t){const i=Array.isArray(this.value)?this.value:[this.value],s=Da(e,t);return N` + this.selectItem(s)} + > + ${e.icon?N` + + `:""} + ${nt(function(e){var t;return(null===(t=e.name)||void 0===t?void 0:t.trim())||e.value||e.id||""}(e))} + + `}selectItem(e){if(Array.isArray(this.value))if(this.multiple){let t=Array.isArray(this.value)?[...this.value]:[];if(t.includes(e)){if(void 0!==this.min&&t.length<=this.min)return;t=t.filter(t=>t!=e)}else t.push(e);this.value=t}else this.value=this.value.includes(e)?[]:Array(e);else if(e==this.value){if(!this.optional)return;this.value=null}else this.value=e;const t=Array.isArray(this.value)?this.value.map(e=>this.items.find((t,i)=>Da(t,i)==e)):null!==this.value?this.items.find((e,t)=>Da(e,t)==this.value):null,i=new CustomEvent("change",{detail:t});this.dispatchEvent(i)}};Ma.styles=ts,t([ae({type:Array})],Ma.prototype,"items",void 0),t([ae()],Ma.prototype,"value",void 0),t([ae({type:Number})],Ma.prototype,"min",void 0),t([ae({type:Boolean})],Ma.prototype,"optional",void 0),t([ae({type:Boolean})],Ma.prototype,"multiple",void 0),Ma=t([ie("button-group")],Ma);let Ta=class extends ee{constructor(){super(...arguments),this.selectedEntities=[],this.multipleEntity=!1,this.scheduleEntities=[],this.timeSchemeSelected=!1}async firstUpdated(){if(this.scheduleEntities=(await ss(this.hass)).map(e=>e.entity_id),this.entities&&this.entities.length){const e=this.getGroups().find(e=>e.entities.find(e=>e==this.entities[0].id));if(!e)return;this.selectedGroup=e,this.selectedEntities=[...this.entities.map(e=>e.id)],this.multipleEntity=this.selectedEntities.length>1}if(this.schedule)if(this.schedule.timeslots.every(e=>e.stop))this.timeSchemeSelected=!0;else{const e=tt(et(this.schedule.timeslots.map(e=>e.actions))),t=this.getActionsForEntity().filter(t=>e.some(e=>us(e,t,!0)));1==t.length&&(this.selectedAction=t[0])}}getGroups(){if(!this.hass||!this.config)return[];const e=wa(Aa(this.hass,this.config).filter(e=>"switch"!==Ae(e)||!this.scheduleEntities.includes(e)),this.config,this.hass);return e.sort(at),e}getEntitiesForGroup(){if(!this.selectedGroup||!this.hass||!this.config)return[];const e=this.selectedGroup.entities.map(e=>Gs(e,this.hass,this.config));return e.sort(at),e}getActionsForEntity(){if(!this.hass||!this.config||!this.selectedEntities.length)return[];const e=Ys(this.selectedEntities,this.hass,this.config).map(e=>Object.assign(e,{name:Bs(e)}));return e.sort(at),e}render(){if(!this.hass||!this.config)return N``;const e=this.getGroups();1!=e.length||st(this.selectedGroup,e[0])||this.selectGroup(e[0]);const t=this.getEntitiesForGroup();1==t.length&&this.selectedEntities[0]!==t[0].id&&this.selectEntity(t[0].id);const i=this.getActionsForEntity();return N` + +
+
+ ${this.config.title?"string"==typeof this.config.title?this.config.title:es("ui.panel.common.title",ct(this.hass)):""} +
+ +
+
+
${this.hass.localize("ui.panel.config.users.editor.group")}
+ st(e,this.selectedGroup))} + @change=${e=>this.selectGroup(e.detail)} + > + ${es("ui.panel.entity_picker.no_groups_defined",ct(this.hass))} + + +
+ ${this.hass.localize("ui.components.entity.entity-picker.entity")} + ${t.length>1?N` +
+ {this.multipleEntity=e.target.checked}} + > + + ${es("ui.panel.entity_picker.multiple",ct(this.hass))} +
+ `:""} +
+ this.selectEntity(e.target.value)} + ?multiple=${this.multipleEntity} + ?optional=${!0} + > + ${this.selectedGroup?es("ui.panel.entity_picker.no_entities_for_group",ct(this.hass)):es("ui.panel.entity_picker.no_group_selected",ct(this.hass))} + + +
${this.hass.localize("ui.panel.config.automation.editor.actions.name")}
+ st(e,this.selectedAction))} + @change=${e=>this.selectAction(e.detail)} + > + ${this.selectedEntities.length?es("ui.panel.entity_picker.no_actions_for_entity",ct(this.hass)):es("ui.panel.entity_picker.no_entity_selected",ct(this.hass))} + + ${this.makeSchemeButton(i)} +
+
+ ${this.hass.localize("ui.common.next")} +
+
+ `}makeSchemeButton(e){return e.length&&this.hass?N` +
${this.hass.localize("ui.panel.config.automation.editor.conditions.type.or.label")}
+
+ this.selectTimeScheme()}> + + ${es("ui.panel.entity_picker.make_scheme",ct(this.hass))} + +
+ + `:N``}selectGroup(e){this.selectedGroup=e,this.selectedEntities=[],this.selectedAction=void 0}selectEntity(e){if(this.selectedEntities=Array.isArray(e)?e:[e],this.selectedAction){const e=this.getActionsForEntity();this.selectedAction=e.find(e=>us(e,this.selectedAction))}else this.selectedAction=void 0}selectAction(e){this.selectedAction=e,this.timeSchemeSelected=!1}selectTimeScheme(){this.selectedAction=null,this.timeSchemeSelected=!0}cancelClick(){const e=new CustomEvent("cancelClick");this.dispatchEvent(e)}nextClick(){const e=new CustomEvent("nextClick",{detail:{entities:this.selectedEntities,action:this.selectedAction,timeSchemeSelected:this.timeSchemeSelected}});this.dispatchEvent(e)}};Ta.styles=ts,t([ae()],Ta.prototype,"hass",void 0),t([ae()],Ta.prototype,"config",void 0),t([ae()],Ta.prototype,"selectedGroup",void 0),t([ae()],Ta.prototype,"selectedEntities",void 0),t([ae()],Ta.prototype,"selectedAction",void 0),t([ae()],Ta.prototype,"entities",void 0),t([ae()],Ta.prototype,"schedule",void 0),t([ae()],Ta.prototype,"multipleEntity",void 0),t([ae()],Ta.prototype,"scheduleEntities",void 0),t([ae()],Ta.prototype,"timeSchemeSelected",void 0),Ta=t([ie("scheduler-editor-card")],Ta);let Na=class extends ee{constructor(){super(...arguments),this.stepSize=10,this.relativeMode=!1,this.event=Re.Sunrise,this.maxOffset=2}get time(){return this._time>=0?this._time:Math.abs(this._time)}set time(e){const t=Ke(e,this.stepSize,{wrapAround:!this.relativeMode,maxHours:this.relativeMode?this.maxOffset:void 0}),i=t!=this._time&&it(this._time);this._time=t,i&&this.updateValue()}firstUpdated(){const e=Je(this.value);e?(this.relativeMode=!0,this.event=e.event==Re.Sunrise?Re.Sunrise:Re.Sunset,this.time="+"==e.sign?Ge(e.offset,this.hass):-Ge(e.offset,this.hass)):this.time=Ge(this.value,this.hass)}updateValue(){if(this.relativeMode){const e=this._time>=0?"+":"-",t=Ze(this.time);this.value=`${this.event}${e}${t}`}else this.value=Ze(this.time);const e=new CustomEvent("change");this.dispatchEvent(e)}render(){const e=(this.relativeMode?Ze(this.time):ea(ta(Ze(this.time)),ct(this.hass))).split(/:|\ /);return N` +
+
+ this.time=this._time+3600}> + + +
+
${e[0].padStart(2,"0")}
+
+ this.time=this._time-3600}> + + +
+
:
+
+ this.time=this._time+60*this.stepSize}> + + +
+
${e[1]}
+
+ this.time=this._time-60*this.stepSize}> + + +
+ ${this.relativeMode?N` +
+ + ${this.getBeforeAfter()} + + + + +
+ `:e.length>2?N` +
+ + ${e[2]} + +
+ `:""} +
+ ${this.getSunModeToggle()} +
+
+ `}getSunModeToggle(){return this.hass&&this.hass.states["sun.sun"]?N` + + + + `:N``}getBeforeAfter(){return this.hass?this._time<0?this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.before").trim():this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.after").trim():""}toggleAmPm(){this.time=this._time+43200}toggleBeforeAfter(){this.time=-this._time,this.updateValue()}toggleSunriseSunset(){this.event=this.event==Re.Sunrise?Re.Sunset:Re.Sunrise,this.updateValue()}toggleMode(){if(!this.hass)return;this.relativeMode=!this.relativeMode;const e=this.hass.states["sun.sun"],t=Ge(e.attributes.next_rising,this.hass),i=Ge(e.attributes.next_setting,this.hass);if(this.relativeMode){this.event=Math.abs(this._time-t)7200?e=7200:e<-7200&&(e=-7200),this.time=e}else this.time=this.event==Re.Sunrise?this._time+t:this._time+i}};Na.styles=r` + div.time-picker { + display: grid; + grid-template-columns: min-content min-content min-content 1fr min-content; + grid-template-rows: min-content min-content min-content; + grid-template-areas: + 'hours-up . minutes-up suffix options' + 'hours separator minutes suffix options' + 'hours-down . minutes-down suffix options'; + grid-gap: 10px 0px; + align-items: center; + } - var TimeFormat; - (function (TimeFormat) { - TimeFormat["language"] = "language"; - TimeFormat["system"] = "system"; - TimeFormat["am_pm"] = "12"; - TimeFormat["twenty_four"] = "24"; - })(TimeFormat || (TimeFormat = {})); - const formatAmPm = (locale) => { - if (locale.time_format === TimeFormat.language || locale.time_format === TimeFormat.system) { - const testLanguage = locale.time_format === TimeFormat.language ? locale.language : undefined; - const test = new Date().toLocaleString(testLanguage); - return test.includes('AM') || test.includes('PM'); - } - return locale.time_format === TimeFormat.am_pm; - }; - function formatTime(dateObj, locale, formatOption) { - const supportLocaleString = () => { - try { - new Date().toLocaleTimeString('i'); - } - catch (e) { - return e.name === 'RangeError'; - } - return false; - }; - if (formatOption === TimeFormat.am_pm || (!formatOption && locale.time_format === TimeFormat.am_pm)) { - return format(dateObj, 'h:mm A'); // '5:30 AM' - } - if (formatOption === TimeFormat.twenty_four || (!formatOption && locale.time_format === TimeFormat.twenty_four)) { - return format(dateObj, 'shortTime'); // '05:30' - } - if (supportLocaleString()) { - return dateObj.toLocaleTimeString(locale.language, { - hour: 'numeric', - minute: '2-digit', - hour12: formatAmPm(locale), - }); - } - return formatAmPm(locale) - ? formatTime(dateObj, locale, TimeFormat.am_pm) - : formatTime(dateObj, locale, TimeFormat.twenty_four); + div.hours-up { + grid-area: hours-up; + } + div.hours { + grid-area: hours; + } + div.hours-down { + grid-area: hours-down; + } + div.separator { + grid-area: separator; + } + div.minutes-up { + grid-area: minutes-up; + } + div.minutes { + grid-area: minutes; + } + div.minutes-down { + grid-area: minutes-down; + } + div.suffix { + grid-area: suffix; + flex-grow: 1; + } + div.options { + grid-area: options; } - function stringToDate(dateTimeString) { - let date = new Date(); - const dateMatch = (dateTimeString || '').match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})/); - if (dateMatch !== null) - date.setFullYear(Number(dateMatch[1]), Number(dateMatch[2]) - 1, Number(dateMatch[3])); - const timeMatch = (dateTimeString || '').match(/([0-9]{2}):([0-9]{2})(:([0-9]{2}))?$/); - if (timeMatch !== null) - date.setHours(Number(timeMatch[1]), Number(timeMatch[2]), timeMatch.length > 4 ? Number(timeMatch[4]) : date.getSeconds()); - return date; + div.hours-up, + div.hours-down, + div.minutes-up, + div.minutes-down { + --mdc-icon-size: 42px; } - const computeTimeDisplay = (entry, hass) => { - const computeRelativeTimeString = (timeString) => { - const res = parseRelativeTime(timeString); - if (!res) - return timeString; - const eventString = res.event == ETimeEvent.Sunrise - ? hass.localize('ui.panel.config.automation.editor.conditions.type.sun.sunrise').toLowerCase() - : hass.localize('ui.panel.config.automation.editor.conditions.type.sun.sunset').toLowerCase(); - if (Math.abs(stringToTime(res.offset, hass)) < 5 * 60) - return localize('ui.components.time.at_sun_event', getLocale(hass), '{sunEvent}', eventString); - const signString = res.sign == '-' - ? hass - .localize('ui.panel.config.automation.editor.conditions.type.sun.before') - .slice(0, -1) - .toLowerCase() - : hass - .localize('ui.panel.config.automation.editor.conditions.type.sun.after') - .slice(0, -1) - .toLowerCase(); - const timeStr = formatTime(stringToDate(res.offset), getLocale(hass), f$1.twenty_four); - return `${timeStr} ${signString} ${eventString}`; - }; - if (!entry.stop) { - const timeString = entry.start; - if (parseRelativeTime(timeString)) - return computeRelativeTimeString(timeString); - else { - const time = stringToDate(timeString); - return localize('ui.components.time.absolute', getLocale(hass), '{time}', formatTime(time, getLocale(hass))); - } - } - else { - const start = parseRelativeTime(entry.start) - ? computeRelativeTimeString(entry.start) - : formatTime(stringToDate(entry.start), getLocale(hass)); - const end = parseRelativeTime(entry.stop) - ? computeRelativeTimeString(entry.stop) - : formatTime(stringToDate(entry.stop), getLocale(hass)); - return localize('ui.components.time.interval', getLocale(hass), ['{startTime}', '{endTime}'], [start, end]); - } - }; + div.hours, + div.minutes { + font-size: 42px; + text-align: center; + } - const computeScheduleHeader = (schedule, config, hass) => { - const primaryInfo = AsArray(!config.display_options || !config.display_options.primary_info - ? '{entity}: {action}' - : config.display_options.primary_info); - return primaryInfo.map(e => computeItemDisplay(e, schedule, config, hass)); - }; - const computeScheduleInfo = (schedule, config, hass) => { - const primaryInfo = AsArray(!config.display_options || !config.display_options.secondary_info - ? ['relative-time', 'additional-tasks'] - : config.display_options.secondary_info); - return primaryInfo.map(e => computeItemDisplay(e, schedule, config, hass)); - }; - const computeScheduleIcon = (schedule, config, hass) => { - if (config.display_options && config.display_options.icon && config.display_options.icon == 'entity') { - const entities = computeEntities(schedule, config, hass); - return unique(entities.map(e => e.icon)).length == 1 ? entities[0].icon : standardIcon(entities[0].id, hass); - } - else { - const action = computeAction(schedule, config, hass); - return action.icon; - } - }; - const computeItemDisplay = (displayItem, schedule, config, hass) => { - switch (displayItem) { - case 'default': - return (computeItemDisplay('name', schedule, config, hass) || - `${computeItemDisplay('entity', schedule, config, hass)}: ${computeItemDisplay('action', schedule, config, hass)}`); - case 'name': - return schedule.name || ''; - case 'relative-time': - return ``; - case 'additional-tasks': - return schedule.timeslots.length > 1 - ? '+' + - localize('ui.panel.overview.additional_tasks', getLocale(hass), '{number}', String(schedule.timeslots.length - 1)) - : ''; - case 'time': - return capitalize(computeTimeDisplay(schedule.timeslots[schedule.next_entries[0]], hass)); - case 'days': - return capitalize(computeDaysDisplay(schedule.weekdays, hass)); - case 'entity': - const entities = computeEntities(schedule, config, hass); - const entityDomains = unique(entities.map(e => g$1(e.id))); - return entities.length == 1 - ? capitalize(PrettyPrintName(entities[0].name || '')) - : entityDomains.length == 1 - ? `${entities.length}x ${localize(`domains.${entityDomains[0]}`, getLocale(hass)) || entityDomains[0]}` - : `${entities.length}x entities`; - case 'action': - const action = computeAction(schedule, config, hass); - return capitalize(computeActionDisplay(action)); - case 'tags': - return (schedule.tags || []).map(e => `${e}`).join(''); - default: - const regex = /\{([^\}]+)\}/; - let res; - while ((res = regex.exec(displayItem))) { - displayItem = displayItem.replace(res[0], String(computeItemDisplay(String(res[1]), schedule, config, hass))); - } - return displayItem; - } - }; - const computeAction = (schedule, config, hass) => { - const nextEntry = schedule.timeslots[schedule.next_entries[0]]; - const match = computeActions(nextEntry.actions[0].entity_id || nextEntry.actions[0].service, hass, config) - .filter(e => compareActions(e, nextEntry.actions[0], true)) - .reduce((_acc, e) => e, undefined); - return match - ? Object.assign(Object.assign({}, match), { service_data: Object.assign(Object.assign({}, match.service_data), Object.entries(nextEntry.actions[0].service_data || {}) - .filter(([k]) => Object.keys(match.variables || {}).includes(k)) - .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {})) }) : importAction(nextEntry.actions[0], hass); - }; - const computeEntities = (schedule, config, hass) => { - const nextEntry = schedule.timeslots[schedule.next_entries[0]]; - const entities = unique(nextEntry.actions.map(e => e.entity_id || e.service)).map(e => parseEntity(e, hass, config)); - return entities; - }; + div.separator { + font-size: 36px; + } - function formatDate(dateObj, locale, isoFormat) { - const isCurrentYear = dateObj.getFullYear() == new Date().getFullYear(); - const supportLocaleDateString = () => { - try { - new Date().toLocaleDateString('i'); - } - catch (e) { - return e.name === 'RangeError'; - } - return false; - }; - if (isoFormat) - return format(dateObj, 'isoDate'); - if (isCurrentYear) { - if (supportLocaleDateString()) { - return new Intl.DateTimeFormat(locale.language, { - month: 'long', - day: 'numeric', - }).format(dateObj); - } - else - return format(dateObj, 'MMMM D'); - } - else { - if (supportLocaleDateString()) { - return new Intl.DateTimeFormat(locale.language, { - year: 'numeric', - month: 'long', - day: 'numeric', - }).format(dateObj); - } - else - return format(dateObj, 'MMMM D, YYYY'); - } + div.suffix mwc-button { + --mdc-typography-button-font-size: 16px; + --mdc-icon-size: 32px; } - var __assign = (window && window.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - var MS_PER_SECOND = 1e3; - var SECS_PER_MIN = 60; - var SECS_PER_HOUR = SECS_PER_MIN * 60; - var SECS_PER_DAY = SECS_PER_HOUR * 24; - var SECS_PER_WEEK = SECS_PER_DAY * 7; - function selectUnit(from, to, thresholds) { - if (to === void 0) { to = Date.now(); } - if (thresholds === void 0) { thresholds = {}; } - var resolvedThresholds = __assign(__assign({}, DEFAULT_THRESHOLDS), (thresholds || {})); - var secs = (+from - +to) / MS_PER_SECOND; - if (Math.abs(secs) < resolvedThresholds.second) { - return { - value: Math.round(secs), - unit: 'second', - }; - } - var mins = secs / SECS_PER_MIN; - if (Math.abs(mins) < resolvedThresholds.minute) { - return { - value: Math.round(mins), - unit: 'minute', - }; - } - var hours = secs / SECS_PER_HOUR; - if (Math.abs(hours) < resolvedThresholds.hour) { - return { - value: Math.round(hours), - unit: 'hour', - }; - } - var days = secs / SECS_PER_DAY; - if (Math.abs(days) < resolvedThresholds.day) { - return { - value: Math.round(days), - unit: 'day', - }; - } - var fromDate = new Date(from); - var toDate = new Date(to); - var years = fromDate.getFullYear() - toDate.getFullYear(); - if (Math.round(Math.abs(years)) > 0) { - return { - value: Math.round(years), - unit: 'year', - }; + mwc-button.active { + background: var(--primary-color); + --mdc-theme-primary: var(--text-primary-color); + border-radius: 4px; + } + `,t([ae()],Na.prototype,"hass",void 0),t([ae({type:Number})],Na.prototype,"stepSize",void 0),t([ae()],Na.prototype,"relativeMode",void 0),t([ae()],Na.prototype,"event",void 0),t([ae()],Na.prototype,"_time",void 0),Na=t([ie("time-picker")],Na);const La=(e,t,i,s={})=>{if(Je(e))return e;const a=Ge(e,i),o=i.states["sun.sun"],n=Ge(o.attributes.next_rising,i),r=Ge(o.attributes.next_setting,i);t||(t=Math.abs(a-n)0?"+":"-"}${Ze(Math.abs(l))}`};let Ia=class extends ee{constructor(){super(...arguments),this.slots=[],this.actions=[],this.stepSize=10,this.isDragging=!1,this.currentTime=0,this.rangeMin=0,this.rangeMax=86400,this.activeSlot=null,this.activeMarker=null,this.previousSlot=null,this.timer=0,this.timeout=0,this.zoomFactor=1}firstUpdated(){window.addEventListener("resize",()=>{clearTimeout(this.timeout),this.timeout=window.setTimeout(()=>{this.requestUpdate()},50)})}render(){if(!this.hass)return N``;const e=parseFloat(getComputedStyle(this).getPropertyValue("width")),t=86400/(this.rangeMax-this.rangeMin)*e,i=-this.rangeMin/(this.rangeMax-this.rangeMin)*e;return N` +
+
+ ${this.renderSlots()} +
+
+
+
+ ${this.renderTimes()} +
+
+ =24} + > + + ${this.hass.localize("ui.dialogs.helper_settings.input_select.add")} + + + + ${this.hass.localize("ui.common.delete")} + + `}renderSlots(){const e=parseFloat(getComputedStyle(this).getPropertyValue("width")),t=86400/(this.rangeMax-this.rangeMin)*e;let i=-this.rangeMin/(this.rangeMax-this.rangeMin)*e;return this.slots.map((s,a)=>{const o=((Ge(s.stop,this.hass)||86400)-Ge(s.start,this.hass))/86400,n=this.computeActionDisplay(s)||"",r=5*(n||"").length+10,l=i<0&&i+o*t>0?5-i:15,c=i+o*t>e&&i + ${a>0&&(this.activeSlot===a||this.activeSlot===a-1)?N` +
+
+ + +
+
+ `:""} + ${a>0?this.renderTooltip(a):""} + + + ${n&&(d>r/3||d>50)&&d>30?n:""} + + + `})}renderTooltip(e){const t=Je(this.slots[e].start);return N` +
+
+ ${t?N` + + ${t.sign} + ${ea(ta(t.offset),ct(this.hass),Xs.twenty_four)} + `:ea(ta(this.slots[e].start),ct(this.hass))} +
+
+ `}renderTimes(){this._updateTooltips();const e=parseFloat(getComputedStyle(this).getPropertyValue("width")),t=[1,2,3,4,6,8,12],i=Qs(ct(this.hass))?55:40;let s=Math.ceil(24/(e/i));for(;!t.includes(s);)s++;return[0,...Array.from(Array(24/s-1).keys()).map(e=>(e+1)*s),24].map(e=>{const t=0==e||24==e,i=t?s/48*100:s/24*100;return N` +
+ ${t?"":ea(ta(Ze(3600*e)),ct(this.hass))} +
+ `})}computeActionDisplay(e){if(this.hass)return e.actions?tt(e.actions.map(e=>{const t=this.actions.find(t=>us(t,e,!0));return t?t.variables&&Object.keys(t.variables).some(t=>e.service_data&&t in e.service_data)?Object.entries(t.variables).filter(([t])=>e.service_data&&t in e.service_data).map(([t,i])=>{const s=e.service_data[t];if(i.type==Ie.Level)return i=i,ys(Number(s),i);if(i.type==Ie.List){const e=(i=i).options.find(e=>e.value==s);return nt(e&&e.name?e.name:String(s))}return""}).join(", "):nt(t.name||es("services."+e.service,ct(this.hass))||e.service):"???"})).join(", "):""}_handleTouchStart(e){const t=parseFloat(getComputedStyle(this).getPropertyValue("width")),i=86400/(this.rangeMax-this.rangeMin)*t,s=-(-this.rangeMin/(this.rangeMax-this.rangeMin)*t)/i*86400,a=e.target;let o=a;for(;!o.classList.contains("slot");)o=o.parentElement;const n=o,r=n.previousElementSibling,l=Number(r.getAttribute("slot")),c=l>0?Ge(this.slots[l].start,this.hass)+60*this.stepSize:0,d=l{let a;a="undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].pageX:e.pageX;let o=a-u.left;o>t-10&&(o=t-10),o<10&&(o=10);let n=Math.round(o/i*86400+s);nd&&(n=d),this.currentTime=n;const r=Je(this.slots[l].stop);let h;r?h=La(Ze(n),r.event,this.hass,{stepSize:this.stepSize}):(n=Math.round(n)>=86400?86400:Ke(n,this.stepSize),h=Ze(n)),h!=this.slots[l].stop&&(this.slots=Object.assign(this.slots,{[l]:Object.assign(Object.assign({},this.slots[l]),{stop:h}),[l+1]:Object.assign(Object.assign({},this.slots[l+1]),{start:h})}),this.requestUpdate())};const m=()=>{window.removeEventListener("mousemove",h),window.removeEventListener("touchmove",h),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),h=()=>{},setTimeout(()=>{this.isDragging=!1},100),a.blur();const e=new CustomEvent("update",{detail:{entries:this.slots}});this.dispatchEvent(e)};window.addEventListener("mouseup",m),window.addEventListener("touchend",m),window.addEventListener("blur",m),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h)}_selectSlot(e){if(this.isDragging)return;let t=e.target;"span"==t.tagName.toLowerCase()&&(t=t.parentElement),t.classList.contains("handle")&&(t=t.parentElement);const i=Number(t.getAttribute("slot"));this.activeSlot==i&&null===this.activeMarker?(this.activeSlot=null,this.previousSlot=null):(this.previousSlot=this.activeSlot,this.activeSlot=i),this.activeMarker=null,this._updateZoom();const s=new CustomEvent("update",{detail:{entry:this.activeSlot}});this.dispatchEvent(s)}_calculateZoom(){const e=Number(this.activeSlot);let t=Ge(this.slots[e].start,this.hass),i=Ge(this.slots[e].stop,this.hass)||86400;t-=(i-t)/3,i+=(i-t)/3,(i-t)/86400*parseFloat(getComputedStyle(this).getPropertyValue("width"))>=100?(t=0,i=86400):(t<0&&(i-=t),i>86400&&(t-=i-86400)),this.rangeMin=t>0?t:0,this.rangeMax=i<86400?i:86400,clearInterval(this.timer),clearTimeout(this.timeout),this.timer=window.setInterval(()=>{this._updateTooltips()},50),this.timeout=window.setTimeout(()=>{clearInterval(this.timer),this._updateTooltips()},230)}_addSlot(){if(null===this.activeSlot)return;const e=this.slots[this.activeSlot],t=Ge(e.start,this.hass);let i=Ge(e.stop,this.hass);i{const t=e.offsetWidth,i=e.parentElement.offsetLeft+e.offsetLeft-15;return e.parentElement.classList.contains("left")?[i+t/2,i+3*t/2]:e.parentElement.classList.contains("right")?[i-t/2,i+t/2]:[i,i+t]};null==i||i.forEach((e,a)=>{const o=e.parentElement,n=o.classList.contains("visible"),r=Number(o.parentElement.getAttribute("slot"));if(r!=this.activeSlot&&r-1!=this.activeSlot)n&&o.classList.remove("visible");else{const l=e.parentElement.offsetLeft;if(l<0||l>t+15)n&&o.classList.remove("visible");else{n||o.classList.add("visible");const l=o.offsetWidth,c=o.classList.contains("center");let d=s(e)[0],u=t-s(e)[1];if(a>0&&r-1==this.activeSlot)d-=s(i[a-1])[1];else if(a+1l/2&&(o.classList.add("right"),o.classList.remove("center"),o.classList.remove("left")):(o.classList.add("center"),o.classList.remove("right"),o.classList.remove("left")):u<0?c&&d>l/2&&(o.classList.add("left"),o.classList.remove("center"),o.classList.remove("right")):(o.classList.add("center"),o.classList.remove("left"),o.classList.remove("right"))}}})}_updateZoom(){clearInterval(this.timer),clearTimeout(this.timeout),this.timer=window.setInterval(()=>{this._updateTooltips()},50),this.timeout=window.setTimeout(()=>{clearInterval(this.timer),this._updateTooltips()},230)}_selectMarker(e,t=!0){e.stopImmediatePropagation();let i=e.target;for(;!i.classList.contains("slot");)i=i.parentElement;const s=Number(i.getAttribute("slot"));t&&this.activeMarker===s?this.activeMarker=null:this.activeMarker=t?s:null;const a=new CustomEvent("update",{detail:{entry:this.activeSlot,marker:this.activeMarker}});this.dispatchEvent(a),this._updateTooltips()}static get styles(){return r` + :host { + display: block; + max-width: 100%; + overflow: hidden; + } + div.outer { + width: 100%; + overflow-x: hidden; + overflow-y: hidden; + border-radius: 5px; + } + div.wrapper, + div.time-wrapper { + white-space: nowrap; + transition: width 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67), + margin 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67); + } + .slot { + float: left; + background: rgba(var(--rgb-primary-color), 0.7); + height: 60px; + cursor: pointer; + box-sizing: border-box; + transition: background 0.1s cubic-bezier(0.17, 0.67, 0.83, 0.67); + } + .wrapper.selectable .slot:hover { + background: rgba(var(--rgb-primary-color), 0.85); + } + .slot:not(:first-child) { + border-left: 1px solid var(--card-background-color); + } + .slot:not(:last-child) { + border-right: 1px solid var(--card-background-color); + } + .slot.active { + background: rgba(var(--rgb-accent-color), 0.7); + } + .slot.noborder { + border: none; + } + .wrapper.selectable .slot.active:hover { + background: rgba(var(--rgb-accent-color), 0.85); + } + div.time-wrapper div { + float: left; + display: flex; + position: relative; + height: 25px; + line-height: 25px; + font-size: 12px; + text-align: center; + align-content: center; + align-items: center; + justify-content: center; + } + div.time-wrapper div.time:before { + content: ' '; + background: var(--disabled-text-color); + position: absolute; + left: 0px; + top: 0px; + width: 1px; + height: 5px; + margin-left: 50%; + margin-top: 0px; + } + .slot span { + font-size: 14px; + color: var(--text-primary-color); + height: 100%; + display: flex; + align-content: center; + align-items: center; + justify-content: center; + transition: margin 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67); + word-break: break-all; + white-space: normal; + overflow: hidden; + line-height: 1em; + } + div.handle { + display: flex; + height: 100%; + width: 36px; + margin-left: -19px; + margin-bottom: -60px; + align-content: center; + align-items: center; + justify-content: center; + } + div.button-holder { + background: var(--card-background-color); + border-radius: 50%; + width: 24px; + height: 24px; + display: flex; + visibility: hidden; + animation: 0.2s fadeIn; + animation-fill-mode: forwards; + } + ha-icon-button { + --mdc-icon-button-size: 36px; + margin-top: -6px; + margin-left: -6px; + } + @keyframes fadeIn { + 99% { + visibility: hidden; } - var months = years * 12 + fromDate.getMonth() - toDate.getMonth(); - if (Math.round(Math.abs(months)) > 0) { - return { - value: Math.round(months), - unit: 'month', - }; + 100% { + visibility: visible; } - var weeks = secs / SECS_PER_WEEK; - return { - value: Math.round(weeks), - unit: 'week', - }; + } + div.tooltip-container { + position: absolute; + margin-top: -28px; + margin-left: -40px; + width: 80px; + height: 26px; + display: flex; + text-align: center; + display: none; + } + div.tooltip-container.visible { + display: block; + } + div.tooltip-container.left { + margin-left: -80px; + text-align: right; + } + div.tooltip-container.right { + margin-left: 0px; + text-align: left; + } + div.tooltip { + display: inline-flex; + margin: 0px auto; + border-radius: 5px; + color: var(--text-primary-color); + font-size: 1em; + padding: 0px 5px; + text-align: center; + line-height: 26px; + z-index: 1; + transition: all 0.1s ease-in; + transform-origin: center bottom; + --tooltip-color: var(--primary-color); + background: var(--tooltip-color); + } + div.tooltip.active { + --tooltip-color: rgba(var(--rgb-accent-color), 0.7); + } + div.tooltip-container.left div.tooltip { + transform-origin: right bottom; + } + div.tooltip-container.right div.tooltip { + transform-origin: left bottom; + } + div.tooltip-container.center div.tooltip:before { + content: ' '; + width: 0px; + height: 0px; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 10px solid var(--tooltip-color); + position: absolute; + margin-top: 25px; + margin-left: calc(50% - 6px); + top: 0px; + left: 0px; + } + div.tooltip-container.left div.tooltip:before { + content: ' '; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + border-right: 8px solid var(--tooltip-color); + opacity: 1; + position: absolute; + margin-top: 15px; + margin-left: calc(100% - 8px); + left: 0px; + top: 0px; + width: 0px; + height: 0px; + } + div.tooltip-container.right div.tooltip:before { + content: ' '; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + border-left: 8px solid var(--tooltip-color); + opacity: 1; + position: absolute; + margin-top: 15px; + margin-left: 0px; + left: 0px; + top: 0px; + width: 0px; + height: 0px; + } + div.tooltip ha-icon { + --mdc-icon-size: 20px; + } + mwc-button ha-icon { + margin-right: 11px; + } + `}};t([ae()],Ia.prototype,"hass",void 0),t([ae({type:Array})],Ia.prototype,"slots",void 0),t([ae({type:Array})],Ia.prototype,"actions",void 0),t([ae({type:Number})],Ia.prototype,"stepSize",void 0),t([ae()],Ia.prototype,"rangeMin",void 0),t([ae()],Ia.prototype,"rangeMax",void 0),t([ae()],Ia.prototype,"activeSlot",void 0),t([ae()],Ia.prototype,"activeMarker",void 0),t([function(e){return ne({finisher:(t,i)=>{Object.assign(t.prototype[i],e)}})} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */({passive:!0})],Ia.prototype,"_handleTouchStart",null),Ia=t([ie("timeslot-editor")],Ia);const Pa=async()=>{if(customElements.get("ha-checkbox")&&customElements.get("ha-slider"))return;await customElements.whenDefined("partial-panel-resolver");const e=document.createElement("partial-panel-resolver");e.hass={panels:[{url_path:"tmp",component_name:"config"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-panel-config");const t=document.createElement("ha-panel-config");await t.routerOptions.routes.automation.load()};let qa=class extends ee{constructor(){super(...arguments),this.min=0,this.max=255,this.step=1,this.scaleFactor=1,this.unit="",this.optional=!1,this.disabled=!1,this._displayedValue=0}set value(e){e=isNaN(e)?this.min:this._roundedValue(e/this.scaleFactor),this._displayedValue=e}firstUpdated(){(async()=>{await Pa()})(),this.disabled&&!this.optional&&(this.disabled=!1,this.requestUpdate())}render(){return N` +
+
+ ${this.getCheckbox()} +
+
+ ${this.getSlider()} +
+
+ ${this._displayedValue}${this.unit} +
+
+ `}getSlider(){return this.disabled?N` + + `:N` + + `}getCheckbox(){return this.optional?N` + + `:N``}toggleChecked(e){const t=e.target.checked;this.disabled=!t;const i=this.disabled?null:this._scaledValue(this._displayedValue);Me(this,"value-changed",{value:i})}_updateValue(e){let t=Number(e.target.value);this._displayedValue=t,t=this._scaledValue(this._displayedValue),Me(this,"value-changed",{value:t})}_roundedValue(e){return e=Math.round(e/this.step)*this.step,(e=parseFloat(e.toPrecision(12)))>this.max?e=this.max:e { - this.requestUpdate(); - }, updateInterval * 1000); - this.updateInterval = updateInterval; - } - set hass(hass) { - this._hass = hass; - this.startRefreshTimer(this.updateInterval); //restart - } - relativeTime(dateObj) { - if (!this._hass) - return ''; - const now = new Date(); - let delta = (now.getTime() - dateObj.getTime()) / 1000; - const tense = delta >= 0 ? 'past' : 'future'; - delta = Math.abs(delta); - const roundedDelta = Math.round(delta); - if (tense == 'future' && roundedDelta > 0) { - if (delta / secondsPerHour >= 6) { - const startOfToday = now.setHours(0, 0, 0, 0); - const daysFromNow = Math.floor((dateObj.valueOf() - startOfToday.valueOf()) / (hoursPerDay * secondsPerHour * 1000)); - let day = ''; - if (daysFromNow > 14) { - //October 12 - day = formatDate(dateObj, getLocale(this._hass)); - } - else if (daysFromNow > 7) { - //Next Friday - day = localize('ui.components.date.next_week_day', getLocale(this._hass), '{weekday}', formatWeekday(dateObj, getLocale(this._hass))); - } - else if (daysFromNow == 1) { - //Tomorrow - day = localize('ui.components.date.tomorrow', getLocale(this._hass)); - } - else if (daysFromNow > 0) { - //Friday - day = formatWeekday(dateObj, getLocale(this._hass)); - } - let time = localize('ui.components.time.absolute', getLocale(this._hass), '{time}', formatTime(dateObj, getLocale(this._hass))); - if (dateObj.getHours() == 12 && dateObj.getMinutes() == 0) { - time = localize('ui.components.time.at_noon', getLocale(this._hass)); - } - else if (dateObj.getHours() == 0 && dateObj.getMinutes() == 0) { - time = localize('ui.components.time.at_midnight', getLocale(this._hass)); - } - return String(day + ' ' + time).trim(); - } - else if (Math.round(delta / secondsPerMinute) > 60 && Math.round(delta / secondsPerMinute) < 120) { - // in 1 hour and 52 minutes - const mins = Math.round(delta / secondsPerMinute - 60); - const join = this._hass.localize('ui.common.and'); - // @ts-expect-error - const text1 = new Intl.RelativeTimeFormat(getLocale(this._hass).language, { numeric: 'auto' }).format(1, 'hour'); - const text2 = Intl.NumberFormat(getLocale(this._hass).language, { - style: 'unit', - // @ts-expect-error - unit: 'minute', - unitDisplay: 'long', - }).format(mins); - return `${text1} ${join} ${text2}`; - } - else if (Math.round(delta) > 60 && Math.round(delta) < 120) { - // in 1 minute and 52 seconds - const seconds = Math.round(delta - 60); - const join = this._hass.localize('ui.common.and'); - // @ts-expect-error - const text1 = new Intl.RelativeTimeFormat(getLocale(this._hass).language, { numeric: 'auto' }).format(1, 'minute'); - const text2 = Intl.NumberFormat(getLocale(this._hass).language, { - style: 'unit', - // @ts-expect-error - unit: 'second', - unitDisplay: 'long', - }).format(seconds); - return `${text1} ${join} ${text2}`; - } - } - // in 5 minutes/hours/seconds (or now) - const diff = selectUnit(dateObj); - // @ts-expect-error - return new Intl.RelativeTimeFormat(getLocale(this._hass).language, { numeric: 'auto' }).format(diff.value, diff.unit); - } - render() { - if (!this._hass || !this.datetime) - return T ``; - const now = new Date(); - const secondsRemaining = Math.round((this.datetime.valueOf() - now.valueOf()) / 1000); - let updateInterval = 60; - if (Math.abs(secondsRemaining) <= 150) - updateInterval = Math.max(Math.ceil(Math.abs(secondsRemaining)) / 10, 2); - if (this.updateInterval != updateInterval) - this.startRefreshTimer(updateInterval); - return T ` - ${capitalize(this.relativeTime(this.datetime))} - `; - } - }; - __decorate([ - e$3() - ], MyRelativeTime.prototype, "_hass", void 0); - __decorate([ - e$3() - ], MyRelativeTime.prototype, "datetime", void 0); - MyRelativeTime = __decorate([ - n$4('my-relative-time') - ], MyRelativeTime); - - const computeScheduleTimestamp = (schedule) => new Date(schedule.timestamps[schedule.next_entries[0]]).valueOf(); - const sortByRelativeTime = (schedules) => { - const output = [...schedules]; - output.sort((a, b) => { - const remainingA = computeScheduleTimestamp(a); - const remainingB = computeScheduleTimestamp(b); - const now = new Date().valueOf(); - const reverse = remainingA < now && remainingB < now; - if (remainingA !== null && remainingB !== null) { - if (remainingA < now && remainingB >= now) - return 1; - else if (remainingA >= now && remainingB < now) - return -1; - else if (remainingA > remainingB) - return reverse ? -1 : 1; - else if (remainingA < remainingB) - return reverse ? 1 : -1; - else - return a.entity_id < b.entity_id ? 1 : -1; - } - else if (remainingB !== null) - return 1; - else if (remainingA !== null) - return -1; - else - return a.entity_id < b.entity_id ? 1 : -1; - }); - return output; - }; - const sortByTitle = (schedules, displayInfo) => { - const output = [...schedules]; - output.sort((a, b) => { - const titleA = displayInfo[a.schedule_id].primaryInfo.join(''); - const titleB = displayInfo[b.schedule_id].primaryInfo.join(''); - return sortAlphabetically(titleA, titleB); - }); - return output; - }; - const sortByState = (schedules, hass, expiredSchedulesLast) => { - const output = [...schedules]; - output.sort((a, b) => { - var _a, _b; - const stateA = (_a = hass.states[a.entity_id]) === null || _a === void 0 ? void 0 : _a.state; - const stateB = (_b = hass.states[b.entity_id]) === null || _b === void 0 ? void 0 : _b.state; - const scheduleA_active = ['on', 'triggered'].includes(stateA); - const scheduleB_active = ['on', 'triggered'].includes(stateB); - if (scheduleA_active && !scheduleB_active) - return -1; - else if (!scheduleA_active && scheduleB_active) - return 1; - if (expiredSchedulesLast) { - if (stateA != 'off' && stateB == 'off') - return 1; - else if (stateA == 'off' && stateB != 'off') - return -1; - } - return 0; - }); - return output; - }; - //check whether entities and tags of schedule are included in configuration - const isIncluded = (schedule, config) => { - var _a; - if (!schedule.timeslots.every(timeslot => timeslot.actions.every(action => entityFilter(action.entity_id || action.service, config)))) - return false; - const filters = AsArray(config.tags); - if (filters.length) { - if ((schedule.tags || []).some(e => filters.includes(e))) - return true; - else if (filters.includes('none') && !((_a = schedule.tags) === null || _a === void 0 ? void 0 : _a.length)) - return true; - return false; - } - return true; - }; - //check whether entities and tags of schedule are included in configuration OR they should be discovered - const isIncludedOrExcluded = (schedule, config) => { - if (config.discover_existing) - return true; - else if (!schedule) - return false; - else - return isIncluded(schedule, config); - }; - const getScheduleDisplayInfo = (schedule, config, hass) => { - const info = { - primaryInfo: computeScheduleHeader(schedule, config, hass), - secondaryInfo: computeScheduleInfo(schedule, config, hass), - icon: computeScheduleIcon(schedule, config, hass), - }; - return info; - }; - let SchedulerEntitiesCard = class SchedulerEntitiesCard extends SubscribeMixin(h$2) { - constructor() { - super(...arguments); - this.showDiscovered = false; - this.scheduleDisplayInfo = {}; - this.connectionError = false; - } - hassSubscribe() { - this.loadSchedules(); - return [ - this.hass.connection.subscribeMessage((ev) => this.updateScheduleItem(ev), { - type: WebsocketEvent, - }), - ]; - } - async updateScheduleItem(ev) { - //only update single schedule - fetchScheduleItem(this.hass, ev.schedule_id).then(schedule => { - var _a; - const oldSchedule = (_a = this.schedules) === null || _a === void 0 ? void 0 : _a.find(e => e.schedule_id == ev.schedule_id); - let schedules = [...(this.schedules || [])]; - this.scheduleDisplayInfo = Object.assign(Object.assign({}, this.scheduleDisplayInfo), { [schedule.schedule_id]: getScheduleDisplayInfo(schedule, this.config, this.hass) }); - if (!schedule || !isIncludedOrExcluded(schedule, this.config)) { - //schedule is not in the list, remove if it was in the list - if (oldSchedule) { - schedules = schedules.filter(e => e.schedule_id != ev.schedule_id); - } - } - else if (!oldSchedule) { - //add a new schedule and sort the list - schedules = this.sortSchedules([...schedules, schedule]); - } - else if (computeScheduleTimestamp(oldSchedule) == computeScheduleTimestamp(schedule)) { - //only overwrite the existing schedule - schedules = schedules.map(e => (e.schedule_id == schedule.schedule_id ? schedule : e)); - } - else { - //overwrite the existing schedule and sort - schedules = this.sortSchedules(schedules.map(e => (e.schedule_id == schedule.schedule_id ? schedule : e))); - } - this.schedules = [...schedules]; - }); - } - async loadSchedules() { - //load all schedules - fetchSchedules(this.hass) - .then(res => { - let schedules = res.filter(e => isIncludedOrExcluded(e, this.config)); - let scheduleInfo = {}; - Object.keys(schedules).forEach(e => { - scheduleInfo = Object.assign(Object.assign({}, scheduleInfo), { [schedules[e].schedule_id]: getScheduleDisplayInfo(schedules[e], this.config, this.hass) }); - }); - this.scheduleDisplayInfo = scheduleInfo; - this.schedules = this.sortSchedules(schedules); - }) - .catch(_e => { - this.schedules = []; - this.connectionError = true; - }); - } - shouldUpdate(changedProps) { - const oldHass = changedProps.get('hass'); - const oldConfig = changedProps.get('config'); - if (oldHass && changedProps.size == 1 && this.schedules) - return this.schedules.some(e => JSON.stringify(oldHass.states[e.entity_id]) !== JSON.stringify(this.hass.states[e.entity_id])); - else if (oldConfig && - this.config && - (oldConfig.discover_existing !== this.config.discover_existing || oldConfig.tags !== this.config.tags)) - (async () => await this.loadSchedules())(); - return true; - } - render() { - if (!this.hass || !this.config || !this.schedules) - return T ``; - return T ` - -
-
- ${this.config.title - ? typeof this.config.title == 'string' - ? this.config.title - : localize('ui.panel.common.title', getLocale(this.hass)) - : ''} -
- ${this.schedules.length && this.config.show_header_toggle - ? T ` - - ` - : ''} -
-
- ${this.renderRows()} -
- ${this.config.show_add_button !== false - ? T ` -
- ${this.hass.localize('ui.components.area-picker.add_dialog.add')} - -
- ` - : ''} -
- `; - } - renderRows() { - if (!this.config || !this.hass || !this.schedules) - return T ``; - if (this.connectionError) { - return T ` -
- - ${localize('ui.panel.overview.backend_error', getLocale(this.hass))} - -
- `; - } - else if (!Object.keys(this.schedules).length) { - return T ` -
- ${localize('ui.panel.overview.no_entries', getLocale(this.hass))} -
- `; - } - const includedSchedules = this.schedules.filter(e => isIncluded(e, this.config)); - const excludedEntities = this.schedules.filter(e => !isIncluded(e, this.config)); - return T ` - ${includedSchedules.map(schedule => this.renderScheduleRow(schedule))} - ${Object.keys(excludedEntities).length - ? !this.showDiscovered - ? T ` -
- -
- ` - : T ` - ${excludedEntities.map(schedule => this.renderScheduleRow(schedule))} -
- -
- ` - : ''} - `; - } - renderScheduleRow(schedule) { - var _a, _b, _c; - if (!this.hass) - return T ``; - if (!schedule || - !schedule.next_entries.length || - !Object.keys(this.scheduleDisplayInfo).includes(schedule.schedule_id)) { - return this.hass.config.state !== STATE_NOT_RUNNING - ? T ` - - Defective schedule entity: ${schedule.entity_id} - - ` - : T ` - - ${this.hass.localize('ui.panel.lovelace.warning.starting')} - - `; - } - const displayInfo = this.scheduleDisplayInfo[schedule.schedule_id]; - const state = ((_a = this.hass.states[schedule.entity_id]) === null || _a === void 0 ? void 0 : _a.state) || ''; - return T ` -
this.editItemClick(schedule.schedule_id)} - > - -
- ${this.renderDisplayItems(schedule, displayInfo.primaryInfo)} -
- ${this.renderDisplayItems(schedule, displayInfo.secondaryInfo)} -
-
- this.toggleDisabled(ev, schedule.entity_id)} - > - -
- `; - } - renderDisplayItems(schedule, displayItem) { - const replaceReservedTags = (input) => { - const parts = input.split(''); - if (parts.length > 1) - return T ` - ${parts[0] ? o$6(parts[0]) : ''} - - - ${parts[1] ? o$6(parts[1]) : ''} - `; - const parts2 = input.split(/([^<]*<\/tag>)/g); - if (parts2.length > 1) - return parts2 - .filter(e => e.length) - .map(e => { - let res = e.match(/([^<]*)<\/tag>/g); - return res ? o$6(`${res[0]}`) : e; - }); - return o$6(input); - }; - return displayItem.filter(isDefined).map(e => T ` - ${replaceReservedTags(e)}
- `); - } - sortSchedules(schedules) { - var _a; - const sortingOptions = AsArray((_a = this.config) === null || _a === void 0 ? void 0 : _a.sort_by); - if (sortingOptions.includes('relative-time')) - schedules = sortByRelativeTime(schedules); - if (sortingOptions.includes('title')) - schedules = sortByTitle(schedules, this.scheduleDisplayInfo); - if (sortingOptions.includes('state')) { - const expiredSchedulesLast = sortingOptions.includes('relative-time'); - schedules = sortByState(schedules, this.hass, expiredSchedulesLast); - } - return schedules; - } - toggleDisabled(ev, entity_id) { - if (!this.hass || !entity_id) - return; - ev.stopPropagation(); - const checked = !ev.target.checked; - this.hass.callService('switch', checked ? 'turn_on' : 'turn_off', { entity_id: entity_id }); - } - toggleDisableAll(ev) { - if (!this.hass || !this.schedules) - return; - const checked = ev.target.checked; - const items = this.schedules.filter(e => this.showDiscovered ? isIncludedOrExcluded(e, this.config) : isIncluded(e, this.config)); - items.forEach(el => { - this.hass.callService('switch', checked ? 'turn_on' : 'turn_off', { entity_id: el.entity_id }); - }); - } - computeHeaderToggleState() { - if (!this.schedules) - return false; - const items = this.schedules.filter(e => this.showDiscovered ? isIncludedOrExcluded(e, this.config) : isIncluded(e, this.config)); - return items.some(el => { var _a; return ['on', 'triggered'].includes(((_a = this.hass.states[el.entity_id]) === null || _a === void 0 ? void 0 : _a.state) || ''); }); - } - editItemClick(entity_id) { - const myEvent = new CustomEvent('editClick', { detail: entity_id }); - this.dispatchEvent(myEvent); - } - newItemClick() { - const myEvent = new CustomEvent('newClick'); - this.dispatchEvent(myEvent); - } - }; - SchedulerEntitiesCard.styles = i ` - ${commonStyle} - hui-warning { - padding: 10px 0px; - } - - button.show-more { - color: var(--primary-color); - text-align: left; - cursor: pointer; - background: none; - border-width: initial; - border-style: none; - border-color: initial; - border-image: initial; - font: inherit; - } - button.show-more:focus { - outline: none; - text-decoration: underline; - } - - div.schedule-row { - display: flex; - align-items: center; - flex-direction: row; - cursor: pointer; - margin: 20px 0px; - } - div.schedule-row .info { - margin-left: 16px; - flex: 1 0 60px; - } - div.schedule-row .info, - div.schedule-row .info > * { - color: var(--primary-text-color); - transition: color 0.2s ease-in-out; - } - div.schedule-row .secondary { - display: block; - color: var(--secondary-text-color); - transition: color 0.2s ease-in-out; - } - div.schedule-row ha-icon { - flex: 0 0 40px; - color: var(--state-icon-color); - transition: color 0.2s ease-in-out; - } - div.schedule-row ha-switch { - padding: 13px 5px; - } - div.schedule-row hui-warning { - flex: 1 0 40px; - } - div.schedule-row span.filter-tag { - background: rgba(var(--rgb-primary-color), 0.54); - color: var(--primary-text-color); - height: 24px; - border-radius: 12px; - font-size: 12px; - font-weight: 500; - line-height: 18px; - padding: 0px 10px; - display: inline-flex; - align-items: center; - box-sizing: border-box; - margin: 4px 2px 0px 2px; - transition: color 0.2s ease-in-out, background 0.2s ease-in-out; - } - div.schedule-row.disabled { - --primary-text-color: var(--disabled-text-color); - --secondary-text-color: var(--disabled-text-color); - --paper-item-icon-color: var(--disabled-text-color); - --state-icon-color: var(--disabled-text-color); - } - div.schedule-row span.filter-tag { - background: rgba(var(--rgb-primary-color), 0.3); - } - `; - __decorate([ - e$3() - ], SchedulerEntitiesCard.prototype, "config", void 0); - __decorate([ - e$3() - ], SchedulerEntitiesCard.prototype, "showDiscovered", void 0); - __decorate([ - e$3() - ], SchedulerEntitiesCard.prototype, "schedules", void 0); - SchedulerEntitiesCard = __decorate([ - n$4('scheduler-entities-card') - ], SchedulerEntitiesCard); - - // Material Design Icons v6.4.95 - var mdiClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"; - var mdiMenuDown = "M7,10L12,15L17,10H7Z"; - var mdiMenuUp = "M7,15L12,10L17,15H7Z"; - var mdiPencil = "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"; - var mdiUnfoldMoreVertical = "M18.17,12L15,8.83L16.41,7.41L21,12L16.41,16.58L15,15.17L18.17,12M5.83,12L9,15.17L7.59,16.59L3,12L7.59,7.42L9,8.83L5.83,12Z"; - - const domainNames = { - alarm_control_panel: 'domains.alarm_control_panel', - automation: 'ui.dialogs.quick-bar.commands.navigation.automation', - binary_sensor: 'domains.binary_sensor', - calendar: 'panel.calendar', - climate: 'domains.climate', - cover: 'domains.cover', - fan: 'domains.fan', - group: 'domains.group', - humidifier: 'domains.humidifier', - input_boolean: 'domains.input_boolean', - input_number: 'domains.input_number', - input_select: 'domains.input_select', - light: 'domains.light', - lock: 'domains.lock', - media_player: 'domains.media_player', - notify: 'domains.notify', - person: 'ui.dialogs.quick-bar.commands.navigation.person', - scene: 'ui.dialogs.quick-bar.commands.navigation.scene', - script: 'ui.dialogs.quick-bar.commands.navigation.script', - sensor: 'ui.panel.config.devices.entities.sensor', - sun: 'ui.panel.config.automation.editor.conditions.type.sun.label', - switch: 'domains.switch', - vacuum: 'domains.vacuum', - water_heater: 'domains.water_heater', - }; - const standardGroupNames = (domain, hass) => { - if (domain in domainNames) { - const translationKey = domainNames[domain]; - const domainTranslation = translationKey.startsWith('domains') - ? localize(translationKey, getLocale(hass)) - : hass.localize(translationKey); - if (domainTranslation) - return domainTranslation; - } - return domain; - }; - - function entityGroups(entities, config, hass) { - let groups = []; - //create groups from user config - if (config.groups) { - config.groups.forEach(el => { - if (!entities.find(e => entityFilter(e, el))) - return; - groups = [ - ...groups, - { - name: el.name, - icon: el.icon || DefaultGroupIcon, - entities: entities.filter(e => entityFilter(e, el)), - }, - ]; - }); - } - const ungroupedEntities = entities.filter(e => !groups.some(g => g.entities.includes(e))); - const domains = ungroupedEntities.map(g$1).filter((v, k, arr) => arr.indexOf(v) === k); - //automatically create groups for ungrouped entities - domains.forEach(domain => { - groups = [ - ...groups, - { - name: standardGroupNames(domain, hass), - icon: (config.standard_configuration === undefined || config.standard_configuration) && domain in domainIcons - ? domainIcons[domain] - : DefaultGroupIcon, - entities: ungroupedEntities.filter(e => entityFilter(e, { include: [domain], exclude: [] })), - }, - ]; - }); - return groups; + ha-slider { + width: 100%; } - - const onOffType = { options: ['on', 'off'] }; - const statesList = { - alarm_control_panel: { - template: stateObj => { - let modes = ['disarmed', 'triggered']; - const supported = numericAttribute(stateObj, 'supported_features') || 0; - if (supported & 2) - modes = [...modes, 'armed_away']; - if (supported & 1) - modes = [...modes, 'armed_home']; - if (supported & 4) - modes = [...modes, 'armed_night']; - if (supported & 16) - modes = [...modes, 'armed_custom_bypass']; - return { options: modes }; - }, - }, - binary_sensor: onOffType, - climate: { - options: 'hvac_modes', - }, - calendar: onOffType, - cover: { options: ['open', 'closed'] }, - device_tracker: { options: ['home', 'not_home'] }, - fan: onOffType, - humidifier: onOffType, - input_boolean: onOffType, - input_number: { - min: 'min', - max: 'max', - unit: 'unit_of_measurement', - step: 'step', - }, - input_select: { - options: 'options', - }, - light: onOffType, - lock: { options: ['locked', 'unlocked'] }, - number: { - min: 'min', - max: 'max', - step: 'step', - }, - person: { - template: (_stateObj, hass) => { - let modes = ['home', 'not_home']; - let zones = Object.keys(hass.states) - .filter(e => g$1(e) == 'zone') - .map(b$1); - return { options: [...new Set([...modes, ...zones])] }; - }, - }, - proximity: { - unit: 'unit_of_measurement', - }, - select: { - options: 'options', - }, - sensor: { - template: stateObj => stateObj && !isNaN(Number(stateObj.state)) - ? stringAttribute(stateObj, 'unit_of_measurement') == '%' - ? { - min: 0, - max: 100, - unit: '%', - step: 1, - } - : { unit: 'unit_of_measurement' } - : {}, - }, - sun: { options: ['below_horizon', 'above_horizon'] }, - switch: onOffType, - water_heater: { - options: 'operation_list', - }, - }; - - const binarySensorIcon$1 = (stateObj, state) => { - return re(Object.assign(Object.assign({}, stateObj), { state: state })); - }; - const coverIcon$2 = (stateObj, state) => { - const closedState = state == 'closed'; - switch (stateObj.attributes.device_class) { - case 'garage': - return closedState ? 'mdi:garage' : 'mdi:garage-open'; - case 'door': - return closedState ? 'mdi:door-closed' : 'mdi:door-open'; - case 'blind': - return closedState ? 'mdi:blinds' : 'mdi:blinds-open'; - case 'window': - return closedState ? 'mdi:window-closed' : 'mdi:window-open'; - default: - return closedState ? 'mdi:window-shutter' : 'mdi:window-shutter-open'; - } - }; - const personIcon = (_stateObj, state, hass) => { - let stateIcons = { - home: 'mdi:home-outline', - not_home: 'mdi:exit-run', - }; - Object.keys(hass.states) - .filter(e => g$1(e) == 'zone') - .forEach(e => { - const name = b$1(e); - const icon = hass.states[e].attributes.icon; - if (!icon) - return; - stateIcons[name] = icon; - }); - return state in stateIcons ? stateIcons[state] : 'mdi:flash'; - }; - const stateIcons = { - alarm_control_panel: { - disarmed: 'mdi:lock-open-variant-outline', - armed_away: 'mdi:exit-run', - armed_home: 'mdi:home-outline', - armed_night: 'mdi:power-sleep', - triggered: 'mdi:alarm-light-outline', - }, - binary_sensor: { - on: binarySensorIcon$1, - off: binarySensorIcon$1, - }, - calendar: { - on: 'mdi:flash', - off: 'mdi:flash-off', - }, - climate: { - off: 'mdi:power-off', - heat: 'mdi:fire', - cool: 'mdi:snowflake', - heat_cool: 'mdi:thermometer', - auto: 'mdi:autorenew', - dry: 'mdi:water-percent', - fan_only: 'mdi:fan', - }, - cover: { - closed: coverIcon$2, - open: coverIcon$2, - }, - device_tracker: { - home: 'mdi:home-outline', - not_home: 'mdi:exit-run', - }, - fan: { - on: 'mdi:power', - off: 'mdi:power-off', - }, - humidifier: { - on: 'mdi:power', - off: 'mdi:power-off', - }, - input_boolean: { - on: 'mdi:flash', - off: 'mdi:flash-off', - }, - light: { - on: 'mdi:lightbulb', - off: 'mdi:lightbulb-off', - }, - lock: { - unlocked: 'mdi:lock-outline', - locked: 'mdi:lock-open-variant-outline', - }, - person: personIcon, - sensor: { - unit: 'attributes.unit_of_measurement', - }, - sun: { - below_horizon: 'mdi:weather-sunny-off', - above_horizon: 'mdi:weather-sunny', - }, - switch: { - on: 'mdi:flash', - off: 'mdi:flash-off', - }, - }; - const stateIcon = (stateObj, state, hass, fallback) => { - const domain = g$1(stateObj.entity_id); - if (!state) - state = stateObj.state; - if (domain in stateIcons) { - if (state in stateIcons[domain]) { - const entry = stateIcons[domain][state]; - return typeof entry == 'string' ? entry : entry(stateObj, state, hass); - } - else if (typeof stateIcons[domain] == 'function') { - return stateIcons[domain](stateObj, state, hass); - } - } - return fallback || DefaultEntityIcon; - }; - - function standardStates(entity_id, hass) { - const domain = g$1(entity_id); - const stateObj = hass.states[entity_id]; - if (!stateObj) - return null; - if (domain == 'group') { - const stateObj = hass.states[entity_id]; - const subEntities = listAttribute(stateObj, 'entity_id'); - if (!subEntities.length) - return null; - const subStates = subEntities.map(e => standardStates(e, hass)); - return subStates.every(isDefined) ? groupStates(hass, stateObj, subStates) : null; - } - if (!Object.keys(statesList).includes(domain)) - return null; - let stateConfig = parseVariable(statesList[domain], stateObj, hass); - if ('options' in stateConfig && isDefined(stateConfig.options)) { - let options = [...stateConfig.options]; - options = options.map(e => Object.assign(e, { - icon: e.icon ? e.icon : stateIcon(stateObj, e.value, hass, DefaultActionIcon), - name: e.name ? e.name : getStateName(stateObj, e.value, hass), - })); - stateConfig = Object.assign(Object.assign({}, stateConfig), { options: options }); - if (!options.length) - return null; - return listVariable(stateConfig); - } - else if ('min' in stateConfig && isDefined(stateConfig.min) && 'max' in stateConfig && isDefined(stateConfig.max)) { - return levelVariable(stateConfig); - } - else { - return textVariable(stateConfig); - } - } - const getStateName = (stateObj, state, hass) => { - const domain = g$1(stateObj.entity_id); - return ((stateObj.attributes.device_class && - hass.localize(`component.${domain}.state.${stateObj.attributes.device_class}.${state}`)) || - hass.localize(`component.${domain}.state._.${state}`) || - state); - }; - - function computeStates(entity_id, hass, config) { - //fetch standard states for entity - let stateConfig = config.standard_configuration ? standardStates(entity_id, hass) : null; - //get customizations for entity - const customizedStates = Object.entries(config.customize) - .filter(([a]) => matchPattern(a, entity_id)) - .sort((a, b) => b[0].length - a[0].length) - .map(([, b]) => b.states) - .filter(isDefined); - if (customizedStates.length) { - customizedStates.forEach(userConfig => { - if (Array.isArray(userConfig)) { - stateConfig = listVariable({ options: userConfig.map(e => Object({ value: e })) }); - } - else { - stateConfig = levelVariable(userConfig); - } - }); - } - return stateConfig; + `,t([ae({type:Number})],qa.prototype,"min",void 0),t([ae({type:Number})],qa.prototype,"max",void 0),t([ae({type:Number})],qa.prototype,"step",void 0),t([ae({type:Number})],qa.prototype,"value",null),t([ae({type:Number})],qa.prototype,"scaleFactor",void 0),t([ae({type:String})],qa.prototype,"unit",void 0),t([ae({type:Boolean})],qa.prototype,"optional",void 0),t([ae({type:Boolean})],qa.prototype,"disabled",void 0),t([ae({type:Number})],qa.prototype,"_displayedValue",void 0),qa=t([ie("variable-slider")],qa);let Ra=class extends ee{firstUpdated(){var e;null!==this.value&&void 0!==this.value||(null===(e=this.variable)||void 0===e?void 0:e.type)!=Ie.Level||this.variable.optional||this.levelVariableUpdated(this.variable.min)}render(){return this.variable?this.variable.type==Ie.Level?this.renderLevelVariable():this.variable.type==Ie.List?this.renderListVariable():this.variable.type==Ie.Text?this.renderTextVariable():N``:N``}levelVariableUpdated(e){const t="number"==typeof e?e:Number(e.detail.value);this.value=t,Me(this,"value-changed",{value:t})}renderLevelVariable(){const e=this.variable,t=Number(this.value);return N` + + + `}listVariableUpdated(e){const t="string"==typeof e?e:String(e.target.value);this.value=t,Me(this,"value-changed",{value:t})}renderListVariable(){const e=this.variable.options,t=String(this.value)||null;return 1==e.length&&t!=e[0].value&&this.listVariableUpdated(e[0].value),N` + + `}renderTextVariable(){const e=this.variable,t=this.value;return N` + + `}};Ra.styles=r` + ha-textfield { + width: 100%; } - - function computeEntities$1(hass, config, options = { filterActions: true, filterStates: false }) { - let entities = Object.keys(hass.states).filter(e => entityFilter(e, config)); - if ('notify' in hass.services) { - entities = [ - ...entities, - ...Object.keys(hass.services['notify']) - .map(e => `notify.${e}`) - .filter(e => entityFilter(e, config)), - ]; - } - if (options.filterActions && options.filterStates) - entities = entities.filter(e => computeActions(e, hass, config).length || computeStates(e, hass, config)); - else if (options.filterActions) - entities = entities.filter(e => computeActions(e, hass, config).length); - else if (options.filterStates) - entities = entities.filter(e => computeStates(e, hass, config)); - return entities; + `,t([ae()],Ra.prototype,"variable",void 0),t([ae()],Ra.prototype,"value",void 0),Ra=t([ie("scheduler-variable-picker")],Ra);let Ua=class extends ee{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params&&this._params.cancel(),this._params=void 0}render(){return this._params?N` + +
+ + + + ${this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_title")} + + +
+
+ ${this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_text")} +
+ + + ${this.hass.localize("ui.dialogs.generic.cancel")} + + + ${this.hass.localize("ui.dialogs.generic.ok")} + +
+ `:N``}confirmClick(){this._params.confirm()}cancelClick(){this._params.cancel()}static get styles(){return r` + div.wrapper { + color: var(--primary-text-color); + } + `}};t([ae({attribute:!1})],Ua.prototype,"hass",void 0),t([oe()],Ua.prototype,"_params",void 0),Ua=t([ie("dialog-delete-confirm")],Ua);var Ha=Object.freeze({__proto__:null,get DialogDeleteConfirm(){return Ua}});const Va=(e,t)=>{let i={entity_id:e,service:t.service,service_data:Object.assign({},t.service_data)};return Object.entries(t.variables||{}).forEach(([e,t])=>{Object.keys(i.service_data||{}).includes(e)||(t.type==Ie.Level?(t=t,i=Object.assign(Object.assign({},i),{service_data:t.optional?Qe(i.service_data||{},e):Object.assign(Object.assign({},i.service_data),{[e]:parseFloat((t.min*t.scale_factor).toPrecision(12))||0})})):t.type==Ie.List?(t=t,i=Object.assign(Object.assign({},i),{service_data:Object.assign(Object.assign({},i.service_data),{[e]:t.options.length?t.options[0].value:void 0})})):t.type==Ie.Text&&(t=t,i=Object.assign(Object.assign({},i),{service_data:Object.assign(Object.assign({},i.service_data),{[e]:""})})))}),i};let Fa=class extends ee{constructor(){super(...arguments),this.activeEntry=null,this.activeMarker=null,this.timeslots=!1,this.editItem=!1}firstUpdated(){if(!this.actions||!this.hass)return;this.timeslots||(this.activeEntry=0);const e=this.actions.map(e=>{const t=Object.assign(Object.assign({},e),{service_data:Qe(e.service_data||{},...Object.keys(e.variables||{}))});return Object.assign(e,{name:Bs(t)})});e.sort(at),this.actions=e}render(){return this.hass&&this.config&&this.entities&&this.actions?N` + +
+
+ ${this.config.title?"string"==typeof this.config.title?this.config.title:es("ui.panel.common.title",ct(this.hass)):""} +
+ +
+
+
${this.hass.localize("ui.panel.config.automation.editor.actions.name")}
+ ${this.renderSummary()} + ${this.timeslots?N` + ${this.renderDays()} +
${es("ui.panel.time_picker.time_scheme",ct(this.hass))}
+ + + + + ${this.renderMarkerOptions()} ${this.renderActions()} ${this.getVariableEditor()} + `:N` + ${this.getVariableEditor()} ${this.renderDays()} +
${this.hass.localize("ui.dialogs.helper_settings.input_datetime.time")}
+ this.updateActiveEntry({start:e.target.value})} + > + + `} +
+
+ e.actions.length).length} + > + ${this.hass.localize("ui.common.save")} + + ${this.editItem?N` + ${this.hass.localize("ui.common.delete")} + `:""} + ${this.hass.localize("ui.dialogs.helper_settings.input_select.options")} +
+
+ `:N``}renderSummary(){return this.entities&&this.actions?N` +
+
+ ${this.entities.map(e=>N` +
+ + ${ot(nt(e.name||this.hass.states[e.id].attributes.friendly_name||De(e.id)))} +
+ `)} +
+
+ +
+
+ ${this.timeslots?N` +
+ + ${ot(es("ui.panel.entity_picker.make_scheme",ct(this.hass)))} +
+ `:N` +
+ + ${ot(this.actions[0].name||De(this.actions[0].service))} +
+ `} +
+
+ `:N``}renderDays(){if(!this.hass)return N``;let e=Array.from(Array(7).keys());const t=function(e){const t=e.match(/^([a-z]{2,3})(?:-([a-z]{3})(?=$|-))?(?:-([a-z]{4})(?=$|-))?(?:-([a-z]{2}|\d{3})(?=$|-))?/i),i=t[1],s=t[4],a="AEAFBHDJDZEGIQIRJOKWLYOMQASDSY".match(/../g),o="AGARASAUBDBRBSBTBWBZCACNCODMDOETGTGUHKHNIDILINJMJPKEKHKRLAMHMMMOMTMXMZNINPPAPEPHPKPRPTPYSASGSVTHTTTWUMUSVEVIWSYEZAZW".match(/../g),n="amasbndzengnguhehiidjajvkmknkolomhmlmrmtmyneomorpapssdsmsnsutatethtnurzhzu".match(/../g);return s?o.includes(s)?"sun":a.includes(s)?"sat":"mon":n.includes(i)?"sun":["ar","arq","arz","fa"].includes(i)?"sat":"mon"}(this.hass.language),i=e.length-Zs.findIndex(e=>e.substr(0,3)==t);e=[...e.slice(-i),...e.slice(0,-i)];const s=e.map(e=>Object({value:Zs[e].substr(0,3),name:Ks(e,ct(this.hass),!0)})),a=[{value:Ue.Daily,name:es("ui.components.date.day_types_short.daily",ct(this.hass))},{value:Ue.Workday,name:es("ui.components.date.day_types_short.workdays",ct(this.hass))},{value:Ue.Weekend,name:es("ui.components.date.day_types_short.weekend",ct(this.hass))},{value:Ue.Custom,name:this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.label")}];return N` +
${es("ui.components.date.days",ct(this.hass))}
+ + + ${Js(this.schedule.weekdays)==Ue.Custom?N` +
+ + +
+ `:""} + `}renderActions(){var e;if(!this.hass||null!==this.activeMarker)return;const t=null!==this.activeEntry&&this.schedule.timeslots[this.activeEntry].actions.length?this.schedule.timeslots[this.activeEntry].actions[0]:null;return N` +
${this.hass.localize("ui.panel.config.automation.editor.actions.name")}
+ us(e,t,!0)):null} + optional="true" + @change=${this.selectAction} + > + ${es("ui.panel.time_picker.no_timeslot_selected",ct(this.hass))} + + `}renderMarkerOptions(){if(!this.hass||!this.config||null===this.activeMarker)return;const e=this.schedule.timeslots[this.activeMarker].start,t=Je(e),i=Ge(e,this.hass)-Ge("sunrise+00:00",this.hass),s=Ge(e,this.hass)-Ge("sunset+00:00",this.hass),a=[{value:"time",name:this.hass.localize("ui.panel.config.automation.editor.triggers.type.time.at"),icon:"hass:clock-outline"},{value:Re.Sunrise,name:this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.sunrise"),icon:"hass:weather-sunny",disabled:Math.abs(i)>7200},{value:Re.Sunset,name:this.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.sunset"),icon:"hass:weather-night",disabled:Math.abs(s)>7200}];return N` +
${es("ui.panel.time_picker.time_input_mode",ct(this.hass))}
+ + + `}updateMarkerSetting(e){const t=e.target.value,i=this.schedule.timeslots[this.activeMarker].start,s="time"==t?((e,t,i={})=>{const s=Je(e);if(!s)return e;const a=t.states["sun.sun"],o="sunrise"==s.event?Ge(a.attributes.next_rising,t):Ge(a.attributes.next_setting,t);let n="+"==s.sign?o+Ge(s.offset,t):o-Ge(s.offset,t);return i.stepSize&&(n=Ke(n,i.stepSize)),Ze(n)})(i,this.hass,{stepSize:this.config.time_step}):La(i,t,this.hass,{stepSize:this.config.time_step});let a=[...this.schedule.timeslots];a=Object.assign(a,{[this.activeMarker-1]:Object.assign(Object.assign({},this.schedule.timeslots[this.activeMarker-1]),{stop:s}),[this.activeMarker]:Object.assign(Object.assign({},this.schedule.timeslots[this.activeMarker]),{start:s})}),this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:[...a]})}updateActiveEntry(e){null!==this.activeEntry&&(this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:Object.assign([...this.schedule.timeslots],{[this.activeEntry]:Object.assign(Object.assign({},this.schedule.timeslots[this.activeEntry]),e)})}))}updateActiveEntryAction(e,t){null!==this.activeEntry&&(e&&"service"in e?this.updateActiveEntry({actions:Object.assign([...this.schedule.timeslots[this.activeEntry].actions],{[t]:Object.assign(Object.assign({},this.schedule.timeslots[this.activeEntry].actions[t]),e)})}):e?Object.entries(e).forEach(([e,i])=>{let s=[...this.schedule.timeslots[this.activeEntry].actions],a="object"==typeof i&&e in this.schedule.timeslots[this.activeEntry].actions[t]?Object.assign(Object.assign({},s[t][e]),i):i;const o=Object.keys(a).filter(e=>null===a[e]);o.length&&(a=Qe(a,...o)),s=Object.assign(s,{[t]:Object.assign(Object.assign({},s[t]),{[e]:a})}),this.updateActiveEntry({actions:s})}):this.updateActiveEntry({actions:[...this.schedule.timeslots[this.activeEntry].actions].filter((e,i)=>i!=t)}))}handlePlannerUpdate(e){if(e.detail.hasOwnProperty("entries")){const t=e.detail.entries;t.lengthe.id).forEach((e,i)=>{this.updateActiveEntryAction(Va(e,t),i)}):this.entities.forEach((e,t)=>{this.updateActiveEntryAction(null,t)})}getVariableEditor(){if(null===this.activeEntry||!this.actions)return N``;const e=[];return this.schedule.timeslots[this.activeEntry].actions.forEach(t=>{t=Qe(t,"entity_id"),this.actions.find(e=>us(e,t,!0)&&Object.keys(e.variables||{}).length)&&(e.some(e=>st(e,t))||e.push(t))}),e.map(e=>Object.entries(this.actions.find(t=>us(t,e,!0)).variables).map(([t,i])=>N` +
+ ${i.name||nt(t)} +
+ this.entities.forEach((i,s)=>{this.updateActiveEntryAction({service_data:{[t]:e.detail.value}},s)})} + > + ${this.hass.localize("ui.dialogs.helper_settings.input_select.no_options")} + + `))}selectDays(e){const t=e.target.value;let i=this.schedule.weekdays;if(Object.values(Ue).includes(t))switch(t){case Ue.Daily:i=["daily"];break;case Ue.Workday:i=["workday"];break;case Ue.Weekend:i=["weekend"];break;case Ue.Custom:i=[]}else i=t;this.schedule=Object.assign(Object.assign({},this.schedule),{weekdays:i})}cancelClick(){const e=new CustomEvent("cancelClick");this.dispatchEvent(e)}saveClick(){const e=new CustomEvent("saveClick",{detail:this.schedule});this.dispatchEvent(e)}optionsClick(){const e=new CustomEvent("optionsClick",{detail:this.schedule});this.dispatchEvent(e)}editActionClick(){const e=new CustomEvent("editActionClick",{detail:this.schedule});this.dispatchEvent(e)}async deleteClick(e){const t=e.target;if(await new Promise(e=>{Me(t,"show-dialog",{dialogTag:"dialog-delete-confirm",dialogImport:()=>Promise.resolve().then((function(){return Ha})),dialogParams:{cancel:()=>{e(!1)},confirm:()=>{e(!0)}}})})){const e=new CustomEvent("deleteClick");this.dispatchEvent(e)}}};Fa.styles=r` + ${ts} + div.summary { + display: grid; + grid-template-columns: 1fr max-content 1fr; + grid-template-areas: 'entity arrow action'; + grid-auto-flow: column; + grid-gap: 5px; } - function name(item) { - var _a; - return ((_a = item.name) === null || _a === void 0 ? void 0 : _a.trim()) || item.value || item.id || ''; - } - function value(item, index) { - return item.id || item.value || index; - } - let ButtonGroup = class ButtonGroup extends h$2 { - constructor() { - super(...arguments); - this.items = []; - this.value = null; - } - render() { - if (!this.items.length) { - return T ` -
- -
- `; - } - return this.items.map((val, key) => this.renderButton(val, key)); - } - renderButton(item, index) { - const selection = Array.isArray(this.value) ? this.value : [this.value]; - const id = value(item, index); - return T ` - this.selectItem(id)} - > - ${item.icon - ? T ` - - ` - : ''} - ${PrettyPrintName(name(item))} - - `; - } - selectItem(val) { - if (!Array.isArray(this.value)) { - if (val == this.value) { - if (this.optional) - this.value = null; - else - return; - } - else - this.value = val; - } - else if (!this.multiple) { - this.value = this.value.includes(val) ? [] : Array(val); - } - else { - let value = Array.isArray(this.value) ? [...this.value] : []; - if (value.includes(val)) { - if (this.min !== undefined && value.length <= this.min) - return; - value = value.filter(e => e != val); - } - else - value.push(val); - this.value = value; - } - const selection = Array.isArray(this.value) - ? this.value.map(e => this.items.find((v, k) => value(v, k) == e)) - : this.value !== null - ? this.items.find((v, k) => value(v, k) == this.value) - : null; - const myEvent = new CustomEvent('change', { detail: selection }); - this.dispatchEvent(myEvent); - } - }; - ButtonGroup.styles = commonStyle; - __decorate([ - e$3({ type: Array }) - ], ButtonGroup.prototype, "items", void 0); - __decorate([ - e$3() - ], ButtonGroup.prototype, "value", void 0); - __decorate([ - e$3({ type: Number }) - ], ButtonGroup.prototype, "min", void 0); - __decorate([ - e$3({ type: Boolean }) - ], ButtonGroup.prototype, "optional", void 0); - __decorate([ - e$3({ type: Boolean }) - ], ButtonGroup.prototype, "multiple", void 0); - ButtonGroup = __decorate([ - n$4('button-group') - ], ButtonGroup); - - let SchedulerEditorCard = class SchedulerEditorCard extends h$2 { - constructor() { - super(...arguments); - this.selectedEntities = []; - this.multipleEntity = false; - this.scheduleEntities = []; - this.timeSchemeSelected = false; - } - async firstUpdated() { - this.scheduleEntities = (await fetchSchedules(this.hass)).map(e => e.entity_id); - if (this.entities && this.entities.length) { - const group = this.getGroups().find(group => group.entities.find(e => e == this.entities[0].id)); - if (!group) - return; - this.selectedGroup = group; - this.selectedEntities = [...this.entities.map(e => e.id)]; - this.multipleEntity = this.selectedEntities.length > 1; - } - if (this.schedule) { - if (this.schedule.timeslots.every(e => e.stop)) - this.timeSchemeSelected = true; - else { - const actions = unique(flatten(this.schedule.timeslots.map(e => e.actions))); - const matchedActions = this.getActionsForEntity().filter(e => actions.some(a => compareActions(a, e, true))); - if (matchedActions.length == 1) - this.selectedAction = matchedActions[0]; - } - } - } - getGroups() { - if (!this.hass || !this.config) - return []; - const entities = computeEntities$1(this.hass, this.config).filter(e => g$1(e) !== 'switch' || !this.scheduleEntities.includes(e)); - const groups = entityGroups(entities, this.config, this.hass); - groups.sort(sortAlphabetically); - return groups; - } - getEntitiesForGroup() { - if (!this.selectedGroup || !this.hass || !this.config) - return []; - const entities = this.selectedGroup.entities.map(e => parseEntity(e, this.hass, this.config)); - entities.sort(sortAlphabetically); - return entities; - } - getActionsForEntity() { - if (!this.hass || !this.config || !this.selectedEntities.length) - return []; - const actions = computeActions(this.selectedEntities, this.hass, this.config).map(e => Object.assign(e, { name: computeActionDisplay(e) })); - actions.sort(sortAlphabetically); - return actions; - } - render() { - if (!this.hass || !this.config) - return T ``; - const groups = this.getGroups(); - if (groups.length == 1 && !isEqual(this.selectedGroup, groups[0])) - this.selectGroup(groups[0]); - const entities = this.getEntitiesForGroup(); - if (entities.length == 1 && this.selectedEntities[0] !== entities[0].id) - this.selectEntity(entities[0].id); - const actions = this.getActionsForEntity(); - return T ` - -
-
- ${this.config.title - ? typeof this.config.title == 'string' - ? this.config.title - : localize('ui.panel.common.title', getLocale(this.hass)) - : ''} -
- -
-
-
${this.hass.localize('ui.panel.config.users.editor.group')}
- isEqual(e, this.selectedGroup))} - @change=${(ev) => this.selectGroup(ev.detail)} - > - ${localize('ui.panel.entity_picker.no_groups_defined', getLocale(this.hass))} - - -
- ${this.hass.localize('ui.components.entity.entity-picker.entity')} - ${entities.length > 1 - ? T ` -
- { - this.multipleEntity = ev.target.checked; - }} - > - - ${localize('ui.panel.entity_picker.multiple', getLocale(this.hass))} -
- ` - : ''} -
- this.selectEntity(ev.target.value)} - ?multiple=${this.multipleEntity} - ?optional=${true} - > - ${!this.selectedGroup - ? localize('ui.panel.entity_picker.no_group_selected', getLocale(this.hass)) - : localize('ui.panel.entity_picker.no_entities_for_group', getLocale(this.hass))} - - -
${this.hass.localize('ui.panel.config.automation.editor.actions.name')}
- isEqual(e, this.selectedAction))} - @change=${(ev) => this.selectAction(ev.detail)} - > - ${!this.selectedEntities.length - ? localize('ui.panel.entity_picker.no_entity_selected', getLocale(this.hass)) - : localize('ui.panel.entity_picker.no_actions_for_entity', getLocale(this.hass))} - - ${this.makeSchemeButton(actions)} -
-
- ${this.hass.localize('ui.common.next')} -
-
- `; - } - makeSchemeButton(actionConfig) { - if (!actionConfig.length || !this.hass) - return T ``; - return T ` -
${this.hass.localize('ui.panel.config.automation.editor.conditions.type.or.label')}
-
- this.selectTimeScheme()}> - - ${localize('ui.panel.entity_picker.make_scheme', getLocale(this.hass))} - -
- - `; - } - selectGroup(val) { - this.selectedGroup = val; - this.selectedEntities = []; - this.selectedAction = undefined; - } - selectEntity(value) { - this.selectedEntities = Array.isArray(value) ? value : [value]; - if (this.selectedAction) { - const availableActions = this.getActionsForEntity(); - this.selectedAction = availableActions.find(e => compareActions(e, this.selectedAction)); - } - else - this.selectedAction = undefined; - } - selectAction(val) { - this.selectedAction = val; - this.timeSchemeSelected = false; - } - selectTimeScheme() { - this.selectedAction = null; - this.timeSchemeSelected = true; - } - cancelClick() { - const myEvent = new CustomEvent('cancelClick'); - this.dispatchEvent(myEvent); - } - nextClick() { - const myEvent = new CustomEvent('nextClick', { - detail: { - entities: this.selectedEntities, - action: this.selectedAction, - timeSchemeSelected: this.timeSchemeSelected, - }, - }); - this.dispatchEvent(myEvent); - } - }; - SchedulerEditorCard.styles = commonStyle; - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "hass", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "config", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "selectedGroup", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "selectedEntities", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "selectedAction", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "entities", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "schedule", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "multipleEntity", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "scheduleEntities", void 0); - __decorate([ - e$3() - ], SchedulerEditorCard.prototype, "timeSchemeSelected", void 0); - SchedulerEditorCard = __decorate([ - n$4('scheduler-editor-card') - ], SchedulerEditorCard); - - let TimePicker = class TimePicker extends h$2 { - constructor() { - super(...arguments); - this.stepSize = DefaultTimeStep; - this.relativeMode = false; - this.event = ETimeEvent.Sunrise; - this.maxOffset = 2; - } - get time() { - if (this._time >= 0) - return this._time; - return Math.abs(this._time); - } - set time(value) { - const newTime = roundTime(value, this.stepSize, { - wrapAround: !this.relativeMode, - maxHours: this.relativeMode ? this.maxOffset : undefined, - }); - const timeUpdated = newTime != this._time && isDefined(this._time); - this._time = newTime; - if (timeUpdated) - this.updateValue(); - } - firstUpdated() { - const res = parseRelativeTime(this.value); - if (!res) - this.time = stringToTime(this.value, this.hass); - else { - this.relativeMode = true; - this.event = res.event == ETimeEvent.Sunrise ? ETimeEvent.Sunrise : ETimeEvent.Sunset; - this.time = res.sign == '+' ? stringToTime(res.offset, this.hass) : -stringToTime(res.offset, this.hass); - } - } - updateValue() { - if (this.relativeMode) { - const sign = this._time >= 0 ? '+' : '-'; - const offset = timeToString(this.time); - this.value = `${this.event}${sign}${offset}`; - } - else { - this.value = timeToString(this.time); - } - const myEvent = new CustomEvent('change'); - this.dispatchEvent(myEvent); - } - render() { - const timeString = this.relativeMode - ? timeToString(this.time) - : formatTime(stringToDate(timeToString(this.time)), getLocale(this.hass)); - const timeParts = timeString.split(/:|\ /); - return T ` -
-
- (this.time = this._time + 3600)}> - - -
-
${timeParts[0].padStart(2, '0')}
-
- (this.time = this._time - 3600)}> - - -
-
:
-
- (this.time = this._time + this.stepSize * 60)}> - - -
-
${timeParts[1]}
-
- (this.time = this._time - this.stepSize * 60)}> - - -
- ${this.relativeMode - ? T ` -
- - ${this.getBeforeAfter()} - - - - -
- ` - : timeParts.length > 2 - ? T ` -
- - ${timeParts[2]} - -
- ` - : ''} -
- ${this.getSunModeToggle()} -
-
- `; - } - getSunModeToggle() { - if (!this.hass) - return T ``; - if (!this.hass.states['sun.sun']) - return T ``; - return T ` - - - - `; - } - getBeforeAfter() { - if (!this.hass) - return ''; - return this._time < 0 - ? this.hass.localize('ui.panel.config.automation.editor.conditions.type.sun.before').slice(0, -1) - : this.hass.localize('ui.panel.config.automation.editor.conditions.type.sun.after').slice(0, -1); - } - toggleAmPm() { - this.time = this._time + 12 * 3600; - } - toggleBeforeAfter() { - this.time = -this._time; - } - toggleSunriseSunset() { - this.event = this.event == ETimeEvent.Sunrise ? ETimeEvent.Sunset : ETimeEvent.Sunrise; - } - toggleMode() { - if (!this.hass) - return; - this.relativeMode = !this.relativeMode; - const sunEntity = this.hass.states['sun.sun']; - const ts_sunrise = stringToTime(sunEntity.attributes.next_rising, this.hass); - const ts_sunset = stringToTime(sunEntity.attributes.next_setting, this.hass); - if (this.relativeMode) { - this.event = - Math.abs(this._time - ts_sunrise) < Math.abs(this._time - ts_sunset) ? ETimeEvent.Sunrise : ETimeEvent.Sunset; - let offset = this.event == ETimeEvent.Sunrise ? this._time - ts_sunrise : this._time - ts_sunset; - if (offset > 7200) - offset = 7200; - else if (offset < -7200) - offset = -7200; - this.time = offset; - } - else { - this.time = this.event == ETimeEvent.Sunrise ? this._time + ts_sunrise : this._time + ts_sunset; - } - } - }; - TimePicker.styles = i ` - div.time-picker { - display: grid; - grid-template-columns: min-content min-content min-content 1fr min-content; - grid-template-rows: min-content min-content min-content; - grid-template-areas: - 'hours-up . minutes-up suffix options' - 'hours separator minutes suffix options' - 'hours-down . minutes-down suffix options'; - grid-gap: 10px 0px; - align-items: center; - } - - div.hours-up { - grid-area: hours-up; - } - div.hours { - grid-area: hours; - } - div.hours-down { - grid-area: hours-down; - } - div.separator { - grid-area: separator; - } - div.minutes-up { - grid-area: minutes-up; - } - div.minutes { - grid-area: minutes; - } - div.minutes-down { - grid-area: minutes-down; - } - div.suffix { - grid-area: suffix; - flex-grow: 1; - } - div.options { - grid-area: options; - } - - div.hours-up, - div.hours-down, - div.minutes-up, - div.minutes-down { - --mdc-icon-size: 42px; - } - - div.hours, - div.minutes { - font-size: 42px; - text-align: center; - } - - div.separator { - font-size: 36px; - } - - div.suffix mwc-button { - --mdc-typography-button-font-size: 16px; - --mdc-icon-size: 32px; - } - - mwc-button.active { - background: var(--primary-color); - --mdc-theme-primary: var(--text-primary-color); - border-radius: 4px; - } - `; - __decorate([ - e$3() - ], TimePicker.prototype, "hass", void 0); - __decorate([ - e$3({ type: Number }) - ], TimePicker.prototype, "stepSize", void 0); - __decorate([ - e$3() - ], TimePicker.prototype, "relativeMode", void 0); - __decorate([ - e$3() - ], TimePicker.prototype, "event", void 0); - __decorate([ - e$3() - ], TimePicker.prototype, "_time", void 0); - TimePicker = __decorate([ - n$4('time-picker') - ], TimePicker); - - const relToAbsTime = (timeStr, hass, options = {}) => { - const res = parseRelativeTime(timeStr); - if (!res) - return timeStr; - const sunEntity = hass.states['sun.sun']; - const ts_ref = res.event == 'sunrise' - ? stringToTime(sunEntity.attributes.next_rising, hass) - : stringToTime(sunEntity.attributes.next_setting, hass); - let ts = res.sign == '+' ? ts_ref + stringToTime(res.offset, hass) : ts_ref - stringToTime(res.offset, hass); - if (options.stepSize) - ts = roundTime(ts, options.stepSize); - return timeToString(ts); - }; - const absToRelTime = (timeStr, event, hass, options = {}) => { - const res = parseRelativeTime(timeStr); - if (res) - return timeStr; - const ts = stringToTime(timeStr, hass); - const sunEntity = hass.states['sun.sun']; - const ts_sunrise = stringToTime(sunEntity.attributes.next_rising, hass); - const ts_sunset = stringToTime(sunEntity.attributes.next_setting, hass); - if (!event) - event = Math.abs(ts - ts_sunrise) < Math.abs(ts - ts_sunset) ? ETimeEvent.Sunrise : ETimeEvent.Sunset; - const ts_ref = event == ETimeEvent.Sunrise - ? stringToTime(sunEntity.attributes.next_rising, hass) - : stringToTime(sunEntity.attributes.next_setting, hass); - let offset = ts - ts_ref; - if (options.stepSize) - offset = roundTime(offset, options.stepSize, { maxHours: 2 }); - return `${event}${offset > 0 ? '+' : '-'}${timeToString(Math.abs(offset))}`; - }; - - const SEC_PER_DAY = 86400; - const SEC_PER_HOUR = 3600; - let TimeslotEditor = class TimeslotEditor extends h$2 { - constructor() { - super(...arguments); - this.slots = []; - this.actions = []; - this.stepSize = 10; - this.isDragging = false; - this.currentTime = 0; - this.rangeMin = 0; //lower bound of zoomed timeframe - this.rangeMax = SEC_PER_DAY; //upper bound of zoomed timeframe - this.activeSlot = null; - this.activeMarker = null; - this.previousSlot = null; - this.timer = 0; - this.timeout = 0; - this.zoomFactor = 1; - } - firstUpdated() { - window.addEventListener('resize', () => { - clearTimeout(this.timeout); - this.timeout = window.setTimeout(() => { - this.requestUpdate(); - }, 50); - }); - } - render() { - if (!this.hass) - return T ``; - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - const width = (SEC_PER_DAY / (this.rangeMax - this.rangeMin)) * fullWidth; - const left = (-this.rangeMin / (this.rangeMax - this.rangeMin)) * fullWidth; - return T ` -
-
- ${this.renderSlots()} -
-
-
-
- ${this.renderTimes()} -
-
- = 24} - > - - ${this.hass.localize('ui.dialogs.helper_settings.input_select.add')} - - - - ${this.hass.localize('ui.common.delete')} - - `; - } - renderSlots() { - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - const width = (SEC_PER_DAY / (this.rangeMax - this.rangeMin)) * fullWidth; - const left = (-this.rangeMin / (this.rangeMax - this.rangeMin)) * fullWidth; - let start = left; - return this.slots.map((e, i) => { - const w = ((stringToTime(e.stop, this.hass) || SEC_PER_DAY) - - stringToTime(e.start, this.hass)) / - SEC_PER_DAY; - const actionText = this.computeActionDisplay(e) || ''; - const textWidth = (actionText || '').length * 5 + 10; - const leftMargin = start < 0 && start + w * width > 0 ? -start + 5 : 15; - const rightMargin = start + w * width > fullWidth && start < fullWidth - ? w * width - (fullWidth - start) + 5 - : 15; - const availableWidth = w * width - leftMargin - rightMargin; - start += w * width; - return T ` -
- ${i > 0 && (this.activeSlot === i || this.activeSlot === i - 1) - ? T ` -
-
- - -
-
- ` - : ''} - ${i > 0 ? this.renderTooltip(i) : ''} - - - ${actionText && - (availableWidth > textWidth / 3 || availableWidth > 50) && - availableWidth > 30 - ? actionText - : ''} - -
- `; - }); - } - renderTooltip(i) { - const res = parseRelativeTime(this.slots[i].start); - return T ` -
-
- ${res - ? T ` - - ${res.sign} - ${formatTime(stringToDate(res.offset), getLocale(this.hass), TimeFormat.twenty_four)} - ` - : formatTime(stringToDate(this.slots[i].start), getLocale(this.hass))} -
-
- `; - } - renderTimes() { - this._updateTooltips(); - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - const allowedStepSizes = [1, 2, 3, 4, 6, 8, 12]; - const segmentWidth = formatAmPm(getLocale(this.hass)) ? 55 : 40; - let stepSize = Math.ceil(24 / (fullWidth / segmentWidth)); - while (!allowedStepSizes.includes(stepSize)) - stepSize++; - const nums = [ - 0, - ...Array.from(Array(24 / stepSize - 1).keys()).map(e => (e + 1) * stepSize), - 24, - ]; - return nums.map(e => { - const isSpacer = e == 0 || e == 24; - const w = isSpacer ? (stepSize / 48) * 100 : (stepSize / 24) * 100; - return T ` -
- ${!isSpacer - ? formatTime(stringToDate(timeToString(e * SEC_PER_HOUR)), getLocale(this.hass)) - : ''} -
- `; - }); - } - computeActionDisplay(entry) { - if (!this.hass) - return; - if (!entry.actions) - return ''; - return unique(entry.actions.map(action => { - const actionConfig = this.actions.find(e => compareActions(e, action, true)); - if (!actionConfig) - return '???'; - if (actionConfig.variables && - Object.keys(actionConfig.variables).some(field => action.service_data && field in action.service_data)) { - return Object.entries(actionConfig.variables) - .filter(([field]) => action.service_data && field in action.service_data) - .map(([field, variable]) => { - const value = action.service_data[field]; - if (variable.type == EVariableType.Level) { - variable = variable; - return levelVariableDisplay(Number(value), variable); - } - else if (variable.type == EVariableType.List) { - variable = variable; - const listItem = variable.options.find(e => e.value == value); - return PrettyPrintName(listItem && listItem.name ? listItem.name : String(value)); - } - else - return ''; - }) - .join(', '); - } - return PrettyPrintName(actionConfig.name || - localize(`services.${action.service}`, getLocale(this.hass)) || - action.service); - })).join(', '); - } - _handleTouchStart(ev) { - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - const width = (SEC_PER_DAY / (this.rangeMax - this.rangeMin)) * fullWidth; - const left = (-this.rangeMin / (this.rangeMax - this.rangeMin)) * fullWidth; - const Toffset = (-left / width) * SEC_PER_DAY; - const marker = ev.target; - let el = marker; - while (!el.classList.contains('slot')) - el = el.parentElement; - const rightSlot = el; - const leftSlot = rightSlot.previousElementSibling; - const i = Number(leftSlot.getAttribute('slot')); - const Tmin = i > 0 ? stringToTime(this.slots[i].start, this.hass) + 60 * this.stepSize : 0; - const Tmax = i < this.slots.length - 2 - ? (stringToTime(this.slots[i + 1].stop, this.hass) || SEC_PER_DAY) - - 60 * this.stepSize - : SEC_PER_DAY; - this.isDragging = true; - const trackElement = rightSlot.parentElement - .parentElement; - const trackCoords = trackElement.getBoundingClientRect(); - let mouseMoveHandler = (ev) => { - let startDragX; - if (typeof TouchEvent !== 'undefined') { - if (ev instanceof TouchEvent) - startDragX = ev.changedTouches[0].pageX; - else - startDragX = ev.pageX; - } - else - startDragX = ev.pageX; - let x = startDragX - trackCoords.left; - if (x > fullWidth - 10) - x = fullWidth - 10; - if (x < 10) - x = 10; - let time = Math.round((x / width) * SEC_PER_DAY + Toffset); - if (time < Tmin) - time = Tmin; - if (time > Tmax) - time = Tmax; - this.currentTime = time; - const relTime = parseRelativeTime(this.slots[i].stop); - let timeString; - if (relTime) - timeString = absToRelTime(timeToString(time), relTime.event, this.hass, { - stepSize: this.stepSize, - }); - else { - time = - Math.round(time) >= SEC_PER_DAY ? SEC_PER_DAY : roundTime(time, this.stepSize); - timeString = timeToString(time); - } - if (timeString == this.slots[i].stop) - return; - this.slots = Object.assign(this.slots, { - [i]: Object.assign(Object.assign({}, this.slots[i]), { stop: timeString }), - [i + 1]: Object.assign(Object.assign({}, this.slots[i + 1]), { start: timeString }), - }); - this.requestUpdate(); - }; - const mouseUpHandler = () => { - window.removeEventListener('mousemove', mouseMoveHandler); - window.removeEventListener('touchmove', mouseMoveHandler); - window.removeEventListener('mouseup', mouseUpHandler); - window.removeEventListener('touchend', mouseUpHandler); - mouseMoveHandler = () => { - /**/ - }; - setTimeout(() => { - this.isDragging = false; - }, 100); - marker.blur(); - const myEvent = new CustomEvent('update', { detail: { entries: this.slots } }); - this.dispatchEvent(myEvent); - }; - window.addEventListener('mouseup', mouseUpHandler); - window.addEventListener('touchend', mouseUpHandler); - window.addEventListener('blur', mouseUpHandler); - window.addEventListener('mousemove', mouseMoveHandler); - window.addEventListener('touchmove', mouseMoveHandler); - } - _selectSlot(ev) { - if (this.isDragging) - return; - let el = ev.target; - if (el.tagName.toLowerCase() == 'span') - el = el.parentElement; - if (el.classList.contains('handle')) - el = el.parentElement; - const slot = Number(el.getAttribute('slot')); - if (this.activeSlot == slot && this.activeMarker === null) { - this.activeSlot = null; - //this.rangeMin = 0; - //this.rangeMax = SEC_PER_DAY; - this.previousSlot = null; - } - else { - this.previousSlot = this.activeSlot; - this.activeSlot = slot; - //this._calculateZoom(); - } - this.activeMarker = null; - this._updateZoom(); - const myEvent = new CustomEvent('update', { detail: { entry: this.activeSlot } }); - this.dispatchEvent(myEvent); - } - _calculateZoom() { - const slot = Number(this.activeSlot); - let min = stringToTime(this.slots[slot].start, this.hass); - let max = stringToTime(this.slots[slot].stop, this.hass) || SEC_PER_DAY; - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - min -= (max - min) / 3; - max += (max - min) / 3; - if (((max - min) / SEC_PER_DAY) * fullWidth >= 100) { - min = 0; - max = SEC_PER_DAY; - } - else { - if (min < 0) - max -= min; - if (max > SEC_PER_DAY) - min -= max - SEC_PER_DAY; - } - this.rangeMin = min > 0 ? min : 0; - this.rangeMax = max < SEC_PER_DAY ? max : SEC_PER_DAY; - clearInterval(this.timer); - clearTimeout(this.timeout); - this.timer = window.setInterval(() => { - this._updateTooltips(); - }, 50); - this.timeout = window.setTimeout(() => { - clearInterval(this.timer); - this._updateTooltips(); - }, 230); - } - _addSlot() { - if (this.activeSlot === null) - return; - const activeSlot = this.slots[this.activeSlot]; - const startTime = stringToTime(activeSlot.start, this.hass); - let endTime = stringToTime(activeSlot.stop, this.hass); - if (endTime < startTime) - endTime += SEC_PER_DAY; - const newStop = roundTime(startTime + (endTime - startTime) / 2, this.stepSize); - this.slots = [ - ...this.slots.slice(0, this.activeSlot), - Object.assign(Object.assign({}, this.slots[this.activeSlot]), { stop: timeToString(newStop) }), - Object.assign(Object.assign({}, this.slots[this.activeSlot]), { start: timeToString(newStop), stop: timeToString(endTime), actions: [] }), - ...this.slots.slice(this.activeSlot + 1), - ]; - this._updateZoom(); - const myEvent = new CustomEvent('update', { detail: { entries: this.slots } }); - this.dispatchEvent(myEvent); - } - _removeSlot() { - if (this.activeSlot === null) - return; - const cutIndex = this.activeSlot == this.slots.length - 1 ? this.activeSlot - 1 : this.activeSlot; - this.slots = [ - ...this.slots.slice(0, cutIndex), - Object.assign(Object.assign({}, this.slots[cutIndex + 1]), { start: this.slots[cutIndex].start, stop: this.slots[cutIndex + 1].stop }), - ...this.slots.slice(cutIndex + 2), - ]; - if (this.activeSlot == this.slots.length) - this.activeSlot--; - this._updateZoom(); - const myEvent = new CustomEvent('update', { detail: { entries: this.slots } }); - this.dispatchEvent(myEvent); - } - _updateTooltips() { - var _a; - const fullWidth = parseFloat(getComputedStyle(this).getPropertyValue('width')); - const tooltips = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.tooltip'); - const getBounds = (el) => { - const width = el.offsetWidth; - const left = el.parentElement.offsetLeft + el.offsetLeft - 15; - if (el.parentElement.classList.contains('left')) - return [left + width / 2, left + (3 * width) / 2]; - else if (el.parentElement.classList.contains('right')) - return [left - width / 2, left + width / 2]; - return [left, left + width]; - }; - tooltips === null || tooltips === void 0 ? void 0 : tooltips.forEach((tooltip, i) => { - const container = tooltip.parentElement; - const visible = container.classList.contains('visible'); - const slot = Number(container.parentElement.getAttribute('slot')); - if (slot != this.activeSlot && slot - 1 != this.activeSlot) { - if (visible) - container.classList.remove('visible'); - } - else { - const left = tooltip.parentElement.offsetLeft; - if (left < 0 || left > fullWidth + 15) { - if (visible) - container.classList.remove('visible'); - } - else { - if (!visible) - container.classList.add('visible'); - const width = container.offsetWidth; - const isCenter = container.classList.contains('center'); - let marginLeft = getBounds(tooltip)[0], marginRight = fullWidth - getBounds(tooltip)[1]; - if (i > 0 && slot - 1 == this.activeSlot) - marginLeft -= getBounds(tooltips[i - 1])[1]; - else if (i + 1 < tooltips.length && slot == this.activeSlot) { - const w = getBounds(tooltips[i + 1])[0]; - marginRight -= w < 0 ? 0 : fullWidth - w; - } - //console.log(`tooltip ${i} marginLeft ${marginLeft} marginRight ${marginRight}`); - if (marginLeft < marginRight) { - if (marginLeft < 0) { - if (isCenter && marginRight > width / 2) { - container.classList.add('right'); - container.classList.remove('center'); - container.classList.remove('left'); - } - } - else { - container.classList.add('center'); - container.classList.remove('right'); - container.classList.remove('left'); - } - } - else { - if (marginRight < 0) { - if (isCenter && marginLeft > width / 2) { - container.classList.add('left'); - container.classList.remove('center'); - container.classList.remove('right'); - } - } - else { - container.classList.add('center'); - container.classList.remove('left'); - container.classList.remove('right'); - } - } - } - } - }); - } - _updateZoom() { - // let center = SEC_PER_DAY / 2; - // if (this.activeSlot !== null) { - // const activeSlot = this.slots[this.activeSlot]; - // let min = stringToTime(activeSlot.start, this.hass!); - // let max = stringToTime(activeSlot.stop!, this.hass!) || SEC_PER_DAY; - // center = Math.round((max + min) / 2); - // } - // let timeSpan = SEC_PER_DAY; - // if (this.zoomFactor == 2) timeSpan = SEC_PER_DAY / 2; - // else if (this.zoomFactor == 3) timeSpan = SEC_PER_DAY / 4; - // else if (this.zoomFactor == 4) timeSpan = SEC_PER_DAY / 8; - // let min = center - Math.round(timeSpan / 2); - // let max = center + Math.round(timeSpan / 2); - // if (min < 0) { - // max += -min; - // min = 0; - // if (max > SEC_PER_DAY) max = SEC_PER_DAY; - // } else if (max > SEC_PER_DAY) { - // min -= max - SEC_PER_DAY; - // max = SEC_PER_DAY; - // if (min < 0) min = 0; - // } - // this.rangeMin = min; - // this.rangeMax = max; - clearInterval(this.timer); - clearTimeout(this.timeout); - this.timer = window.setInterval(() => { - this._updateTooltips(); - }, 50); - this.timeout = window.setTimeout(() => { - clearInterval(this.timer); - this._updateTooltips(); - }, 230); - } - // private _zoomIn() { - // this.zoomFactor++; - // this._updateZoom(); - // } - // private _zoomOut() { - // this.zoomFactor--; - // this._updateZoom(); - // } - _selectMarker(ev, enable = true) { - ev.stopImmediatePropagation(); - let el = ev.target; - while (!el.classList.contains('slot')) - el = el.parentElement; - const slot = Number(el.getAttribute('slot')); - if (enable && this.activeMarker === slot) - this.activeMarker = null; - else - this.activeMarker = enable ? slot : null; - const myEvent = new CustomEvent('update', { - detail: { entry: this.activeSlot, marker: this.activeMarker }, - }); - this.dispatchEvent(myEvent); - this._updateTooltips(); - } - static get styles() { - return i ` - :host { - display: block; - max-width: 100%; - overflow: hidden; - } - div.outer { - width: 100%; - overflow-x: hidden; - overflow-y: hidden; - border-radius: 5px; - } - div.wrapper, - div.time-wrapper { - white-space: nowrap; - transition: width 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67), - margin 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67); - } - .slot { - float: left; - background: rgba(var(--rgb-primary-color), 0.7); - height: 60px; - cursor: pointer; - box-sizing: border-box; - transition: background 0.1s cubic-bezier(0.17, 0.67, 0.83, 0.67); - } - .wrapper.selectable .slot:hover { - background: rgba(var(--rgb-primary-color), 0.85); - } - .slot:not(:first-child) { - border-left: 1px solid var(--card-background-color); - } - .slot:not(:last-child) { - border-right: 1px solid var(--card-background-color); - } - .slot.active { - background: rgba(var(--rgb-accent-color), 0.7); - } - .slot.noborder { - border: none; - } - .wrapper.selectable .slot.active:hover { - background: rgba(var(--rgb-accent-color), 0.85); - } - div.time-wrapper div { - float: left; - display: flex; - position: relative; - height: 25px; - line-height: 25px; - font-size: 12px; - text-align: center; - align-content: center; - align-items: center; - justify-content: center; - } - div.time-wrapper div.time:before { - content: ' '; - background: var(--disabled-text-color); - position: absolute; - left: 0px; - top: 0px; - width: 1px; - height: 5px; - margin-left: 50%; - margin-top: 0px; - } - .slot span { - font-size: 14px; - color: var(--text-primary-color); - height: 100%; - display: flex; - align-content: center; - align-items: center; - justify-content: center; - transition: margin 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67); - word-break: break-all; - white-space: normal; - overflow: hidden; - line-height: 1em; - } - div.handle { - display: flex; - height: 100%; - width: 36px; - margin-left: -19px; - margin-bottom: -60px; - align-content: center; - align-items: center; - justify-content: center; - } - div.button-holder { - background: var(--card-background-color); - border-radius: 50%; - width: 24px; - height: 24px; - display: flex; - visibility: hidden; - animation: 0.2s fadeIn; - animation-fill-mode: forwards; - } - ha-icon-button { - --mdc-icon-button-size: 36px; - margin-top: -6px; - margin-left: -6px; - } - @keyframes fadeIn { - 99% { - visibility: hidden; - } - 100% { - visibility: visible; - } - } - div.tooltip-container { - position: absolute; - margin-top: -28px; - margin-left: -40px; - width: 80px; - height: 26px; - display: flex; - text-align: center; - display: none; - } - div.tooltip-container.visible { - display: block; - } - div.tooltip-container.left { - margin-left: -80px; - text-align: right; - } - div.tooltip-container.right { - margin-left: 0px; - text-align: left; - } - div.tooltip { - display: inline-flex; - margin: 0px auto; - border-radius: 5px; - color: var(--text-primary-color); - font-size: 1em; - padding: 0px 5px; - text-align: center; - line-height: 26px; - z-index: 1; - transition: all 0.1s ease-in; - transform-origin: center bottom; - --tooltip-color: var(--primary-color); - background: var(--tooltip-color); - } - div.tooltip.active { - --tooltip-color: rgba(var(--rgb-accent-color), 0.7); - } - div.tooltip-container.left div.tooltip { - transform-origin: right bottom; - } - div.tooltip-container.right div.tooltip { - transform-origin: left bottom; - } - div.tooltip-container.center div.tooltip:before { - content: ' '; - width: 0px; - height: 0px; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-top: 10px solid var(--tooltip-color); - position: absolute; - margin-top: 25px; - margin-left: calc(50% - 6px); - top: 0px; - left: 0px; - } - div.tooltip-container.left div.tooltip:before { - content: ' '; - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - border-right: 8px solid var(--tooltip-color); - opacity: 1; - position: absolute; - margin-top: 15px; - margin-left: calc(100% - 8px); - left: 0px; - top: 0px; - width: 0px; - height: 0px; - } - div.tooltip-container.right div.tooltip:before { - content: ' '; - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - border-left: 8px solid var(--tooltip-color); - opacity: 1; - position: absolute; - margin-top: 15px; - margin-left: 0px; - left: 0px; - top: 0px; - width: 0px; - height: 0px; - } - div.tooltip ha-icon { - --mdc-icon-size: 20px; - } - mwc-button ha-icon { - margin-right: 11px; - } - `; - } - }; - __decorate([ - e$3() - ], TimeslotEditor.prototype, "hass", void 0); - __decorate([ - e$3({ type: Array }) - ], TimeslotEditor.prototype, "slots", void 0); - __decorate([ - e$3({ type: Array }) - ], TimeslotEditor.prototype, "actions", void 0); - __decorate([ - e$3({ type: Number }) - ], TimeslotEditor.prototype, "stepSize", void 0); - __decorate([ - e$3() - ], TimeslotEditor.prototype, "rangeMin", void 0); - __decorate([ - e$3() - ], TimeslotEditor.prototype, "rangeMax", void 0); - __decorate([ - e$3() - ], TimeslotEditor.prototype, "activeSlot", void 0); - __decorate([ - e$3() - ], TimeslotEditor.prototype, "activeMarker", void 0); - __decorate([ - e$4({ passive: true }) - ], TimeslotEditor.prototype, "_handleTouchStart", null); - TimeslotEditor = __decorate([ - n$4('timeslot-editor') - ], TimeslotEditor); - - const loadHaForm = async () => { - if (customElements.get("ha-checkbox") && customElements.get("ha-slider")) return; - await customElements.whenDefined("partial-panel-resolver"); - const ppr = document.createElement('partial-panel-resolver'); - ppr.hass = { - panels: [{ - url_path: "tmp", - component_name: "config" - }] - }; - - ppr._updateRoutes(); - - await ppr.routerOptions.routes.tmp.load(); - await customElements.whenDefined("ha-panel-config"); - const cpr = document.createElement("ha-panel-config"); - await cpr.routerOptions.routes.automation.load(); - }; - - let VariableSlider = class VariableSlider extends h$2 { - constructor() { - super(...arguments); - this.min = 0; - this.max = 255; - this.step = 1; - this.scaleFactor = 1; - this.unit = ''; - this.optional = false; - this.disabled = false; - this._displayedValue = 0; - } - //raw value - set value(value) { - value = isNaN(value) ? this.min : this._roundedValue(value / this.scaleFactor); - this._displayedValue = value; - } - firstUpdated() { - (async () => await loadHaForm())(); - if (this.disabled && !this.optional) { - this.disabled = false; - this.requestUpdate(); - } - } - render() { - return T ` -
-
- ${this.getCheckbox()} -
-
- ${this.getSlider()} -
-
- ${this._displayedValue}${this.unit} -
-
- `; - } - getSlider() { - if (!this.disabled) { - return T ` - - `; - } - else { - return T ` - - `; - } - } - getCheckbox() { - if (!this.optional) - return T ``; - return T ` - - `; - } - toggleChecked(e) { - const checked = e.target.checked; - this.disabled = !checked; - const value = this.disabled ? null : this._scaledValue(this._displayedValue); - A$1(this, 'value-changed', { value: value }); - } - _updateValue(e) { - let value = Number(e.target.value); - this._displayedValue = value; - value = this._scaledValue(this._displayedValue); - A$1(this, 'value-changed', { value: value }); - } - _roundedValue(value) { - value = Math.round(value / this.step) * this.step; - value = parseFloat(value.toPrecision(12)); - if (value > this.max) - value = this.max; - else if (value < this.min) - value = this.min; - return value; - } - _scaledValue(value) { - value = this._roundedValue(value); - value = value * this.scaleFactor; - value = parseFloat(value.toFixed(2)); - return value; - } - }; - VariableSlider.styles = i ` - ${commonStyle} :host { - width: 100%; - } - ha-slider { - width: 100%; - --paper-slider-pin-start-color: var(--primary-color); - } - `; - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "min", void 0); - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "max", void 0); - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "step", void 0); - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "value", null); - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "scaleFactor", void 0); - __decorate([ - e$3({ type: String }) - ], VariableSlider.prototype, "unit", void 0); - __decorate([ - e$3({ type: Boolean }) - ], VariableSlider.prototype, "optional", void 0); - __decorate([ - e$3({ type: Boolean }) - ], VariableSlider.prototype, "disabled", void 0); - __decorate([ - e$3({ type: Number }) - ], VariableSlider.prototype, "_displayedValue", void 0); - VariableSlider = __decorate([ - n$4('variable-slider') - ], VariableSlider); - - let SchedulerVariablePicker = class SchedulerVariablePicker extends h$2 { - firstUpdated() { - var _a; - if ((this.value === null || this.value === undefined) && - ((_a = this.variable) === null || _a === void 0 ? void 0 : _a.type) == EVariableType.Level && - !this.variable.optional) - this.levelVariableUpdated(this.variable.min); - } - render() { - if (!this.variable) - return T ``; - else if (this.variable.type == EVariableType.Level) - return this.renderLevelVariable(); - else if (this.variable.type == EVariableType.List) - return this.renderListVariable(); - else if (this.variable.type == EVariableType.Text) - return this.renderTextVariable(); - else - return T ``; - } - levelVariableUpdated(ev) { - const value = typeof ev == 'number' ? ev : Number(ev.detail.value); - this.value = value; - A$1(this, 'value-changed', { value: value }); - } - renderLevelVariable() { - const variable = this.variable; - const value = Number(this.value); - return T ` - - - `; - } - listVariableUpdated(ev) { - const value = typeof ev == 'string' ? ev : String(ev.target.value); - this.value = value; - A$1(this, 'value-changed', { value: value }); - } - renderListVariable() { - const variable = this.variable; - const options = variable.options; - const value = String(this.value) || null; - if (options.length == 1 && value != options[0].value) - this.listVariableUpdated(options[0].value); - return T ` - - `; - } - renderTextVariable() { - const variable = this.variable; - const value = this.value; - return T ` - - - `; - } - }; - __decorate([ - e$3() - ], SchedulerVariablePicker.prototype, "variable", void 0); - __decorate([ - e$3() - ], SchedulerVariablePicker.prototype, "value", void 0); - SchedulerVariablePicker = __decorate([ - n$4('scheduler-variable-picker') - ], SchedulerVariablePicker); - - let DialogDeleteConfirm = class DialogDeleteConfirm extends h$2 { - async showDialog(params) { - this._params = params; - await this.updateComplete; - } - async closeDialog() { - if (this._params) - this._params.cancel(); - this._params = undefined; - } - render() { - if (!this._params) - return T ``; - return T ` - -
- - - - ${this.hass.localize('ui.dialogs.more_info_control.restored.confirm_remove_title')} - - -
-
- ${this.hass.localize('ui.dialogs.more_info_control.restored.confirm_remove_text')} -
- - - ${this.hass.localize('ui.dialogs.generic.cancel')} - - - ${this.hass.localize('ui.dialogs.generic.ok')} - -
- `; - } - confirmClick() { - this._params.confirm(); - } - cancelClick() { - this._params.cancel(); - } - static get styles() { - return i ` - div.wrapper { - color: var(--primary-text-color); - } - `; - } - }; - __decorate([ - e$3({ attribute: false }) - ], DialogDeleteConfirm.prototype, "hass", void 0); - __decorate([ - r$3() - ], DialogDeleteConfirm.prototype, "_params", void 0); - DialogDeleteConfirm = __decorate([ - n$4('dialog-delete-confirm') - ], DialogDeleteConfirm); - - var dialogDeleteConfirm = /*#__PURE__*/Object.freeze({ - __proto__: null, - get DialogDeleteConfirm () { return DialogDeleteConfirm; } - }); - - function startOfWeek(locale) { - const parts = locale.match(/^([a-z]{2,3})(?:-([a-z]{3})(?=$|-))?(?:-([a-z]{4})(?=$|-))?(?:-([a-z]{2}|\d{3})(?=$|-))?/i); - const language = parts[1]; - const region = parts[4]; - const regionSat = 'AEAFBHDJDZEGIQIRJOKWLYOMQASDSY'.match(/../g); - const regionSun = 'AGARASAUBDBRBSBTBWBZCACNCODMDOETGTGUHKHNIDILINJMJPKEKHKRLAMHMMMOMTMXMZNINPPAPEPHPKPRPTPYSASGSVTHTTTWUMUSVEVIWSYEZAZW'.match(/../g); - const languageSat = ['ar', 'arq', 'arz', 'fa']; - const languageSun = 'amasbndzengnguhehiidjajvkmknkolomhmlmrmtmyneomorpapssdsmsnsutatethtnurzhzu'.match(/../g); - if (region) - return regionSun.includes(region) ? 'sun' : regionSat.includes(region) ? 'sat' : 'mon'; - else - return languageSun.includes(language) ? 'sun' : languageSat.includes(language) ? 'sat' : 'mon'; + div.summary-entity { + grid-area: entity; } - - const assignAction = (entity_id, action) => { - let output = { - entity_id: entity_id, - service: action.service, - service_data: Object.assign({}, action.service_data), - }; - Object.entries(action.variables || {}).forEach(([key, config]) => { - const serviceArgs = Object.keys(output.service_data || {}); - if (serviceArgs.includes(key)) - return; - if (config.type == EVariableType.Level) { - config = config; - output = Object.assign(Object.assign({}, output), { service_data: config.optional - ? omit(output.service_data || {}, key) - : Object.assign(Object.assign({}, output.service_data), { [key]: parseFloat((config.min * config.scale_factor).toPrecision(12)) || 0 }) }); - } - else if (config.type == EVariableType.List) { - config = config; - output = Object.assign(Object.assign({}, output), { service_data: Object.assign(Object.assign({}, output.service_data), { [key]: config.options.length ? config.options[0].value : undefined }) }); - } - else if (config.type == EVariableType.Text) { - config = config; - output = Object.assign(Object.assign({}, output), { service_data: Object.assign(Object.assign({}, output.service_data), { [key]: '' }) }); - } - }); - return output; - }; - - let SchedulerTimepickerCard = class SchedulerTimepickerCard extends h$2 { - constructor() { - super(...arguments); - this.activeEntry = null; - this.activeMarker = null; - this.timeslots = false; - this.editItem = false; - } - firstUpdated() { - if (!this.actions || !this.hass) - return; - if (!this.timeslots) - this.activeEntry = 0; - const actions = this.actions.map(e => { - const action = Object.assign(Object.assign({}, e), { service_data: omit(e.service_data || {}, ...Object.keys(e.variables || {})) }); - return Object.assign(e, { - name: computeActionDisplay(action), - }); - }); - actions.sort(sortAlphabetically); - this.actions = actions; - } - render() { - if (!this.hass || !this.config || !this.entities || !this.actions) - return T ``; - return T ` - -
-
- ${this.config.title - ? typeof this.config.title == 'string' - ? this.config.title - : localize('ui.panel.common.title', getLocale(this.hass)) - : ''} -
- -
-
-
${this.hass.localize('ui.panel.config.automation.editor.actions.name')}
- ${this.renderSummary()} - ${!this.timeslots - ? T ` - ${this.getVariableEditor()} ${this.renderDays()} -
${this.hass.localize('ui.dialogs.helper_settings.input_datetime.time')}
- this.updateActiveEntry({ start: ev.target.value })} - > - - ` - : T ` - ${this.renderDays()} -
${localize('ui.panel.time_picker.time_scheme', getLocale(this.hass))}
- - - - - ${this.renderMarkerOptions()} ${this.renderActions()} ${this.getVariableEditor()} - `} -
-
- e.actions.length).length} - > - ${this.hass.localize('ui.common.save')} - - ${this.editItem - ? T ` - ${this.hass.localize('ui.common.delete')} - ` - : ''} - ${this.hass.localize('ui.dialogs.helper_settings.input_select.options')} -
-
- `; - } - renderSummary() { - if (!this.entities || !this.actions) - return T ``; - return T ` -
-
- ${this.entities.map(entity => T ` -
- - ${capitalize(PrettyPrintName(entity.name || this.hass.states[entity.id].attributes.friendly_name || b$1(entity.id)))} -
- `)} -
-
- -
-
- ${this.timeslots - ? T ` -
- - ${capitalize(localize('ui.panel.entity_picker.make_scheme', getLocale(this.hass)))} -
- ` - : T ` -
- - ${capitalize(this.actions[0].name || b$1(this.actions[0].service))} -
- `} -
-
- `; - } - renderDays() { - if (!this.hass) - return T ``; - let weekdays = Array.from(Array(7).keys()); - const firstWeekday = startOfWeek(this.hass.language); - const shiftCount = weekdays.length - weekdayArray.findIndex(e => e.substr(0, 3) == firstWeekday); - weekdays = [...weekdays.slice(-shiftCount), ...weekdays.slice(0, -shiftCount)]; - const DayOptions = weekdays.map(e => Object({ value: weekdayArray[e].substr(0, 3), name: formatWeekday(e, getLocale(this.hass), true) })); - const DayTypeOptions = [ - { value: EDayType.Daily, name: localize('ui.components.date.day_types_short.daily', getLocale(this.hass)) }, - { value: EDayType.Workday, name: localize('ui.components.date.day_types_short.workdays', getLocale(this.hass)) }, - { value: EDayType.Weekend, name: localize('ui.components.date.day_types_short.weekend', getLocale(this.hass)) }, - { - value: EDayType.Custom, - name: this.hass.localize('ui.panel.config.automation.editor.actions.type.choose.label'), - }, - ]; - return T ` -
${localize('ui.components.date.days', getLocale(this.hass))}
- - - ${weekdayType(this.schedule.weekdays) == EDayType.Custom - ? T ` -
- - -
- ` - : ''} - `; - } - renderActions() { - var _a; - if (!this.hass || this.activeMarker !== null) - return; - const selectedAction = this.activeEntry !== null && this.schedule.timeslots[this.activeEntry].actions.length - ? this.schedule.timeslots[this.activeEntry].actions[0] - : null; - return T ` -
${this.hass.localize('ui.panel.config.automation.editor.actions.name')}
- compareActions(e, selectedAction, true)) : null} - optional="true" - @change=${this.selectAction} - > - ${localize('ui.panel.time_picker.no_timeslot_selected', getLocale(this.hass))} - - `; - } - renderMarkerOptions() { - if (!this.hass || !this.config || this.activeMarker === null) - return; - const value = this.schedule.timeslots[this.activeMarker].start; - const res = parseRelativeTime(value); - const deltaSunrise = stringToTime(value, this.hass) - stringToTime('sunrise+00:00', this.hass), deltaSunset = stringToTime(value, this.hass) - stringToTime('sunset+00:00', this.hass); - const markerOptions = [ - { - value: 'time', - name: this.hass.localize('ui.panel.config.automation.editor.triggers.type.time.at'), - icon: 'hass:clock-outline', - }, - { - value: ETimeEvent.Sunrise, - name: this.hass.localize('ui.panel.config.automation.editor.conditions.type.sun.sunrise'), - icon: 'hass:weather-sunny', - disabled: Math.abs(deltaSunrise) > 7200, - }, - { - value: ETimeEvent.Sunset, - name: this.hass.localize('ui.panel.config.automation.editor.conditions.type.sun.sunset'), - icon: 'hass:weather-night', - disabled: Math.abs(deltaSunset) > 7200, - }, - ]; - return T ` -
${localize('ui.panel.time_picker.time_input_mode', getLocale(this.hass))}
- - - `; - } - updateMarkerSetting(ev) { - const value = ev.target.value; - const ts = this.schedule.timeslots[this.activeMarker].start; - const res = value == 'time' - ? relToAbsTime(ts, this.hass, { stepSize: this.config.time_step }) - : absToRelTime(ts, value, this.hass, { stepSize: this.config.time_step }); - let timeslots = [...this.schedule.timeslots]; - timeslots = Object.assign(timeslots, { - [this.activeMarker - 1]: Object.assign(Object.assign({}, this.schedule.timeslots[this.activeMarker - 1]), { stop: res }), - [this.activeMarker]: Object.assign(Object.assign({}, this.schedule.timeslots[this.activeMarker]), { start: res }), - }); - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: [...timeslots] }); - } - updateActiveEntry(data) { - if (this.activeEntry === null) - return; - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: Object.assign([...this.schedule.timeslots], { - [this.activeEntry]: Object.assign(Object.assign({}, this.schedule.timeslots[this.activeEntry]), data), - }) }); - } - updateActiveEntryAction(data, num) { - if (this.activeEntry === null) - return; - if (data && 'service' in data) { - this.updateActiveEntry({ - actions: Object.assign([...this.schedule.timeslots[this.activeEntry].actions], { - [num]: Object.assign(Object.assign({}, this.schedule.timeslots[this.activeEntry].actions[num]), data), - }), - }); - } - else if (data) { - //update service_data - Object.entries(data).forEach(([key, val]) => { - let actionConfig = [...this.schedule.timeslots[this.activeEntry].actions]; - let serviceData = typeof val == 'object' && key in this.schedule.timeslots[this.activeEntry].actions[num] - ? Object.assign(Object.assign({}, actionConfig[num][key]), val) : val; - const invalidParams = Object.keys(serviceData).filter(e => serviceData[e] === null); - if (invalidParams.length) - serviceData = omit(serviceData, ...invalidParams); - actionConfig = Object.assign(actionConfig, { - [num]: Object.assign(Object.assign({}, actionConfig[num]), { [key]: serviceData }), - }); - this.updateActiveEntry({ actions: actionConfig }); - }); - } - else { - this.updateActiveEntry({ - actions: [...this.schedule.timeslots[this.activeEntry].actions].filter((_, i) => i != num), - }); - } - } - handlePlannerUpdate(ev) { - if (ev.detail.hasOwnProperty('entries')) { - const entries = ev.detail.entries; - if (entries.length < this.schedule.timeslots.length && this.activeEntry == this.schedule.timeslots.length - 1) - this.activeEntry = this.schedule.timeslots.length - 2; - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: [...entries] }); - } - else if (ev.detail.hasOwnProperty('entry')) { - this.activeMarker = null; - this.activeEntry = ev.detail.entry !== null ? Number(ev.detail.entry) : null; - } - if (ev.detail.hasOwnProperty('marker')) { - this.activeEntry = null; - this.activeMarker = ev.detail.marker !== null ? Number(ev.detail.marker) : null; - } - } - selectAction(ev) { - if (!this.actions || this.activeEntry === null) - return; - const action = ev.detail; - if (action) { - this.entities.map(e => e.id).forEach((entity_id, num) => { - this.updateActiveEntryAction(assignAction(entity_id, action), num); - }); - } - else { - this.entities.forEach((_, num) => { - this.updateActiveEntryAction(null, num); - }); - } - } - getVariableEditor() { - if (this.activeEntry === null || !this.actions) - return T ``; - const actions = []; - this.schedule.timeslots[this.activeEntry].actions.forEach(action => { - action = omit(action, 'entity_id'); - if (!this.actions.find(e => compareActions(e, action, true) && Object.keys(e.variables || {}).length)) - return; - if (!actions.some(e => isEqual(e, action))) - actions.push(action); - }); - return actions.map(action => { - return Object.entries(this.actions.find(e => compareActions(e, action, true)).variables).map(([field, variable]) => { - return T ` -
- ${variable.name || PrettyPrintName(field)} -
- this.entities.forEach((_, num) => { - this.updateActiveEntryAction({ - service_data: { [field]: ev.detail.value }, - }, num); - })} - > - ${this.hass.localize('ui.dialogs.helper_settings.input_select.no_options')} - - `; - }); - }); - } - selectDays(ev) { - const value = ev.target.value; - let weekdays = this.schedule.weekdays; - if (Object.values(EDayType).includes(value)) { - switch (value) { - case EDayType.Daily: - weekdays = ['daily']; - break; - case EDayType.Workday: - weekdays = ['workday']; - break; - case EDayType.Weekend: - weekdays = ['weekend']; - break; - case EDayType.Custom: - weekdays = []; - break; - } - } - else { - weekdays = value; - } - this.schedule = Object.assign(Object.assign({}, this.schedule), { weekdays: weekdays }); - } - cancelClick() { - const myEvent = new CustomEvent('cancelClick'); - this.dispatchEvent(myEvent); - } - saveClick() { - const myEvent = new CustomEvent('saveClick', { detail: this.schedule }); - this.dispatchEvent(myEvent); - } - optionsClick() { - const myEvent = new CustomEvent('optionsClick', { detail: this.schedule }); - this.dispatchEvent(myEvent); - } - editActionClick() { - const myEvent = new CustomEvent('editActionClick', { detail: this.schedule }); - this.dispatchEvent(myEvent); - } - async deleteClick(ev) { - const element = ev.target; - const result = await new Promise(resolve => { - A$1(element, 'show-dialog', { - dialogTag: 'dialog-delete-confirm', - dialogImport: () => Promise.resolve().then(function () { return dialogDeleteConfirm; }), - dialogParams: { - cancel: () => { - resolve(false); - }, - confirm: () => { - resolve(true); - }, - }, - }); - }); - if (result) { - const myEvent = new CustomEvent('deleteClick'); - this.dispatchEvent(myEvent); - } - } - }; - SchedulerTimepickerCard.styles = i ` - ${commonStyle} - div.summary { - display: grid; - grid-template-columns: 1fr max-content 1fr; - grid-template-areas: 'entity arrow action'; - grid-auto-flow: column; - grid-gap: 5px; - } - - div.summary-entity { - grid-area: entity; - } - div.summary-action { - grid-area: action; - } - div.summary-arrow { - grid-area: arrow; - color: var(--secondary-text-color); - display: flex; - justify-content: center; - align-items: center; - } - div.summary-entity, - div.summary-action { - color: var(--dark-primary-color); - padding: 5px; - font-size: 14px; - font-weight: 500; - --mdc-icon-size: 20px; - position: relative; - display: flex; - flex-direction: column; - cursor: pointer; - background: rgba(var(--rgb-primary-color), 0.15); - border-radius: 4px; - align-items: center; - } - div.summary-entity div, - div.summary-action div { - display: flex; - flex-grow: 1; - margin: 5px; - width: 100%; - align-items: center; - } - div.summary-entity ha-icon, - div.summary-action ha-icon { - display: flex; - flex: 0 0 30px; - } - `; - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "hass", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "config", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "schedule", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "actions", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "entities", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "activeEntry", void 0); - __decorate([ - e$3() - ], SchedulerTimepickerCard.prototype, "activeMarker", void 0); - __decorate([ - e$3({ type: Boolean }) - ], SchedulerTimepickerCard.prototype, "timeslots", void 0); - __decorate([ - e$3({ type: Boolean }) - ], SchedulerTimepickerCard.prototype, "editItem", void 0); - SchedulerTimepickerCard = __decorate([ - n$4('scheduler-timepicker-card') - ], SchedulerTimepickerCard); - - let SchedulerSelect = class SchedulerSelect extends h$2 { - constructor() { - super(...arguments); - this.label = ''; - this.items = []; - this.clearable = false; - this.icons = false; - this.disabled = false; - this.allowCustomValue = false; - this.invalid = false; - this.rowRenderer = (root, _owner, entry) => { - if (!root.firstElementChild && this.icons) { - root.innerHTML = ` - - - - -
-
-
-
- `; - root.querySelector('.name').textContent = entry.item.name; - root.querySelector('[secondary]').textContent = entry.item.description || ''; - root.querySelector('ha-icon').icon = entry.item.icon; - } - else if (!root.firstElementChild) { - root.innerHTML = ` - - - - ${entry.item.name} - - - `; - } - }; - } - open() { - this.updateComplete.then(() => { - var _a, _b; - (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('vaadin-combo-box-light')) === null || _b === void 0 ? void 0 : _b.open(); - }); - } - focus() { - this.updateComplete.then(() => { - var _a; - ((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('paper-input')).focus(); - }); - } - shouldUpdate(changedProps) { - if (changedProps.get('items')) { - if (!isEqual(this.items, changedProps.get('items'))) - this.firstUpdated(); - else if (changedProps.size == 1) - return false; - } - return true; - } - firstUpdated() { - (async () => await loadHaForm())(); - this._comboBox.items = this.items; - } - render() { - return T ` - - - ${isDefined(this._value) && this.items.find(e => e.value == this._value) - ? T ` - ${this.icons - ? T ` - - ` - : ''} - ${this.clearable - ? T ` - - - ` - : ''} - ` - : ''} - - - - - `; - } - _clearValue(ev) { - ev.stopPropagation(); - this._setValue(''); - } - get _value() { - return isDefined(this.value) ? this.value : ''; - } - _openedChanged(ev) { - this._opened = ev.detail.value; - } - _valueChanged(ev) { - const newValue = ev.detail.value; - if (newValue !== this._value) { - this._setValue(newValue); - } - } - _setValue(value) { - this.value = value; - setTimeout(() => { - A$1(this, 'value-changed', { value }); - }, 0); - } - static get styles() { - return i ` - :host { - line-height: 1em; - } - paper-input > ha-icon-button { - --mdc-icon-button-size: 24px; - padding: 2px; - color: var(--secondary-text-color); - } - [hidden] { - display: none; - } - paper-input > ha-icon { - display: flex; - flex: 0 0 40px; - color: var(--state-icon-color); - width: 40px; - height: 26px; - align-items: center; - } - `; - } - }; - __decorate([ - e$3() - ], SchedulerSelect.prototype, "label", void 0); - __decorate([ - e$3() - ], SchedulerSelect.prototype, "value", void 0); - __decorate([ - e$3() - ], SchedulerSelect.prototype, "items", void 0); - __decorate([ - e$3() - ], SchedulerSelect.prototype, "clearable", void 0); - __decorate([ - e$3() - ], SchedulerSelect.prototype, "icons", void 0); - __decorate([ - e$3({ type: Boolean }) - ], SchedulerSelect.prototype, "disabled", void 0); - __decorate([ - r$3() - ], SchedulerSelect.prototype, "_opened", void 0); - __decorate([ - e$3({ attribute: 'allow-custom-value', type: Boolean }) - ], SchedulerSelect.prototype, "allowCustomValue", void 0); - __decorate([ - e$3({ type: Boolean }) - ], SchedulerSelect.prototype, "invalid", void 0); - __decorate([ - o$5('vaadin-combo-box-light', true) - ], SchedulerSelect.prototype, "_comboBox", void 0); - SchedulerSelect = __decorate([ - n$4('scheduler-select') - ], SchedulerSelect); - - let SchedulerSelector = class SchedulerSelector extends h$2 { - constructor() { - super(...arguments); - this.items = []; - this.value = []; - this.label = ''; - this.invalid = false; - } - shouldUpdate(changedProps) { - if (changedProps.get('items')) { - if (!isEqual(this.items, changedProps.get('items'))) - this.firstUpdated(); - } - return true; - } - firstUpdated() { - //remove items from selection which are not in the list (anymore) - if (this.value.some(e => !this.items.map(v => v.value).includes(e))) { - this.value = this.value.filter(e => this.items.map(v => v.value).includes(e)); - A$1(this, 'value-changed', { value: this.value }); - } - } - render() { - return T ` -
- ${this.value.length - ? this.value - .map(val => this.items.find(e => e.value == val)) - .filter(isDefined) - .map(e => T ` -
- - ${e.name} - - this._removeClick(e.value)}> - - -
- `) - : ''} - !this.value.includes(e.value))} - label=${this.label} - .icons=${false} - .allowCustomValue=${true} - @value-changed=${this._addClick} - ?invalid=${this.invalid && this.value.length != this.items.length} - > - -
- `; - } - _removeClick(value) { - this.value = this.value.filter(e => e !== value); - A$1(this, 'value-changed', { value: this.value }); - } - _addClick(ev) { - ev.stopPropagation(); - const target = ev.target; - const value = target.value; - if (!this.value.includes(value)) - this.value = [...this.value, value]; - target.value = ''; - A$1(this, 'value-changed', { value: [...this.value] }); - } - static get styles() { - return i ` - div.chip { - height: 32px; - border-radius: 16px; - border: 2px solid rgba(var(--rgb-primary-color), 0.54); - line-height: 1.25rem; - font-size: 0.875rem; - font-weight: 400; - padding: 0px 12px; - display: inline-flex; - align-items: center; - box-sizing: border-box; - margin: 1px 0px; - } - .icon { - vertical-align: middle; - outline: none; - display: flex; - align-items: center; - border-radius: 50%; - padding: 6px; - color: rgba(0, 0, 0, 0.54); - background: rgb(168, 232, 251); - --mdc-icon-size: 20px; - margin-left: -14px !important; - } - .label { - margin: 0px 4px; - } - .button { - cursor: pointer; - background: var(--secondary-text-color); - border-radius: 50%; - --mdc-icon-size: 14px; - color: var(--card-background-color); - width: 16px; - height: 16px; - padding: 1px; - box-sizing: border-box; - display: inline-flex; - align-items: center; - margin-right: -6px !important; - } - `; - } - }; - __decorate([ - e$3() - ], SchedulerSelector.prototype, "items", void 0); - __decorate([ - e$3({ type: Array }) - ], SchedulerSelector.prototype, "value", void 0); - __decorate([ - e$3() - ], SchedulerSelector.prototype, "label", void 0); - __decorate([ - e$3({ type: Boolean }) - ], SchedulerSelector.prototype, "invalid", void 0); - SchedulerSelector = __decorate([ - n$4('scheduler-selector') - ], SchedulerSelector); - - const getMatchTypes = (hass, filter) => { - let output = {}; - if (!(filter === null || filter === void 0 ? void 0 : filter.length) || filter.includes(EConditionMatchType.Above)) - output = Object.assign(Object.assign({}, output), { [EConditionMatchType.Above]: { - value: EConditionMatchType.Above, - name: hass.localize('ui.panel.config.automation.editor.triggers.type.numeric_state.above'), - icon: 'hass:greater-than', - } }); - if (!(filter === null || filter === void 0 ? void 0 : filter.length) || filter.includes(EConditionMatchType.Below)) - output = Object.assign(Object.assign({}, output), { [EConditionMatchType.Below]: { - value: EConditionMatchType.Below, - name: hass.localize('ui.panel.config.automation.editor.triggers.type.numeric_state.below'), - icon: 'hass:less-than', - } }); - if (!(filter === null || filter === void 0 ? void 0 : filter.length) || filter.includes(EConditionMatchType.Equal)) - output = Object.assign(Object.assign({}, output), { [EConditionMatchType.Equal]: { - value: EConditionMatchType.Equal, - name: localize('ui.panel.conditions.equal_to', getLocale(hass)), - icon: 'hass:equal', - } }); - if (!(filter === null || filter === void 0 ? void 0 : filter.length) || filter.includes(EConditionMatchType.Unequal)) - output = Object.assign(Object.assign({}, output), { [EConditionMatchType.Unequal]: { - value: EConditionMatchType.Unequal, - name: localize('ui.panel.conditions.unequal_to', getLocale(hass)), - icon: 'hass:not-equal-variant', - } }); - return output; - }; - let SchedulerOptionsCard = class SchedulerOptionsCard extends h$2 { - constructor() { - super(...arguments); - this.addCondition = false; - this.tags = []; - this.startDate = ''; - this.endDate = ''; - } - async firstUpdated() { - var _a, _b, _c; - if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.tags) { - (async () => await loadHaForm())(); - const tagEntries = await fetchTags(this.hass); - const existingTags = tagEntries.map(e => e.name); - const configTags = AsArray(this.config.tags); - this.tags = [...existingTags, ...configTags.filter(e => !existingTags.includes(e) && e != 'none')]; - } - (await window.loadCardHelpers()).importMoreInfoControl('input_datetime'); - this.startDate = ((_b = this.schedule) === null || _b === void 0 ? void 0 : _b.start_date) || formatDate(new Date(), getLocale(this.hass), true); - this.endDate = ((_c = this.schedule) === null || _c === void 0 ? void 0 : _c.end_date) || formatDate(new Date(), getLocale(this.hass), true); - } - render() { - var _a, _b; - if (!this.hass || !this.config || !this.schedule) - return T ``; - let repeatTypes = [ - { - name: this.hass.localize('ui.panel.config.automation.editor.actions.type.repeat.label'), - value: ERepeatType.Repeat, - icon: 'refresh', - }, - { - name: this.hass.localize('ui.dialogs.more_info_control.vacuum.stop'), - value: ERepeatType.Pause, - icon: 'stop', - }, - { - name: this.hass.localize('ui.common.delete'), - value: ERepeatType.Single, - icon: 'trash-can-outline', - }, - ]; - if (isDefined(this.schedule.start_date)) { - repeatTypes = repeatTypes.filter(e => e.value != ERepeatType.Repeat); - } - return T ` - -
-
- ${this.config.title - ? typeof this.config.title == 'string' - ? this.config.title - : localize('ui.panel.common.title', getLocale(this.hass)) - : ''} -
- -
-
- ${!this.addCondition - ? T ` -
- ${this.hass.localize('ui.panel.config.automation.editor.actions.type.choose.conditions')} - ${!this.schedule.timeslots[0].conditions || this.schedule.timeslots[0].conditions.length < 2 - ? '' - : T ` -
- ${localize('ui.panel.conditions.any', getLocale(this.hass))} - - ${localize('ui.panel.conditions.all', getLocale(this.hass))} -
- `} -
- ${this.renderConditions()} - -
-
- - - ${this.hass.localize('ui.dialogs.helper_settings.input_select.add')} - -
-
- ${this.schedule.timeslots[0].stop && - this.schedule.timeslots[0].conditions && - this.schedule.timeslots[0].conditions.length > 0 - ? T ` - - this.shadowRoot.querySelector('#track_conditions').click()} - > - ${localize('ui.panel.conditions.track_conditions', getLocale(this.hass))} - - ` - : ''} -
-
- -
${localize('ui.panel.options.period', getLocale(this.hass))}
-
-
- - -
-
-
- - ${PrettyPrintName(((_a = localize('ui.components.date.days_range', getLocale(this.hass)) - .split('{') - .shift()) === null || _a === void 0 ? void 0 : _a.trim()) || '')} - - - -
- -
- - ${PrettyPrintName(((_b = localize('ui.components.date.days_range', getLocale(this.hass)) - .split('}')[1] - .split('{') - .shift()) === null || _b === void 0 ? void 0 : _b.trim()) || '')} - - - -
-
-
- -
${this.hass.localize('ui.components.area-picker.add_dialog.name')}
- - - ${this.config.tags - ? T ` -
${this.hass.localize('ui.panel.config.tag.caption')}
- - - ` - : ''} - -
${localize('ui.panel.options.repeat_type', getLocale(this.hass))}
- - - ` - : this.renderAddCondition()} -
-
- ${!this.addCondition - ? T ` - e.actions.length).length} - > - ${this.hass.localize('ui.common.save')} - - ${this.hass.localize('ui.common.back')} - ` - : T ` - ${this.hass.localize('ui.common.save')} - ${this.editItem !== undefined - ? T ` - ${this.hass.localize('ui.common.delete')} - ` - : ''} - ${this.hass.localize('ui.common.cancel')} - `} -
-
- `; - } - renderAddCondition() { - if (!this.addCondition || !this.hass || !this.config) - return T ``; - if (!this.selectedEntity) { - const hassEntities = computeEntities$1(this.hass, this.config, { filterActions: false, filterStates: true }); - const groups = entityGroups(hassEntities, this.config, this.hass); - groups.sort((a, b) => (a.name.trim().toLowerCase() < b.name.trim().toLowerCase() ? -1 : 1)); - let entities = []; - if (this.selectedGroup) { - entities = groups - .find(e => isEqual(e, this.selectedGroup)) - .entities.map(e => parseEntity(e, this.hass, this.config)); - entities.sort((a, b) => (a.name.trim().toLowerCase() < b.name.trim().toLowerCase() ? -1 : 1)); - } - return T ` -
${this.hass.localize('ui.panel.config.users.editor.group')}
- - isEqual(e, this.selectedGroup))} - @change=${this.selectGroup} - > - ${localize('ui.panel.entity_picker.no_groups_defined', getLocale(this.hass))} - - -
${this.hass.localize('ui.components.entity.entity-picker.entity')}
- isEqual(e, this.selectedEntity))} - @change=${this.selectEntity} - > - ${!this.selectedGroup - ? localize('ui.panel.entity_picker.no_group_selected', getLocale(this.hass)) - : localize('ui.panel.entity_picker.no_entities_for_group', getLocale(this.hass))} - - `; - } - else { - const entity = this.selectedEntity; - const states = computeStates(entity.id, this.hass, this.config); - let availableMatchTypes; - if ((states === null || states === void 0 ? void 0 : states.type) == EVariableType.Level) - availableMatchTypes = [EConditionMatchType.Above, EConditionMatchType.Below]; - else if ((states === null || states === void 0 ? void 0 : states.type) == EVariableType.List) - availableMatchTypes = [EConditionMatchType.Equal, EConditionMatchType.Unequal]; - else { - const currentState = entity.id in this.hass.states ? this.hass.states[entity.id].state : null; - if (!currentState || ['unavailable', 'unknown'].includes(currentState)) - availableMatchTypes = [ - EConditionMatchType.Equal, - EConditionMatchType.Unequal, - EConditionMatchType.Above, - EConditionMatchType.Below, - ]; - else if (!isNaN(Number(currentState))) - availableMatchTypes = [EConditionMatchType.Above, EConditionMatchType.Below]; - else - availableMatchTypes = [EConditionMatchType.Equal, EConditionMatchType.Unequal]; - } - const matchTypes = getMatchTypes(this.hass, availableMatchTypes); - return T ` -
${this.hass.localize('ui.components.entity.entity-picker.entity')}
-
- - - ${PrettyPrintName(entity.name)} - - { - this.selectedEntity = undefined; - }} - > - -
- -
- ${this.hass.localize('ui.panel.config.automation.editor.conditions.type.device.condition')} -
- (this.conditionMatchType = ev.target.value)} - > - - -
${this.hass.localize('ui.panel.config.automation.editor.conditions.type.state.label')}
- (this.conditionValue = ev.detail.value)} - > - - `; - } - } - selectGroup(ev) { - this.selectedGroup = ev.detail; - this.selectedEntity = undefined; - } - selectEntity(ev) { - this.selectedEntity = ev.detail; - this.conditionMatchType = undefined; - this.conditionValue = undefined; - } - renderConditions() { - if (!this.hass || !this.schedule) - return T ``; - const conditions = this.schedule.timeslots[0].conditions || []; - if (!conditions.length) - return T ` -
${localize('ui.panel.conditions.no_conditions_defined', getLocale(this.hass))}
- `; - return conditions.map((item, num) => { - const entity = parseEntity(item.entity_id, this.hass, this.config); - const states = computeStates(item.entity_id, this.hass, this.config); - return T ` -
- - - ${PrettyPrintName(entity.name)} ${getMatchTypes(this.hass)[item.match_type].name.toLowerCase()} - ${states - ? states.type == EVariableType.List - ? listVariableDisplay(item.value, states) - : states.type == EVariableType.Level - ? levelVariableDisplay(item.value, states) - : '' - : ''} - - { - this.editConditionClick(num); - }} - > - -
- `; - }); - } - addConditionClick() { - this.addCondition = true; - this.selectedEntity = undefined; - this.selectedGroup = undefined; - } - confirmConditionClick() { - var _a; - if (!this.selectedEntity || - !this.config || - !this.hass || - !this.schedule || - !this.conditionMatchType || - !isDefined(this.conditionValue)) - return; - const condition = { - entity_id: this.selectedEntity.id, - match_type: this.conditionMatchType, - value: this.conditionValue, - attribute: 'state', - }; - const conditions = ((_a = this.schedule.timeslots[0].conditions) === null || _a === void 0 ? void 0 : _a.length) ? [...this.schedule.timeslots[0].conditions] : []; - const type = this.schedule.timeslots[0].condition_type - ? this.schedule.timeslots[0].condition_type - : EConditionType.Any; - if (this.editItem === undefined) - conditions.push(condition); - else - conditions.splice(this.editItem, 1, condition); - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: this.schedule.timeslots.map(e => Object.assign(e, { - conditions: conditions, - condition_type: type, - })) }); - this.addCondition = false; - this.editItem = undefined; - } - cancelConditionClick() { - this.addCondition = false; - this.editItem = undefined; - } - editConditionClick(index) { - if (!this.schedule || !this.schedule.timeslots[0].conditions || !this.hass || !this.config) - return; - const item = this.schedule.timeslots[0].conditions[index]; - if (!item) - return; - this.editItem = index; - const hassEntities = computeEntities$1(this.hass, this.config, { filterActions: false, filterStates: true }); - const groups = entityGroups(hassEntities, this.config, this.hass); - this.selectedGroup = groups.find(e => e.entities.includes(item.entity_id)); - this.selectedEntity = parseEntity(item.entity_id, this.hass, this.config); - this.conditionMatchType = item.match_type; - this.conditionValue = item.value; - this.addCondition = true; - } - deleteConditionClick() { - var _a; - if (!this.config || !this.hass || !this.schedule || this.editItem === undefined) - return; - const conditions = ((_a = this.schedule.timeslots[0].conditions) === null || _a === void 0 ? void 0 : _a.length) ? [...this.schedule.timeslots[0].conditions] : []; - conditions.splice(this.editItem, 1); - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: this.schedule.timeslots.map(e => Object.assign(e, { - conditions: conditions, - })) }); - this.addCondition = false; - this.editItem = undefined; - } - conditionTypeSwitchClick(e) { - if (!this.schedule) - return; - const checked = e.target.checked; - const type = checked ? EConditionType.All : EConditionType.Any; - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: this.schedule.timeslots.map(e => Object.assign(e, { - condition_type: type, - })) }); - } - trackConditionsClick(e) { - if (!this.schedule) - return; - const checked = e.target.checked; - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: this.schedule.timeslots.map(e => Object(Object.assign(Object.assign({}, e), { track_conditions: checked }))) }); - } - _setStartDate(ev) { - const value = String(ev.detail.value); - if (!value) - return; - const startDate = stringToDate(value); - const endDate = stringToDate(this.endDate); - if (startDate > endDate) { - this.schedule = Object.assign(Object.assign({}, this.schedule), { end_date: value }); - this.endDate = value; - } - this.schedule = Object.assign(Object.assign({}, this.schedule), { start_date: value }); - this.startDate = value; - } - _setEndDate(ev) { - const value = String(ev.detail.value); - if (!value) - return; - const startDate = stringToDate(this.startDate); - const endDate = stringToDate(value); - if (startDate > endDate) { - this.schedule = Object.assign(Object.assign({}, this.schedule), { start_date: value }); - this.startDate = value; - } - this.schedule = Object.assign(Object.assign({}, this.schedule), { end_date: value }); - this.endDate = value; - } - toggleEnableDateRange(ev) { - const checked = ev.target.checked; - const datePickers = this.shadowRoot.querySelectorAll('ha-date-input'); - this.schedule = Object.assign(Object.assign({}, this.schedule), { start_date: checked ? this.startDate : undefined, end_date: checked ? this.endDate : undefined, repeat_type: checked - ? this.schedule.repeat_type == ERepeatType.Repeat - ? ERepeatType.Pause - : this.schedule.repeat_type - : this.schedule.repeat_type == ERepeatType.Pause - ? ERepeatType.Repeat - : this.schedule.repeat_type }); - } - updateName(e) { - const value = e.target.value; - this.schedule = Object.assign(Object.assign({}, this.schedule), { name: value }); - } - updateRepeatType(e) { - const value = e.target.value; - this.schedule = Object.assign(Object.assign({}, this.schedule), { repeat_type: value }); - } - getTagOptions() { - var _a; - let output = [...this.tags]; - if ((_a = this.schedule) === null || _a === void 0 ? void 0 : _a.tags.length) - output = [...output, ...this.schedule.tags.filter(e => !output.includes(e))]; - output.sort(sortAlphabetically); - return output.map(e => Object({ name: e, value: e })); - } - updateTags(ev) { - let value = ev.target.value; - value = value.map(e => e.trim()); - value = value.filter(e => e != 'none'); - value.sort(sortAlphabetically); - this.schedule = Object.assign(Object.assign({}, this.schedule), { tags: value }); - } - cancelClick() { - if (this.addCondition) { - this.addCondition = !this.addCondition; - } - else { - const myEvent = new CustomEvent('cancelClick'); - this.dispatchEvent(myEvent); - } - } - saveClick() { - const myEvent = new CustomEvent('saveClick', { - detail: this.schedule, - }); - this.dispatchEvent(myEvent); - } - backClick() { - const myEvent = new CustomEvent('backClick', { - detail: this.schedule, - }); - this.dispatchEvent(myEvent); - } - }; - SchedulerOptionsCard.styles = i ` - ${commonStyle} - div.summary { - display: flex; - flex-direction: row; - align-items: center; - padding: 4px 0px; - background: rgba(var(--rgb-primary-color), 0.15); - color: var(--dark-primary-color); - border-radius: 8px; - margin: 2px 0px; - font-size: 14px; - font-weight: 500; - } - div.summary ha-icon { - flex: 0 0 48px; - justify-content: center; - display: flex; - } - div.summary span { - flex: 1 0 60px; - display: flex; - } - div.summary ha-icon-button { - margin: -8px 0px; - } - div.date-range { - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - div.date-range div { - display: flex; - align-items: center; - } - div.date-range div span { - display: inline-flex; - padding: 0px 10px; - } - div.date-range div:first-child span { - padding-left: 0px; - } - div.condition-options { - display: flex; - flex-direction: row; - margin-top: 10px; - } - div.track-conditions { - display: flex; - flex-direction: row; - text-align: right; - align-items: center; - max-width: 50%; - } - div.track-conditions span { - text-align: left; - } - `; - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "hass", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "config", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "schedule", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "selectedGroup", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "selectedEntity", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "conditionMatchType", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "conditionValue", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "editItem", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "addCondition", void 0); - __decorate([ - e$3() - ], SchedulerOptionsCard.prototype, "tags", void 0); - __decorate([ - r$3() - ], SchedulerOptionsCard.prototype, "startDate", void 0); - __decorate([ - r$3() - ], SchedulerOptionsCard.prototype, "endDate", void 0); - SchedulerOptionsCard = __decorate([ - n$4('scheduler-options-card') - ], SchedulerOptionsCard); - - let SchedulerCardEditor = class SchedulerCardEditor extends h$2 { - constructor() { - super(...arguments); - this.scheduleEntities = []; - this._cardTab = false; - this.selectedDomain = ''; - } - setConfig(config) { - this._config = config; - } - async firstUpdated() { - await loadHaForm(); - this.scheduleEntities = (await fetchSchedules(this.hass)).map(e => e.entity_id); - const tagOptions = (await fetchTags(this.hass)).map(e => e.name); - tagOptions.sort(sortAlphabetically); - this.tagOptions = tagOptions; - } - render() { - if (!this.hass || !this._config) { - return T ``; - } - return T ` - - - - - -
- ${!this._cardTab - ? T ` -
- ${localize('ui.panel.card_editor.fields.entities.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.entities.description', getLocale(this.hass))} -
- ${this.getDomainSwitches()} - ` - : T ` -
${localize('ui.panel.card_editor.fields.title.heading', getLocale(this.hass))}
- this._setTitleFormatOption(ev.target.value)} - > - - ${typeof this._config.title == 'string' - ? T ` - { - this._updateConfig({ title: String(ev.target.value) }); - }} - > - ` - : ''} - -
- ${localize('ui.panel.card_editor.fields.discover_existing.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.discover_existing.description', getLocale(this.hass))} -
- { - this._updateConfig({ discover_existing: ev.target.checked }); - }} - > - - -
- ${localize('ui.panel.card_editor.fields.time_step.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.time_step.description', getLocale(this.hass))} -
- { - this._updateConfig({ time_step: Number(ev.detail.value) }); - }} - > - - -
- ${localize('ui.panel.card_editor.fields.sort_by.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.sort_by.description', getLocale(this.hass))} -
- -
- - - - - - -
- -
- - - -
- -
- ${localize('ui.panel.card_editor.fields.display_format_primary.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.display_format_primary.description', getLocale(this.hass))} -
- - - - - - - - -
- ${localize('ui.panel.card_editor.fields.display_format_secondary.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.display_format_secondary.description', getLocale(this.hass))} -
- - - - - - - - - - - - - - - - - -
- ${localize('ui.panel.card_editor.fields.show_header_toggle.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.show_header_toggle.description', getLocale(this.hass))} -
- { - this._updateConfig({ show_header_toggle: ev.target.checked }); - }} - > - - - ${this.tagOptions !== undefined - ? T ` -
- ${localize('ui.panel.card_editor.fields.tags.heading', getLocale(this.hass))} -
-
- ${localize('ui.panel.card_editor.fields.tags.description', getLocale(this.hass))} -
- - - ` - : ''} - `} -
- `; - } - _selectTab(ev) { - this._cardTab = ev.detail.index === 1; - } - _updateConfig(changes) { - if (!this._config) - return; - this._config = Object.assign(Object.assign({}, this._config), changes); - A$1(this, 'config-changed', { config: this._config }); - } - _setTitleFormatOption(option) { - var _a; - if (!this.hass) - return; - if (option == 'standard') - this._updateConfig({ title: true }); - else if (option == 'hidden') - this._updateConfig({ title: false }); - else - this._updateConfig({ - title: typeof ((_a = this._config) === null || _a === void 0 ? void 0 : _a.title) === 'string' - ? this._config.title - : localize('ui.panel.common.title', getLocale(this.hass)), - }); - } - getTitleOption() { - if (!this.hass || !this._config) - return ''; - if (typeof this._config.title == 'string') - return 'custom'; - return this._config.title ? 'standard' : 'hidden'; - } - updateTags(ev) { - if (!this._config || !this.hass) - return; - let value = ev.target.value; - value = value.map(e => e.trim()); - value.sort(sortAlphabetically); - this._updateConfig({ tags: value }); - } - getTagOptions() { - if (!this._config || !this.hass) - return []; - let options = this.tagOptions || []; - if (this._config.tags) { - const configTags = AsArray(this._config.tags); - options = [...options, ...configTags.filter(e => !options.includes(e))]; - } - return options.map(e => Object({ name: e, value: e })); - } - _setSortBy(ev) { - var _a; - const checked = ev.target.checked; - const value = ev.target.value; - let config = AsArray(((_a = this._config) === null || _a === void 0 ? void 0 : _a.sort_by) || DefaultCardConfig.sort_by); - if (value != 'state' && checked) - config = config.filter(e => e == 'state'); - if (!config.includes(value) && checked) - config = [...config, value]; - if (config.includes(value) && !checked) - config = config.filter(e => e != value); - this._updateConfig({ sort_by: config }); - } - _setDisplayOptionsPrimary(ev) { - var _a; - const value = ev.target.value; - const displayOptions = Object.assign(Object.assign({}, (((_a = this._config) === null || _a === void 0 ? void 0 : _a.display_options) || DefaultCardConfig.display_options)), { primary_info: value }); - this._updateConfig({ display_options: displayOptions }); - } - _setDisplayOptionsSecondary(ev) { - var _a; - const value = ev.target.value; - const checked = ev.target.checked; - let displayOptions = Object.assign({}, (((_a = this._config) === null || _a === void 0 ? void 0 : _a.display_options) || DefaultCardConfig.display_options)); - let secondaryInfo = AsArray(displayOptions.secondary_info || []); - secondaryInfo = checked ? Array.from(new Set([...secondaryInfo, value])) : secondaryInfo.filter(e => e !== value); - secondaryInfo.sort((a, b) => { - const ranking = { - 'relative-time': 1, - time: secondaryInfo.includes('relative-time') ? 3 : 2, - days: secondaryInfo.includes('relative-time') ? 2 : 3, - 'additional-tasks': 4, - }; - const rankA = Object.keys(ranking).includes(a) ? ranking[a] : 5; - const rankB = Object.keys(ranking).includes(b) ? ranking[b] : 5; - if (rankA > rankB) - return 1; - if (rankA < rankB) - return -1; - return 0; - }); - displayOptions = Object.assign(Object.assign({}, displayOptions), { secondary_info: [...secondaryInfo] }); - this._updateConfig({ display_options: displayOptions }); - } - getDomainSwitches() { - if (!this._config || !this.hass) - return; - const entities = computeEntities$1(this.hass, Object.assign(Object.assign({}, DefaultCardConfig), { include: ['*'] }), { filterActions: true, filterStates: true }) - .filter(e => g$1(e) !== 'switch' || !this.scheduleEntities.includes(e)) - .map(e => parseEntity(e, this.hass, { include: ['*'] })) - .filter(e => standardStates(e.id, this.hass) || computeActions(e.id, this.hass, DefaultCardConfig)); - const domainList = entities.map(e => g$1(e.id)).filter((v, k, arr) => arr.indexOf(v) === k); - domainList.sort((a, b) => (a.trim().toLowerCase() < b.trim().toLowerCase() ? -1 : 1)); - return domainList.map(domain => { - var _a; - const count = entities.filter(e => g$1(e.id) == domain).length; - const domainEntities = entities.filter(e => g$1(e.id) == domain); - const includedCount = domainEntities.filter(e => entityFilter(e.id, this._config)).length; - if (!count) - return ``; - return T ` -
this.toggleShowDomain(domain)}> - - -
- ${domain} -
- ${localize('ui.panel.card_editor.fields.entities.included_number', getLocale(this.hass), ['{number}', '{total}'], [includedCount, count])} -
-
- ev.stopPropagation()} - @change=${(ev) => this.toggleSelectEntity(domain, ev.target.checked)} - ?checked=${entityFilter(domain, this._config)} - ?disabled=${entityFilter(domain, { groups: (_a = this._config) === null || _a === void 0 ? void 0 : _a.groups })} - > - -
- ${this.selectedDomain == domain - ? T ` -
- ${domainEntities.map(entity => { - var _a, _b; - return T ` -
this.toggleSelectEntity(entity.id)}> - -
- ${entity.name} -
- ${entity.id} -
-
- -
- `; - })} -
- ` - : ''} - `; - }); - } - toggleShowDomain(domain) { - if (!this._config || !this.hass) - return; - if (this.selectedDomain != domain) { - this.selectedDomain = domain; - } - else { - this.selectedDomain = ''; - } - } - toggleSelectEntity(entity_id, newValue) { - if (!this._config || !this.hass) - return; - const isIncluded = entityFilter(entity_id, this._config); - if (newValue === undefined) - newValue = !isIncluded; - const entityDomain = g$1(entity_id); - let include = [...(this._config.include || [])]; - let exclude = [...(this._config.exclude || [])]; - if (!isIncluded && newValue) { - if (exclude.includes(entity_id)) - exclude = exclude.filter(e => e != entity_id); - if (!include.includes(entity_id)) - include = [...include, entity_id]; - } - else if (isIncluded && !newValue) { - if ((entityDomain && include.includes(entityDomain)) || - entityFilter(entity_id, { customize: this._config.customize }) || - (entityDomain && entityFilter(entityDomain, { customize: this._config.customize }))) - exclude = [...exclude, entity_id]; - if (include.includes(entity_id)) - include = include.filter(e => e != entity_id); - } - else - return; - include.sort(sortAlphabetically); - exclude.sort(sortAlphabetically); - this._updateConfig({ include: include, exclude: exclude }); - } - static get styles() { - return i ` - ${commonStyle} - div.row { - display: flex; - align-items: center; - flex-direction: row; - cursor: pointer; - margin: 10px 0px; - } - div.divider { - height: 1px; - background: var(--divider-color); - } - .info { - margin-left: 16px; - flex: 1 0 60px; - } - .info, - .info > * { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - .secondary { - display: block; - color: var(--secondary-text-color); - } - div.row ha-icon { - padding: 8px; - color: var(--paper-item-icon-color); - } - div.row state-badge { - flex: 0 0 40px; - } - div.row ha-switch { - padding: 13px 5px; - } - `; - } - }; - __decorate([ - e$3() - ], SchedulerCardEditor.prototype, "hass", void 0); - __decorate([ - e$3() - ], SchedulerCardEditor.prototype, "_config", void 0); - __decorate([ - e$3() - ], SchedulerCardEditor.prototype, "scheduleEntities", void 0); - __decorate([ - e$3() - ], SchedulerCardEditor.prototype, "tagOptions", void 0); - __decorate([ - r$3() - ], SchedulerCardEditor.prototype, "_cardTab", void 0); - __decorate([ - e$3() - ], SchedulerCardEditor.prototype, "selectedDomain", void 0); - SchedulerCardEditor = __decorate([ - n$4('scheduler-card-editor') - ], SchedulerCardEditor); - - let DialogError = class DialogError extends h$2 { - async showDialog(params) { - this._params = params; - await this.updateComplete; - } - async closeDialog() { - this._params = undefined; - } - render() { - if (!this._params) - return T ``; - return T ` - -
- - - - ${this.hass.localize('state_badge.default.error')} - - -
-
- ${this._params.error || ''} -
- - - ${this.hass.localize('ui.dialogs.generic.ok')} - -
- `; - } - static get styles() { - return i ` - div.wrapper { - color: var(--primary-text-color); - } - `; - } - }; - __decorate([ - e$3({ attribute: false }) - ], DialogError.prototype, "hass", void 0); - __decorate([ - r$3() - ], DialogError.prototype, "_params", void 0); - DialogError = __decorate([ - n$4('dialog-error') - ], DialogError); - - var dialogError = /*#__PURE__*/Object.freeze({ - __proto__: null, - get DialogError () { return DialogError; } - }); - - let DialogDeleteDefective = class DialogDeleteDefective extends h$2 { - async showDialog(params) { - this._params = params; - await this.updateComplete; - } - async closeDialog() { - if (this._params) - this._params.cancel(); - this._params = undefined; - } - render() { - if (!this._params) - return T ``; - return T ` - -
- - - - Defective entity - - -
-
- This schedule is defective and cannot be edited with the card. Consider to delete the item and recreate it. If - the problem persists, please report the issue on GitHub. -
- - - ${this.hass.localize('ui.dialogs.generic.cancel')} - - - ${this.hass.localize('ui.common.delete')} - -
- `; - } - confirmClick() { - this._params.confirm(); - } - cancelClick() { - this._params.cancel(); - } - static get styles() { - return i ` - div.wrapper { - color: var(--primary-text-color); - } - `; - } - }; - __decorate([ - e$3({ attribute: false }) - ], DialogDeleteDefective.prototype, "hass", void 0); - __decorate([ - r$3() - ], DialogDeleteDefective.prototype, "_params", void 0); - DialogDeleteDefective = __decorate([ - n$4('dialog-delete-defective') - ], DialogDeleteDefective); - - var dialogDeleteDefective = /*#__PURE__*/Object.freeze({ - __proto__: null, - get DialogDeleteDefective () { return DialogDeleteDefective; } - }); - - const migrateActionConfig = (config, entities, actions, hass) => { - if (!config) - return null; - const action = importAction(config, hass); - let match = actions.find(e => compareActions(e, action, true)); - if (!match) - return null; - let output = entities.map(e => assignAction(e, match)); - output = Object.keys(match.variables || {}) - .filter(k => Object.keys(config.service_data || {}).includes(k)) - .reduce((output, variable) => { - if (!output) - return output; - switch (match.variables[variable].type) { - case EVariableType.Level: - //keep the selected level variable while maintaining min/max/step size/scale factor - const levelVariable = match.variables[variable]; - let val = Number(config.service_data[variable]); - val = val / levelVariable.scale_factor; - val = Math.round(val / levelVariable.step) * levelVariable.step; - val = parseFloat(val.toPrecision(12)); - if (val > levelVariable.max) - val = levelVariable.max; - else if (val < levelVariable.min) - val = levelVariable.min; - val = val * levelVariable.scale_factor; - val = parseFloat(val.toFixed(2)); - return output.map(e => Object.assign(e, { service_data: Object.assign(Object.assign({}, e.service_data), { [variable]: val }) })); - case EVariableType.List: - const listVariable = match.variables[variable]; - if (listVariable.options.some(e => e.value == config.service_data[variable])) - //keep the selected list variable if it is in common - return output.map(e => Object.assign(e, { service_data: Object.assign(Object.assign({}, e.service_data), { [variable]: config.service_data[variable] }) })); - else - return null; - case EVariableType.Text: - //keep the selected text variable - return output.map(e => Object.assign(e, { service_data: Object.assign(Object.assign({}, e.service_data), { [variable]: config.service_data[variable] }) })); - default: - return output; - } - }, output); - return output; - }; - - window.customCards = window.customCards || []; - window.customCards.push({ - type: 'scheduler-card', - name: 'Scheduler Card', - description: 'Card to manage schedule entities made with scheduler-component.', - }); - console.info(`%c SCHEDULER-CARD \n%c Version: ${CARD_VERSION.padEnd(7, ' ')}`, 'color: orange; font-weight: bold; background: black', 'color: white; font-weight: bold; background: dimgray'); - exports.SchedulerCard = class SchedulerCard extends h$2 { - constructor() { - super(...arguments); - this._view = EViews.Overview; - this.actions = []; - this.translationsLoaded = false; - this.editItem = null; - } - static getConfigElement() { - return document.createElement('scheduler-card-editor'); - } - set hass(hass) { - this._hass = hass; - } - firstUpdated() { - const hass = this._hass; - if (hass.localize('ui.panel.config.automation.editor.actions.name')) - this.translationsLoaded = true; - else { - const el = document.querySelector('home-assistant'); - el._loadFragmentTranslations(hass.language, 'config').then(() => { - this._hass.localize; - }); - } - } - shouldUpdate(changedProps) { - const oldHass = changedProps.get('_hass'); - if (oldHass && changedProps.size == 1) { - if (!oldHass.localize('ui.panel.config.automation.editor.actions.name')) { - this.translationsLoaded = true; - return true; - } - else if (this._view == EViews.Overview) - return true; - return false; - } - return true; - } - setConfig(userConfig) { - ValidateConfig(userConfig); - const config = Object.assign(Object.assign({}, DefaultCardConfig), userConfig); - this._config = config; - } - getCardSize() { - return 9; - } - render() { - if (!this._hass || !this._config || !this.translationsLoaded) - return T ``; - if (this._view == EViews.Overview) { - return T ` - - - `; - } - else if (this._view == EViews.NewSchedule) { - return T ` - - - `; - } - else if (this._view == EViews.TimePicker || this._view == EViews.TimeScheme) { - return T ` - - - `; - } - else if (this._view == EViews.Options) { - return T ` - - - `; - } - else - return T ``; //shouldnt happen! - } - _addItemClick() { - this._view = EViews.NewSchedule; - this.editItem = null; - this.entities = []; - this.actions = []; - this.schedule = undefined; - } - _cancelEditClick() { - this._view = EViews.Overview; - this.editItem = null; - } - _confirmItemClick(ev) { - if (!this._hass || !this._config) - return; - const entities = ev.detail.entities; - this.entities = entities.map(e => parseEntity(e, this._hass, this._config)); - const timeSchemeSelected = Boolean(ev.detail.timeSchemeSelected); - const action = ev.detail.action; - const oldSchedule = this.schedule; - const defaultTags = AsArray(this._config.tags).length == 1 ? AsArray(this._config.tags).slice(0, 1) : []; - if (!timeSchemeSelected) { - this.actions = [action]; - const defaultTimeslot = { - start: '12:00:00', - actions: entities.map(e => assignAction(e, this.actions[0])), - }; - this.schedule = oldSchedule - ? Object.assign(Object.assign({}, oldSchedule), { timeslots: oldSchedule.timeslots.length == 1 && !oldSchedule.timeslots[0].stop - ? [ - Object.assign(Object.assign({}, oldSchedule.timeslots[0]), { actions: migrateActionConfig(oldSchedule.timeslots[0].actions[0], entities, this.actions, this._hass) || - defaultTimeslot.actions }), - ] - : [defaultTimeslot] }) : { - weekdays: ['daily'], - timeslots: [defaultTimeslot], - repeat_type: ERepeatType.Repeat, - tags: defaultTags, - }; - this._view = EViews.TimePicker; - } - else { - this.actions = computeActions(entities, this._hass, this._config); - const defaultTimeslots = [ - { - start: '00:00:00', - stop: '08:00:00', - actions: [], - }, - { - start: '08:00:00', - stop: '16:00:00', - actions: [], - }, - { - start: '16:00:00', - stop: '00:00:00', - actions: [], - }, - ]; - if (oldSchedule) { - //migrate existing schedule - const actions = oldSchedule.timeslots - .map(e => e.actions[0]) - .map(v => migrateActionConfig(v, entities, this.actions, this._hass)); - this.schedule = Object.assign(Object.assign({}, oldSchedule), { timeslots: oldSchedule.timeslots.length > 1 && oldSchedule.timeslots.every(e => e.stop) - ? oldSchedule.timeslots.map((slot, i) => Object.assign(slot, { actions: actions[i] || [] })) - : defaultTimeslots }); - } - else { - this.schedule = { - weekdays: ['daily'], - timeslots: defaultTimeslots, - repeat_type: ERepeatType.Repeat, - tags: defaultTags, - }; - } - this._view = EViews.TimeScheme; - } - } - _editActionClick(ev) { - this.schedule = ev.detail; - this._view = EViews.NewSchedule; - } - async _saveItemClick(ev) { - if (!this._hass) - return; - let schedule = ev.detail; - schedule = Object.assign(Object.assign({}, schedule), { timeslots: schedule.timeslots - .map(slot => { - var _a; - if (!slot.actions || !slot.actions.length) - return null; - if (slot.actions.some(e => !e.entity_id || g$1(e.entity_id || '') == 'notify')) { - slot = Object.assign(Object.assign({}, slot), { actions: slot.actions.map(action => !action.entity_id || g$1(action.entity_id || '') == 'notify' - ? omit(action, 'entity_id') - : action) }); - } - if (!slot.stop) - slot = omit(slot, 'stop'); - if (!((_a = slot.conditions) === null || _a === void 0 ? void 0 : _a.length)) - slot = omit(slot, 'conditions', 'condition_type'); - return slot; - }) - .filter(isDefined) }); - if (this.editItem) { - const oldSchedule = await fetchScheduleItem(this._hass, this.editItem); - if (isEqual(omit(schedule, 'timeslots'), omit(pick(oldSchedule, Object.keys(schedule)), 'timeslots')) && - schedule.timeslots.length == oldSchedule.timeslots.length && - schedule.timeslots.every((slot, i) => isEqual(slot, oldSchedule.timeslots[i]))) { - // don't save if there are no changes - this.editItem = null; - this._view = EViews.Overview; - } - else { - if (!oldSchedule.enabled) - this._hass.callService('switch', 'turn_on', { entity_id: oldSchedule.entity_id }); - if (IsDefaultName(schedule.name)) - schedule = Object.assign(Object.assign({}, schedule), { name: '' }); - editSchedule(this._hass, Object.assign(Object.assign({}, schedule), { schedule_id: this.editItem })) - .catch(e => handleError(e, this)) - .then(() => { - this.editItem = null; - this._view = EViews.Overview; - }); - } - } - else { - saveSchedule(this._hass, schedule) - .catch(e => handleError(e, this)) - .then(() => { - this._view = EViews.Overview; - }); - } - } - _deleteItemClick() { - if (!this.editItem || !this._hass) - return; - const entity_id = this.editItem; - deleteSchedule(this._hass, entity_id) - .catch(e => handleError(e, this)) - .then(() => { - this.editItem = null; - this._view = EViews.Overview; - }); - } - async _editItemClick(ev) { - if (!this._hass || !this._config) - return; - const data = await fetchScheduleItem(this._hass, ev.detail); - if (!data) - return; - const entities = unique(flatten(data.timeslots.map(e => e.actions.map(e => e.entity_id || e.service)))); - this.entities = entities.map(e => parseEntity(e, this._hass, this._config)); - let actions = computeActions(entities, this._hass, this._config); - const usedActions = unique(flatten(data.timeslots.map(e => e.actions))); - let extraActions = usedActions.filter(e => !actions.some(a => compareActions(a, e, true))); - if (extraActions.length) { - //actions that are not in the card - unique(extraActions).forEach(e => actions.push(importAction(e, this._hass))); - } - this.actions = actions; - this.schedule = { - weekdays: data.weekdays, - timeslots: data.timeslots, - repeat_type: data.repeat_type, - name: data.name, - tags: data.tags || [], - start_date: data.start_date, - end_date: data.end_date, - }; - this.editItem = data.schedule_id; - if (!this.entities.length || !this.schedule.timeslots.length) { - const result = await new Promise(resolve => { - A$1(this, 'show-dialog', { - dialogTag: 'dialog-delete-defective', - dialogImport: () => Promise.resolve().then(function () { return dialogDeleteDefective; }), - dialogParams: { - cancel: () => { - resolve(false); - }, - confirm: () => { - resolve(true); - }, - }, - }); - }); - if (result) - this._deleteItemClick(); - else - this._cancelEditClick(); - return; - } - if (this.schedule.timeslots.every(e => e.stop)) { - this.schedule = Object.assign(Object.assign({}, this.schedule), { timeslots: calculateTimeline(this.schedule.timeslots, this._hass) }); - if (!this.actions.length) - handleError({ error: '', body: { message: `Could not compute actions for the schedule #${ev.detail}.` } }, this); - else - this._view = EViews.TimeScheme; - } - else { - this.actions = this.actions - .filter(e => usedActions.find(a => compareActions(e, a, true))) - .reduce((_acc, e) => [e], []); - if (!this.actions.length) - handleError({ error: '', body: { message: `Could not compute actions for schedule #${ev.detail}.` } }, this); - else - this._view = EViews.TimePicker; - } - } - _gotoOptionsClick(ev) { - this.schedule = ev.detail; - this._view = EViews.Options; - } - _optionsBackClick(ev) { - this.schedule = ev.detail; - if (this.schedule.timeslots.every(e => e.stop)) - this._view = EViews.TimeScheme; - else - this._view = EViews.TimePicker; - } - }; - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "_config", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "_hass", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "_view", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "entities", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "actions", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "schedule", void 0); - __decorate([ - e$3() - ], exports.SchedulerCard.prototype, "translationsLoaded", void 0); - exports.SchedulerCard = __decorate([ - n$4('scheduler-card') - ], exports.SchedulerCard); - - return exports; - -}({})); + div.summary-action { + grid-area: action; + } + div.summary-arrow { + grid-area: arrow; + color: var(--secondary-text-color); + display: flex; + justify-content: center; + align-items: center; + } + div.summary-entity, + div.summary-action { + color: var(--dark-primary-color); + padding: 5px; + font-size: 14px; + font-weight: 500; + --mdc-icon-size: 20px; + position: relative; + display: flex; + flex-direction: column; + cursor: pointer; + background: rgba(var(--rgb-primary-color), 0.15); + border-radius: 4px; + align-items: center; + } + div.summary-entity div, + div.summary-action div { + display: flex; + flex-grow: 1; + margin: 5px; + width: 100%; + align-items: center; + } + div.summary-entity ha-icon, + div.summary-action ha-icon { + display: flex; + flex: 0 0 30px; + } + `,t([ae()],Fa.prototype,"hass",void 0),t([ae()],Fa.prototype,"config",void 0),t([ae()],Fa.prototype,"schedule",void 0),t([ae()],Fa.prototype,"actions",void 0),t([ae()],Fa.prototype,"entities",void 0),t([ae()],Fa.prototype,"activeEntry",void 0),t([ae()],Fa.prototype,"activeMarker",void 0),t([ae({type:Boolean})],Fa.prototype,"timeslots",void 0),t([ae({type:Boolean})],Fa.prototype,"editItem",void 0),Fa=t([ie("scheduler-timepicker-card")],Fa);let Ba=class extends ee{constructor(){super(...arguments),this.label="",this.items=[],this.clearable=!1,this.icons=!1,this.disabled=!1,this.allowCustomValue=!1,this.invalid=!1}open(){this.updateComplete.then(()=>{var e,t;null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("vaadin-combo-box-light"))||void 0===t||t.open()})}focus(){this.updateComplete.then(()=>{var e,t,i;null===(i=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("vaadin-combo-box-light"))||void 0===t?void 0:t.inputElement)||void 0===i||i.focus()})}shouldUpdate(e){if(e.get("items"))if(st(this.items,e.get("items"))){if(1==e.size)return!1}else this.firstUpdated();return!0}firstUpdated(){(async()=>{await Pa()})(),this._comboBox.items=this.items}render(){return N` + + + ${it(this._value)&&this.items.find(e=>e.value==this._value)?N` + ${this.icons?N` + + `:""} + ${this.clearable?N` + + + `:""} + `:""} + + + + `}rowRenderer(e,t,i){e.firstElementChild||(e.innerHTML='\n \n \n \n '),e.querySelector(".name").textContent=i.item.name}_clearValue(e){e.stopPropagation(),this._setValue("")}get _value(){return it(this.value)?this.value:""}_toggleOpen(e){var t,i,s,a,o,n;this.items.length?this._opened?(null===(s=null===(i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("vaadin-combo-box-light"))||void 0===i?void 0:i.inputElement)||void 0===s||s.blur(),e.stopPropagation()):null===(n=null===(o=null===(a=this.shadowRoot)||void 0===a?void 0:a.querySelector("vaadin-combo-box-light"))||void 0===o?void 0:o.inputElement)||void 0===n||n.focus():e.stopPropagation()}_openedChanged(e){this._opened=e.detail.value}_valueChanged(e){const t=e.detail.value;t!==this._value&&this._setValue(t)}_setValue(e){this.value=e,setTimeout(()=>{Me(this,"value-changed",{value:e})},0)}static get styles(){return r` + :host { + display: block; + width: 100%; + } + vaadin-combo-box-light { + position: relative; + } + ha-textfield { + width: 100%; + } + ha-textfield > ha-icon-button { + --mdc-icon-button-size: 24px; + padding: 2px; + color: var(--secondary-text-color); + } + ha-svg-icon { + color: var(--input-dropdown-icon-color); + position: absolute; + cursor: pointer; + } + ha-svg-icon.disabled { + cursor: default; + color: var(--disabled-text-color); + } + .toggle-button { + right: 12px; + top: -10px; + } + :host([opened]) .toggle-button { + color: var(--primary-color); + } + `}};t([ae()],Ba.prototype,"label",void 0),t([ae()],Ba.prototype,"value",void 0),t([ae()],Ba.prototype,"items",void 0),t([ae()],Ba.prototype,"clearable",void 0),t([ae()],Ba.prototype,"icons",void 0),t([ae({type:Boolean})],Ba.prototype,"disabled",void 0),t([oe()],Ba.prototype,"_opened",void 0),t([ae({attribute:"allow-custom-value",type:Boolean})],Ba.prototype,"allowCustomValue",void 0),t([ae({type:Boolean})],Ba.prototype,"invalid",void 0),t([function(e,t){return ne({descriptor:i=>{const s={get(){var t,i;return null!==(i=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(t){const t="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i,s;return void 0===this[t]&&(this[t]=null!==(s=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(e))&&void 0!==s?s:null),this[t]}}return s}})}("vaadin-combo-box-light",!0)],Ba.prototype,"_comboBox",void 0),Ba=t([ie("scheduler-select")],Ba);let Ya=class extends ee{constructor(){super(...arguments),this.items=[],this.value=[],this.label="",this.invalid=!1}shouldUpdate(e){return e.get("items")&&(st(this.items,e.get("items"))||this.firstUpdated()),!0}firstUpdated(){this.value.some(e=>!this.items.map(e=>e.value).includes(e))&&(this.value=this.value.filter(e=>this.items.map(e=>e.value).includes(e)),Me(this,"value-changed",{value:this.value}))}render(){return N` +
+ ${this.value.length?this.value.map(e=>this.items.find(t=>t.value==e)).filter(it).map(e=>N` +
+ + ${e.name} + + this._removeClick(e.value)}> + + +
+ `):""} +
+ + !this.value.includes(e.value))} + label=${this.label} + .icons=${!1} + .allowCustomValue=${!0} + @value-changed=${this._addClick} + ?invalid=${this.invalid&&this.value.length!=this.items.length} + > + + `}_removeClick(e){this.value=this.value.filter(t=>t!==e),Me(this,"value-changed",{value:this.value})}_addClick(e){e.stopPropagation();const t=e.target,i=t.value;this.value.includes(i)||(this.value=[...this.value,i]),t.value="",Me(this,"value-changed",{value:[...this.value]})}static get styles(){return r` + div.chip-set { + margin: 0px -4px; + } + div.chip { + height: 32px; + border-radius: 16px; + border: 2px solid rgba(var(--rgb-primary-color), 0.54); + line-height: 1.25rem; + font-size: 0.875rem; + font-weight: 400; + padding: 0px 12px; + display: inline-flex; + align-items: center; + box-sizing: border-box; + margin: 4px; + } + .icon { + vertical-align: middle; + outline: none; + display: flex; + align-items: center; + border-radius: 50%; + padding: 6px; + color: rgba(0, 0, 0, 0.54); + background: rgb(168, 232, 251); + --mdc-icon-size: 20px; + margin-left: -14px !important; + } + .label { + margin: 0px 4px; + } + .button { + cursor: pointer; + background: var(--secondary-text-color); + border-radius: 50%; + --mdc-icon-size: 14px; + color: var(--card-background-color); + width: 16px; + height: 16px; + padding: 1px; + box-sizing: border-box; + display: inline-flex; + align-items: center; + margin-right: -6px !important; + } + `}};t([ae()],Ya.prototype,"items",void 0),t([ae({type:Array})],Ya.prototype,"value",void 0),t([ae()],Ya.prototype,"label",void 0),t([ae({type:Boolean})],Ya.prototype,"invalid",void 0),Ya=t([ie("scheduler-selector")],Ya);const Wa=(e,t)=>{let i={};return(null==t?void 0:t.length)&&!t.includes(Pe.Above)||(i=Object.assign(Object.assign({},i),{[Pe.Above]:{value:Pe.Above,name:e.localize("ui.panel.config.automation.editor.triggers.type.numeric_state.above"),icon:"hass:greater-than"}})),(null==t?void 0:t.length)&&!t.includes(Pe.Below)||(i=Object.assign(Object.assign({},i),{[Pe.Below]:{value:Pe.Below,name:e.localize("ui.panel.config.automation.editor.triggers.type.numeric_state.below"),icon:"hass:less-than"}})),(null==t?void 0:t.length)&&!t.includes(Pe.Equal)||(i=Object.assign(Object.assign({},i),{[Pe.Equal]:{value:Pe.Equal,name:es("ui.panel.conditions.equal_to",ct(e)),icon:"hass:equal"}})),(null==t?void 0:t.length)&&!t.includes(Pe.Unequal)||(i=Object.assign(Object.assign({},i),{[Pe.Unequal]:{value:Pe.Unequal,name:es("ui.panel.conditions.unequal_to",ct(e)),icon:"hass:not-equal-variant"}})),i};let Ga=class extends ee{constructor(){super(...arguments),this.addCondition=!1,this.tags=[],this.startDate="",this.endDate=""}async firstUpdated(){var e,t,i;if(null===(e=this.config)||void 0===e?void 0:e.tags){(async()=>{await Pa()})();const e=(await os(this.hass)).map(e=>e.name),t=dt(this.config.tags);this.tags=[...e,...t.filter(t=>!e.includes(t)&&"none"!=t)]}(await window.loadCardHelpers()).importMoreInfoControl("input_datetime"),this.startDate=(null===(t=this.schedule)||void 0===t?void 0:t.start_date)||la(new Date,ct(this.hass),!0),this.endDate=(null===(i=this.schedule)||void 0===i?void 0:i.end_date)||la(new Date,ct(this.hass),!0)}render(){var e,t;if(!this.hass||!this.config||!this.schedule)return N``;let i=[{name:this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.label"),value:Le.Repeat,icon:"refresh"},{name:this.hass.localize("ui.dialogs.more_info_control.vacuum.stop"),value:Le.Pause,icon:"stop"},{name:this.hass.localize("ui.common.delete"),value:Le.Single,icon:"trash-can-outline"}];return it(this.schedule.start_date)&&(i=i.filter(e=>e.value!=Le.Repeat)),N` + +
+
+ ${this.config.title?"string"==typeof this.config.title?this.config.title:es("ui.panel.common.title",ct(this.hass)):""} +
+ +
+
+ ${this.addCondition?this.renderAddCondition():N` +
+ ${this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.conditions")} + ${!this.schedule.timeslots[0].conditions||this.schedule.timeslots[0].conditions.length<2?"":N` +
+ ${es("ui.panel.conditions.any",ct(this.hass))} + + ${es("ui.panel.conditions.all",ct(this.hass))} +
+ `} +
+ ${this.renderConditions()} + +
+
+ + + ${this.hass.localize("ui.dialogs.helper_settings.input_select.add")} + +
+
+ ${this.schedule.timeslots[0].stop&&this.schedule.timeslots[0].conditions&&this.schedule.timeslots[0].conditions.length>0?N` + + this.shadowRoot.querySelector("#track_conditions").click()} + > + ${es("ui.panel.conditions.track_conditions",ct(this.hass))} + + `:""} +
+
+ +
${es("ui.panel.options.period",ct(this.hass))}
+
+
+ + +
+
+
+ + ${nt((null===(e=es("ui.components.date.days_range",ct(this.hass)).split("{").shift())||void 0===e?void 0:e.trim())||"")} + + + +
+ +
+ + ${nt((null===(t=es("ui.components.date.days_range",ct(this.hass)).split("}")[1].split("{").shift())||void 0===t?void 0:t.trim())||"")} + + + +
+
+
+ +
${this.hass.localize("ui.components.area-picker.add_dialog.name")}
+ + + ${this.config.tags?N` +
${this.hass.localize("ui.panel.config.tag.caption")}
+ + + `:""} + +
${es("ui.panel.options.repeat_type",ct(this.hass))}
+ + + `} +
+
+ ${this.addCondition?N` + ${this.hass.localize("ui.common.save")} + ${void 0!==this.editItem?N` + ${this.hass.localize("ui.common.delete")} + `:""} + ${this.hass.localize("ui.common.cancel")} + `:N` + e.actions.length).length} + > + ${this.hass.localize("ui.common.save")} + + ${this.hass.localize("ui.common.back")} + `} +
+
+ `}renderAddCondition(){if(!this.addCondition||!this.hass||!this.config)return N``;if(this.selectedEntity){const e=this.selectedEntity,t=Ca(e.id,this.hass,this.config);let i;if((null==t?void 0:t.type)==Ie.Level)i=[Pe.Above,Pe.Below];else if((null==t?void 0:t.type)==Ie.List)i=[Pe.Equal,Pe.Unequal];else{const t=e.id in this.hass.states?this.hass.states[e.id].state:null;i=!t||["unavailable","unknown"].includes(t)?[Pe.Equal,Pe.Unequal,Pe.Above,Pe.Below]:isNaN(Number(t))?[Pe.Equal,Pe.Unequal]:[Pe.Above,Pe.Below]}const s=Wa(this.hass,i);return N` +
${this.hass.localize("ui.components.entity.entity-picker.entity")}
+
+ + + ${nt(e.name)} + + {this.selectedEntity=void 0}} + > + +
+ +
+ ${this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.condition")} +
+ this.conditionMatchType=e.target.value} + > + + +
${this.hass.localize("ui.panel.config.automation.editor.conditions.type.state.label")}
+ this.conditionValue=e.detail.value} + > + + `}{const e=wa(Aa(this.hass,this.config,{filterActions:!1,filterStates:!0}),this.config,this.hass);e.sort((e,t)=>e.name.trim().toLowerCase()st(e,this.selectedGroup)).entities.map(e=>Gs(e,this.hass,this.config)),t.sort((e,t)=>e.name.trim().toLowerCase()${this.hass.localize("ui.panel.config.users.editor.group")} + + st(e,this.selectedGroup))} + @change=${this.selectGroup} + > + ${es("ui.panel.entity_picker.no_groups_defined",ct(this.hass))} + + +
${this.hass.localize("ui.components.entity.entity-picker.entity")}
+ st(e,this.selectedEntity))} + @change=${this.selectEntity} + > + ${this.selectedGroup?es("ui.panel.entity_picker.no_entities_for_group",ct(this.hass)):es("ui.panel.entity_picker.no_group_selected",ct(this.hass))} + + `}}selectGroup(e){this.selectedGroup=e.detail,this.selectedEntity=void 0}selectEntity(e){this.selectedEntity=e.detail,this.conditionMatchType=void 0,this.conditionValue=void 0}renderConditions(){if(!this.hass||!this.schedule)return N``;const e=this.schedule.timeslots[0].conditions||[];return e.length?e.map((e,t)=>{const i=Gs(e.entity_id,this.hass,this.config),s=Ca(e.entity_id,this.hass,this.config);return N` +
+ + + ${nt(i.name)} ${Wa(this.hass)[e.match_type].name.toLowerCase()} + ${s?s.type==Ie.List?$s(e.value,s):s.type==Ie.Level?ys(e.value,s):e.value:""} + + {this.editConditionClick(t)}} + > + +
+ `}):N` +
${es("ui.panel.conditions.no_conditions_defined",ct(this.hass))}
+ `}addConditionClick(){this.addCondition=!0,this.selectedEntity=void 0,this.selectedGroup=void 0}confirmConditionClick(){var e;if(!(this.selectedEntity&&this.config&&this.hass&&this.schedule&&this.conditionMatchType&&it(this.conditionValue)))return;const t={entity_id:this.selectedEntity.id,match_type:this.conditionMatchType,value:this.conditionValue,attribute:"state"},i=(null===(e=this.schedule.timeslots[0].conditions)||void 0===e?void 0:e.length)?[...this.schedule.timeslots[0].conditions]:[],s=this.schedule.timeslots[0].condition_type?this.schedule.timeslots[0].condition_type:qe.Any;void 0===this.editItem?i.push(t):i.splice(this.editItem,1,t),this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:this.schedule.timeslots.map(e=>Object.assign(e,{conditions:i,condition_type:s}))}),this.addCondition=!1,this.editItem=void 0}cancelConditionClick(){this.addCondition=!1,this.editItem=void 0}editConditionClick(e){if(!(this.schedule&&this.schedule.timeslots[0].conditions&&this.hass&&this.config))return;const t=this.schedule.timeslots[0].conditions[e];if(!t)return;this.editItem=e;const i=wa(Aa(this.hass,this.config,{filterActions:!1,filterStates:!0}),this.config,this.hass);this.selectedGroup=i.find(e=>e.entities.includes(t.entity_id)),this.selectedEntity=Gs(t.entity_id,this.hass,this.config),this.conditionMatchType=t.match_type,this.conditionValue=t.value,this.addCondition=!0}deleteConditionClick(){var e;if(!this.config||!this.hass||!this.schedule||void 0===this.editItem)return;const t=(null===(e=this.schedule.timeslots[0].conditions)||void 0===e?void 0:e.length)?[...this.schedule.timeslots[0].conditions]:[];t.splice(this.editItem,1),this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:this.schedule.timeslots.map(e=>Object.assign(e,{conditions:t}))}),this.addCondition=!1,this.editItem=void 0}conditionTypeSwitchClick(e){if(!this.schedule)return;const t=e.target.checked?qe.All:qe.Any;this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:this.schedule.timeslots.map(e=>Object.assign(e,{condition_type:t}))})}trackConditionsClick(e){if(!this.schedule)return;const t=e.target.checked;this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:this.schedule.timeslots.map(e=>Object(Object.assign(Object.assign({},e),{track_conditions:t})))})}_setStartDate(e){const t=String(e.detail.value);if(!t)return;ta(t)>ta(this.endDate)&&(this.schedule=Object.assign(Object.assign({},this.schedule),{end_date:t}),this.endDate=t),this.schedule=Object.assign(Object.assign({},this.schedule),{start_date:t}),this.startDate=t}_setEndDate(e){const t=String(e.detail.value);if(!t)return;ta(this.startDate)>ta(t)&&(this.schedule=Object.assign(Object.assign({},this.schedule),{start_date:t}),this.startDate=t),this.schedule=Object.assign(Object.assign({},this.schedule),{end_date:t}),this.endDate=t}toggleEnableDateRange(e){const t=e.target.checked;this.shadowRoot.querySelectorAll("ha-date-input");this.schedule=Object.assign(Object.assign({},this.schedule),{start_date:t?this.startDate:void 0,end_date:t?this.endDate:void 0,repeat_type:t?this.schedule.repeat_type==Le.Repeat?Le.Pause:this.schedule.repeat_type:this.schedule.repeat_type==Le.Pause?Le.Repeat:this.schedule.repeat_type})}updateName(e){const t=e.target.value;this.schedule=Object.assign(Object.assign({},this.schedule),{name:t})}updateRepeatType(e){const t=e.target.value;this.schedule=Object.assign(Object.assign({},this.schedule),{repeat_type:t})}getTagOptions(){var e;let t=[...this.tags];return(null===(e=this.schedule)||void 0===e?void 0:e.tags.length)&&(t=[...t,...this.schedule.tags.filter(e=>!t.includes(e))]),t.sort(at),t.map(e=>Object({name:e,value:e}))}updateTags(e){let t=e.target.value;t=t.map(e=>e.trim()),t=t.filter(e=>"none"!=e),t.sort(at),this.schedule=Object.assign(Object.assign({},this.schedule),{tags:t})}cancelClick(){if(this.addCondition)this.addCondition=!this.addCondition;else{const e=new CustomEvent("cancelClick");this.dispatchEvent(e)}}saveClick(){const e=new CustomEvent("saveClick",{detail:this.schedule});this.dispatchEvent(e)}backClick(){const e=new CustomEvent("backClick",{detail:this.schedule});this.dispatchEvent(e)}};Ga.styles=r` + ${ts} + div.summary { + display: flex; + flex-direction: row; + align-items: center; + padding: 4px 0px; + background: rgba(var(--rgb-primary-color), 0.15); + color: var(--dark-primary-color); + border-radius: 8px; + margin: 2px 0px; + font-size: 14px; + font-weight: 500; + } + div.summary ha-icon { + flex: 0 0 48px; + justify-content: center; + display: flex; + } + div.summary span { + flex: 1 0 60px; + display: flex; + } + div.summary ha-icon-button { + margin: -8px 0px; + } + div.date-range { + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + div.date-range div { + display: flex; + flex-shrink: 0; + flex-grow: 1; + flex-basis: 160px; + align-items: center; + } + div.date-range div span { + display: inline-flex; + padding: 0px 10px; + } + div.date-range div:first-child span { + padding-left: 0px; + } + div.condition-options { + display: flex; + flex-direction: row; + margin-top: 10px; + } + div.track-conditions { + display: flex; + flex-direction: row; + text-align: right; + align-items: center; + max-width: 50%; + } + div.track-conditions span { + text-align: left; + } + ha-textfield { + width: 100%; + } + `,t([ae()],Ga.prototype,"hass",void 0),t([ae()],Ga.prototype,"config",void 0),t([ae()],Ga.prototype,"schedule",void 0),t([ae()],Ga.prototype,"selectedGroup",void 0),t([ae()],Ga.prototype,"selectedEntity",void 0),t([ae()],Ga.prototype,"conditionMatchType",void 0),t([ae()],Ga.prototype,"conditionValue",void 0),t([ae()],Ga.prototype,"editItem",void 0),t([ae()],Ga.prototype,"addCondition",void 0),t([ae()],Ga.prototype,"tags",void 0),t([oe()],Ga.prototype,"startDate",void 0),t([oe()],Ga.prototype,"endDate",void 0),Ga=t([ie("scheduler-options-card")],Ga);let Za=class extends ee{constructor(){super(...arguments),this.scheduleEntities=[],this._cardTab=!1,this.selectedDomain=""}setConfig(e){this._config=e}async firstUpdated(){await Pa(),this.scheduleEntities=(await ss(this.hass)).map(e=>e.entity_id);const e=(await os(this.hass)).map(e=>e.name);e.sort(at),this.tagOptions=e}render(){return this.hass&&this._config?N` + + + + + +
+ ${this._cardTab?N` +
${es("ui.panel.card_editor.fields.title.heading",ct(this.hass))}
+ this._setTitleFormatOption(e.target.value)} + > + + ${"string"==typeof this._config.title?N` + {this._updateConfig({title:String(e.target.value)})}} + > + `:""} + +
+ ${es("ui.panel.card_editor.fields.discover_existing.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.discover_existing.description",ct(this.hass))} +
+ {this._updateConfig({discover_existing:e.target.checked})}} + > + + +
+ ${es("ui.panel.card_editor.fields.time_step.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.time_step.description",ct(this.hass))} +
+ {this._updateConfig({time_step:Number(e.detail.value)})}} + > + + +
+ ${es("ui.panel.card_editor.fields.sort_by.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.sort_by.description",ct(this.hass))} +
+ +
+ + + + + + +
+ +
+ + + +
+ +
+ ${es("ui.panel.card_editor.fields.display_format_primary.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.display_format_primary.description",ct(this.hass))} +
+ + + + + + + + +
+ ${es("ui.panel.card_editor.fields.display_format_secondary.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.display_format_secondary.description",ct(this.hass))} +
+ + + + + + + + + + + + + + + + + +
+ ${es("ui.panel.card_editor.fields.show_header_toggle.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.show_header_toggle.description",ct(this.hass))} +
+ {this._updateConfig({show_header_toggle:e.target.checked})}} + > + + + ${void 0!==this.tagOptions?N` +
+ ${es("ui.panel.card_editor.fields.tags.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.tags.description",ct(this.hass))} +
+ + + `:""} + `:N` +
+ ${es("ui.panel.card_editor.fields.entities.heading",ct(this.hass))} +
+
+ ${es("ui.panel.card_editor.fields.entities.description",ct(this.hass))} +
+ ${this.getDomainSwitches()} + `} +
+ `:N``}_selectTab(e){this._cardTab=1===e.detail.index}_updateConfig(e){this._config&&(this._config=Object.assign(Object.assign({},this._config),e),Me(this,"config-changed",{config:this._config}))}_setTitleFormatOption(e){var t;this.hass&&("standard"==e?this._updateConfig({title:!0}):"hidden"==e?this._updateConfig({title:!1}):this._updateConfig({title:"string"==typeof(null===(t=this._config)||void 0===t?void 0:t.title)?this._config.title:es("ui.panel.common.title",ct(this.hass))}))}getTitleOption(){return this.hass&&this._config?"string"==typeof this._config.title?"custom":this._config.title?"standard":"hidden":""}updateTags(e){if(!this._config||!this.hass)return;let t=e.target.value;t=t.map(e=>e.trim()),t.sort(at),this._updateConfig({tags:t})}getTagOptions(){if(!this._config||!this.hass)return[];let e=this.tagOptions||[];if(this._config.tags){const t=dt(this._config.tags);e=[...e,...t.filter(t=>!e.includes(t))]}return e.map(e=>Object({name:e,value:e}))}_setSortBy(e){var t;const i=e.target.checked,s=e.target.value;let a=dt((null===(t=this._config)||void 0===t?void 0:t.sort_by)||We.sort_by);"state"!=s&&i&&(a=a.filter(e=>"state"==e)),!a.includes(s)&&i&&(a=[...a,s]),a.includes(s)&&!i&&(a=a.filter(e=>e!=s)),this._updateConfig({sort_by:a})}_setDisplayOptionsPrimary(e){var t;const i=e.target.value,s=Object.assign(Object.assign({},(null===(t=this._config)||void 0===t?void 0:t.display_options)||We.display_options),{primary_info:i});this._updateConfig({display_options:s})}_setDisplayOptionsSecondary(e){var t;const i=e.target.value,s=e.target.checked;let a=Object.assign({},(null===(t=this._config)||void 0===t?void 0:t.display_options)||We.display_options),o=dt(a.secondary_info||[]);o=s?Array.from(new Set([...o,i])):o.filter(e=>e!==i),o.sort((e,t)=>{const i={"relative-time":1,time:o.includes("relative-time")?3:2,days:o.includes("relative-time")?2:3,"additional-tasks":4},s=Object.keys(i).includes(e)?i[e]:5,a=Object.keys(i).includes(t)?i[t]:5;return s>a?1:s"switch"!==Ae(e)||!this.scheduleEntities.includes(e)).map(e=>Gs(e,this.hass,{include:["*"]})).filter(e=>za(e.id,this.hass)||Ys(e.id,this.hass,We)),t=e.map(e=>Ae(e.id)).filter((e,t,i)=>i.indexOf(e)===t);return t.sort((e,t)=>e.trim().toLowerCase(){var i;const s=e.filter(e=>Ae(e.id)==t).length,a=e.filter(e=>Ae(e.id)==t),o=a.filter(e=>ls(e.id,this._config)).length;return s?N` +
this.toggleShowDomain(t)}> + + +
+ ${t} +
+ ${es("ui.panel.card_editor.fields.entities.included_number",ct(this.hass),["{number}","{total}"],[o,s])} +
+
+ e.stopPropagation()} + @change=${e=>this.toggleSelectEntity(t,e.target.checked)} + ?checked=${ls(t,this._config)} + ?disabled=${ls(t,{groups:null===(i=this._config)||void 0===i?void 0:i.groups})} + > + +
+ ${this.selectedDomain==t?N` +
+ ${a.map(e=>{var i,s;return N` +
this.toggleSelectEntity(e.id)}> + +
+ ${e.name} +
+ ${e.id} +
+
+ +
+ `})} +
+ `:""} + `:""})}toggleShowDomain(e){this._config&&this.hass&&(this.selectedDomain!=e?this.selectedDomain=e:this.selectedDomain="")}toggleSelectEntity(e,t){if(!this._config||!this.hass)return;const i=ls(e,this._config);void 0===t&&(t=!i);const s=Ae(e);let a=[...this._config.include||[]],o=[...this._config.exclude||[]];if(!i&&t)o.includes(e)&&(o=o.filter(t=>t!=e)),a.includes(e)||(a=[...a,e]);else{if(!i||t)return;(s&&a.includes(s)||ls(e,{customize:this._config.customize})||s&&ls(s,{customize:this._config.customize}))&&(o=[...o,e]),a.includes(e)&&(a=a.filter(t=>t!=e))}a.sort(at),o.sort(at),this._updateConfig({include:a,exclude:o})}static get styles(){return r` + ${ts} + div.row { + display: flex; + align-items: center; + flex-direction: row; + cursor: pointer; + margin: 10px 0px; + } + div.divider { + height: 1px; + background: var(--divider-color); + } + .info { + margin-left: 16px; + flex: 1 0 60px; + } + .info, + .info > * { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .secondary { + display: block; + color: var(--secondary-text-color); + } + div.row ha-icon { + padding: 8px; + color: var(--state-icon-color); + } + div.row state-badge { + flex: 0 0 40px; + } + div.row ha-switch { + padding: 13px 5px; + } + ha-textfield { + width: 100%; + } + `}};t([ae()],Za.prototype,"hass",void 0),t([ae()],Za.prototype,"_config",void 0),t([ae()],Za.prototype,"scheduleEntities",void 0),t([ae()],Za.prototype,"tagOptions",void 0),t([oe()],Za.prototype,"_cardTab",void 0),t([ae()],Za.prototype,"selectedDomain",void 0),Za=t([ie("scheduler-card-editor")],Za);let Ka=class extends ee{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params=void 0}render(){return this._params?N` + +
+ + + + ${this.hass.localize("state_badge.default.error")} + + +
+
+ ${this._params.error||""} +
+ + + ${this.hass.localize("ui.dialogs.generic.ok")} + +
+ `:N``}static get styles(){return r` + div.wrapper { + color: var(--primary-text-color); + } + `}};t([ae({attribute:!1})],Ka.prototype,"hass",void 0),t([oe()],Ka.prototype,"_params",void 0),Ka=t([ie("dialog-error")],Ka);var Ja=Object.freeze({__proto__:null,get DialogError(){return Ka}});let Xa=class extends ee{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params&&this._params.cancel(),this._params=void 0}render(){return this._params?N` + +
+ + + + Defective entity + + +
+
+ This schedule is defective and cannot be edited with the card. Consider to delete the item and recreate it. If + the problem persists, please report the issue on GitHub. +
+ + + ${this.hass.localize("ui.dialogs.generic.cancel")} + + + ${this.hass.localize("ui.common.delete")} + +
+ `:N``}confirmClick(){this._params.confirm()}cancelClick(){this._params.cancel()}static get styles(){return r` + div.wrapper { + color: var(--primary-text-color); + } + `}};t([ae({attribute:!1})],Xa.prototype,"hass",void 0),t([oe()],Xa.prototype,"_params",void 0),Xa=t([ie("dialog-delete-defective")],Xa);var Qa=Object.freeze({__proto__:null,get DialogDeleteDefective(){return Xa}});const eo=(e,t,i,s)=>{if(!e)return null;const a=Ws(e,s);let o=i.find(e=>us(e,a,!0));if(!o)return null;let n=t.map(e=>Va(e,o));return n=Object.keys(o.variables||{}).filter(t=>Object.keys(e.service_data||{}).includes(t)).reduce((t,i)=>{if(!t)return t;switch(o.variables[i].type){case Ie.Level:const s=o.variables[i];let a=Number(e.service_data[i]);return a/=s.scale_factor,a=Math.round(a/s.step)*s.step,a=parseFloat(a.toPrecision(12)),a>s.max?a=s.max:aObject.assign(e,{service_data:Object.assign(Object.assign({},e.service_data),{[i]:a})}));case Ie.List:return o.variables[i].options.some(t=>t.value==e.service_data[i])?t.map(t=>Object.assign(t,{service_data:Object.assign(Object.assign({},t.service_data),{[i]:e.service_data[i]})})):null;case Ie.Text:return t.map(t=>Object.assign(t,{service_data:Object.assign(Object.assign({},t.service_data),{[i]:e.service_data[i]})}));default:return t}},n),n};window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-card",name:"Scheduler Card",description:"Card to manage schedule entities made with scheduler-component."}),console.info("%c SCHEDULER-CARD \n%c Version: "+"v2.3.4".padEnd(7," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),e.SchedulerCard=class extends ee{constructor(){super(...arguments),this._view=Ye.Overview,this.actions=[],this.translationsLoaded=!1,this.editItem=null}static getConfigElement(){return document.createElement("scheduler-card-editor")}set hass(e){this._hass=e}firstUpdated(){const e=this._hass;if(e.localize("ui.panel.config.automation.editor.actions.name"))this.translationsLoaded=!0;else{document.querySelector("home-assistant")._loadFragmentTranslations(e.language,"config").then(()=>{this._hass.localize})}}shouldUpdate(e){const t=e.get("_hass");return!t||1!=e.size||(t.localize("ui.panel.config.automation.editor.actions.name")?this._view==Ye.Overview:(this.translationsLoaded=!0,!0))}setConfig(e){ut(e);const t=Object.assign(Object.assign({},We),e);this._config=t}getCardSize(){return 9}render(){return this._hass&&this._config&&this.translationsLoaded?this._view==Ye.Overview?N` + + + `:this._view==Ye.NewSchedule?N` + + + `:this._view==Ye.TimePicker||this._view==Ye.TimeScheme?N` + + + `:this._view==Ye.Options?N` + + + `:N``:N``}_addItemClick(){this._view=Ye.NewSchedule,this.editItem=null,this.entities=[],this.actions=[],this.schedule=void 0}_cancelEditClick(){this._view=Ye.Overview,this.editItem=null}_confirmItemClick(e){if(!this._hass||!this._config)return;const t=e.detail.entities;this.entities=t.map(e=>Gs(e,this._hass,this._config));const i=Boolean(e.detail.timeSchemeSelected),s=e.detail.action,a=this.schedule,o=1==dt(this._config.tags).length?dt(this._config.tags).slice(0,1):[];if(i){this.actions=Ys(t,this._hass,this._config);const e=[{start:"00:00:00",stop:"08:00:00",actions:[]},{start:"08:00:00",stop:"16:00:00",actions:[]},{start:"16:00:00",stop:"00:00:00",actions:[]}];if(a){const i=a.timeslots.map(e=>e.actions[0]).map(e=>eo(e,t,this.actions,this._hass));this.schedule=Object.assign(Object.assign({},a),{timeslots:a.timeslots.length>1&&a.timeslots.every(e=>e.stop)?a.timeslots.map((e,t)=>Object.assign(e,{actions:i[t]||[]})):e})}else this.schedule={weekdays:["daily"],timeslots:e,repeat_type:Le.Repeat,tags:o};this._view=Ye.TimeScheme}else{this.actions=[s];const e={start:"12:00:00",actions:t.map(e=>Va(e,this.actions[0]))};this.schedule=a?Object.assign(Object.assign({},a),{timeslots:1!=a.timeslots.length||a.timeslots[0].stop?[e]:[Object.assign(Object.assign({},a.timeslots[0]),{actions:eo(a.timeslots[0].actions[0],t,this.actions,this._hass)||e.actions})]}):{weekdays:["daily"],timeslots:[e],repeat_type:Le.Repeat,tags:o},this._view=Ye.TimePicker}}_editActionClick(e){this.schedule=e.detail,this._view=Ye.NewSchedule}async _saveItemClick(e){if(!this._hass)return;let t=e.detail;if(t=Object.assign(Object.assign({},t),{timeslots:t.timeslots.map(e=>{var t;return e.actions&&e.actions.length?(e.actions.some(e=>!e.entity_id||"notify"==Ae(e.entity_id||""))&&(e=Object.assign(Object.assign({},e),{actions:e.actions.map(e=>e.entity_id&&"notify"!=Ae(e.entity_id||"")?e:Qe(e,"entity_id"))})),e.stop||(e=Qe(e,"stop")),(null===(t=e.conditions)||void 0===t?void 0:t.length)||(e=Qe(e,"conditions","condition_type")),e):null}).filter(it)}),this.editItem){const e=await as(this._hass,this.editItem);st(Qe(t,"timeslots"),Qe(Xe(e,Object.keys(t)),"timeslots"))&&t.timeslots.length==e.timeslots.length&&t.timeslots.every((t,i)=>st(t,e.timeslots[i]))?(this.editItem=null,this._view=Ye.Overview):(e.enabled||this._hass.callService("switch","turn_on",{entity_id:e.entity_id}),function(e){return!!e&&null!==e.match(/^Schedule\ #[a-f0-9]{6}/)}(t.name)&&(t=Object.assign(Object.assign({},t),{name:""})),(i=this._hass,s=Object.assign(Object.assign({},t),{schedule_id:this.editItem}),i.callApi("POST","scheduler/edit",s)).catch(e=>ns(e,this)).then(()=>{this.editItem=null,this._view=Ye.Overview}))}else((e,t)=>e.callApi("POST","scheduler/add",t))(this._hass,t).catch(e=>ns(e,this)).then(()=>{this._view=Ye.Overview});var i,s}_deleteItemClick(){if(!this.editItem||!this._hass)return;const e=this.editItem;var t,i;(t=this._hass,i=e,t.callApi("POST","scheduler/remove",{schedule_id:i})).catch(e=>ns(e,this)).then(()=>{this.editItem=null,this._view=Ye.Overview})}async _editItemClick(e){if(!this._hass||!this._config)return;const t=await as(this._hass,e.detail);if(!t)return;const i=tt(et(t.timeslots.map(e=>e.actions.map(e=>e.entity_id||e.service))));this.entities=i.map(e=>Gs(e,this._hass,this._config));let s=Ys(i,this._hass,this._config);const a=tt(et(t.timeslots.map(e=>e.actions)));let o=a.filter(e=>!s.some(t=>us(t,e,!0)));if(o.length&&tt(o).forEach(e=>s.push(Ws(e,this._hass))),this.actions=s,this.schedule={weekdays:t.weekdays,timeslots:t.timeslots,repeat_type:t.repeat_type,name:t.name,tags:t.tags||[],start_date:t.start_date,end_date:t.end_date},this.editItem=t.schedule_id,this.entities.length&&this.schedule.timeslots.length)this.schedule.timeslots.every(e=>e.stop)?(this.schedule=Object.assign(Object.assign({},this.schedule),{timeslots:lt(this.schedule.timeslots,this._hass)}),this.actions.length?this._view=Ye.TimeScheme:ns({error:"",body:{message:`Could not compute actions for the schedule #${e.detail}.`}},this)):(this.actions=this.actions.filter(e=>a.find(t=>us(e,t,!0))).reduce((e,t)=>[t],[]),this.actions.length?this._view=Ye.TimePicker:ns({error:"",body:{message:`Could not compute actions for schedule #${e.detail}.`}},this));else{await new Promise(e=>{Me(this,"show-dialog",{dialogTag:"dialog-delete-defective",dialogImport:()=>Promise.resolve().then((function(){return Qa})),dialogParams:{cancel:()=>{e(!1)},confirm:()=>{e(!0)}}})})?this._deleteItemClick():this._cancelEditClick()}}_gotoOptionsClick(e){this.schedule=e.detail,this._view=Ye.Options}_optionsBackClick(e){this.schedule=e.detail,this.schedule.timeslots.every(e=>e.stop)?this._view=Ye.TimeScheme:this._view=Ye.TimePicker}},t([ae()],e.SchedulerCard.prototype,"_config",void 0),t([ae()],e.SchedulerCard.prototype,"_hass",void 0),t([ae()],e.SchedulerCard.prototype,"_view",void 0),t([ae()],e.SchedulerCard.prototype,"entities",void 0),t([ae()],e.SchedulerCard.prototype,"actions",void 0),t([ae()],e.SchedulerCard.prototype,"schedule",void 0),t([ae()],e.SchedulerCard.prototype,"translationsLoaded",void 0),e.SchedulerCard=t([ie("scheduler-card")],e.SchedulerCard)}({}); diff --git a/hacs.json b/hacs.json index ddbda2fd..ac888ccd 100644 --- a/hacs.json +++ b/hacs.json @@ -1,4 +1,5 @@ { "name": "Scheduler Card", - "render_readme": "true" + "render_readme": "true", + "homeassistant": "2022.3.0" } diff --git a/src/const.ts b/src/const.ts index 0b04d6c1..2955c996 100755 --- a/src/const.ts +++ b/src/const.ts @@ -1,6 +1,6 @@ import { CardConfig } from './types'; -export const CARD_VERSION = 'v2.3.3'; +export const CARD_VERSION = 'v2.3.4'; export const DefaultTimeStep = 10;