From ad84a8cf40237c0d8ac0c3ef091077a4b3635b2f Mon Sep 17 00:00:00 2001 From: niels Date: Wed, 9 Jun 2021 07:11:53 +0200 Subject: [PATCH] release v1.6.0 --- .../alarmo/card/dist/alarmo-card.js | 56 +- custom_components/alarmo/card/src/const.ts | 2 +- custom_components/alarmo/const.py | 2 +- .../alarmo/frontend/dist/alarm-panel.js | 1460 ++++++++++------- .../alarmo/frontend/src/const.ts | 2 +- 5 files changed, 903 insertions(+), 619 deletions(-) diff --git a/custom_components/alarmo/card/dist/alarmo-card.js b/custom_components/alarmo/card/dist/alarmo-card.js index 33a2f95..fc6641c 100644 --- a/custom_components/alarmo/card/dist/alarmo-card.js +++ b/custom_components/alarmo/card/dist/alarmo-card.js @@ -39,7 +39,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const g=new WeakMap,f=t=>"function"==typeof t&&g.has(t),_={},b={}; +const g=new WeakMap,f=t=>"function"==typeof t&&g.has(t),b={},_={}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -79,7 +79,7 @@ class y{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const x=t=>null===t||!("object"==typeof t||"function"==typeof t),k=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class C{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t{try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class E{constructor(t,e,s){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;f(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=_,t(this)}if(this.__pendingValue===_)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=D(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=_}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const D=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) + */const x=t=>null===t||!("object"==typeof t||"function"==typeof t),k=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class C{constructor(t,e,s){this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(let t=0;t{try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class E{constructor(t,e,s){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;f(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=D(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const D=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -105,7 +105,7 @@ class y{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const I=new + */const U=new /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ class y{constructor(t,e,s){this.__parts=[],this.template=t,this.processor=e,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(t,e,s,i){const r=e[0];if("."===r){return new T(t,e.slice(1),s).parts}if("@"===r)return[new E(t,e.slice(1),i.eventContext)];if("?"===r)return[new N(t,e.slice(1),s)];return new C(t,e,s).parts}handleTextExpression(t){return new $(t)}}; +class{handleAttributeExpressions(t,e,s,i){const r=e[0];if("."===r){return new M(t,e.slice(1),s).parts}if("@"===r)return[new E(t,e.slice(1),i.eventContext)];if("?"===r)return[new N(t,e.slice(1),s)];return new C(t,e,s).parts}handleTextExpression(t){return new $(t)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -132,7 +132,7 @@ class{handleAttributeExpressions(t,e,s,i){const r=e[0];if("."===r){return new T( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const U=(t,...e)=>new S(t,e,"html",I) + */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const V=(t,...e)=>new S(t,e,"html",U) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -145,7 +145,7 @@ class{handleAttributeExpressions(t,e,s,i){const r=e[0];if("."===r){return new T( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,V=(t,e)=>`${t}--${e}`;let j=!0;void 0===window.ShadyCSS?j=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),j=!1);const Y=t=>e=>{const s=V(e.type,t);let i=O.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},O.set(s,i));let a=i.stringsArray.get(e.strings);if(void 0!==a)return a;const n=e.strings.join(r);if(a=i.keyString.get(n),void 0===a){const s=e.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(s,t),a=new o(e,s),i.keyString.set(n,a)}return i.stringsArray.set(e.strings,a),a},q=["html","svg"],H=new Set,L=(t,e,s)=>{H.add(t);const i=s?s.element:document.createElement("template"),r=e.querySelectorAll("style"),{length:a}=r;if(0===a)return void window.ShadyCSS.prepareTemplateStyles(i,t);const n=document.createElement("style");for(let t=0;t{q.forEach(e=>{const s=O.get(V(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),u(t,s)})})})(t);const o=i.content;s?function(t,e,s=null){const{element:{content:i},parts:r}=t;if(null==s)return void i.appendChild(e);const a=document.createTreeWalker(i,133,null,!1);let n=m(r),o=0,l=-1;for(;a.nextNode();){l++;for(a.currentNode===s&&(o=p(e),s.parentNode.insertBefore(e,s));-1!==n&&r[n].index===l;){if(o>0){for(;-1!==n;)r[n].index+=o,n=m(r,n);return}n=m(r,n)}}}(s,n,o.firstChild):o.insertBefore(n,o.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(s){o.insertBefore(n,o.firstChild);const t=new Set;t.add(n),u(s,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const F={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},B=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:B};class J extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdateInternal(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||W}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=B){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||F,r="function"==typeof i?i:i.fromAttribute;return r?r(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||F.toAttribute)(t,s)}initialize(){this._updateState=0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=W){const i=this.constructor,r=i._attributeNameForProperty(t,s);if(void 0!==r){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(r):this.setAttribute(r,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,s){let i=!0;if(void 0!==t){const r=this.constructor;s=s||r.getPropertyOptions(t),r._valueHasChanged(this[t],e,s.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==s.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}J.finalized=!0; + */,I=(t,e)=>`${t}--${e}`;let j=!0;void 0===window.ShadyCSS?j=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),j=!1);const Y=t=>e=>{const s=I(e.type,t);let i=O.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},O.set(s,i));let a=i.stringsArray.get(e.strings);if(void 0!==a)return a;const n=e.strings.join(r);if(a=i.keyString.get(n),void 0===a){const s=e.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(s,t),a=new o(e,s),i.keyString.set(n,a)}return i.stringsArray.set(e.strings,a),a},q=["html","svg"],H=new Set,L=(t,e,s)=>{H.add(t);const i=s?s.element:document.createElement("template"),r=e.querySelectorAll("style"),{length:a}=r;if(0===a)return void window.ShadyCSS.prepareTemplateStyles(i,t);const n=document.createElement("style");for(let t=0;t{q.forEach(e=>{const s=O.get(I(e,t));void 0!==s&&s.keyString.forEach(t=>{const{element:{content:e}}=t,s=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{s.add(t)}),u(t,s)})})})(t);const o=i.content;s?function(t,e,s=null){const{element:{content:i},parts:r}=t;if(null==s)return void i.appendChild(e);const a=document.createTreeWalker(i,133,null,!1);let n=m(r),o=0,l=-1;for(;a.nextNode();){l++;for(a.currentNode===s&&(o=p(e),s.parentNode.insertBefore(e,s));-1!==n&&r[n].index===l;){if(o>0){for(;-1!==n;)r[n].index+=o,n=m(r,n);return}n=m(r,n)}}}(s,n,o.firstChild):o.insertBefore(n,o.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(s){o.insertBefore(n,o.firstChild);const t=new Set;t.add(n),u(s,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const F={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},B=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:B};class J extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,s)=>{const i=this._attributeNameForProperty(s,e);void 0!==i&&(this._attributeToPropertyMap.set(i,s),t.push(i))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdateInternal(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||W}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const s of e)this.createProperty(s,t[s])}}static _attributeNameForProperty(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,s=B){return s(t,e)}static _propertyValueFromAttribute(t,e){const s=e.type,i=e.converter||F,r="function"==typeof i?i:i.fromAttribute;return r?r(t,s):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const s=e.type,i=e.converter;return(i&&i.toAttribute||F.toAttribute)(t,s)}initialize(){this._updateState=0,this._updatePromise=new Promise(t=>this._enableUpdatingResolver=t),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,s){e!==s&&this._attributeToProperty(t,s)}_propertyToAttribute(t,e,s=W){const i=this.constructor,r=i._attributeNameForProperty(t,s);if(void 0!==r){const t=i._propertyValueToAttribute(e,s);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(r):this.setAttribute(r,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(t);if(void 0!==i){const t=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,s){let i=!0;if(void 0!==t){const r=this.constructor;s=s||r.getPropertyOptions(t),r._valueHasChanged(this[t],e,s.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==s.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}J.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -183,7 +183,7 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const it={};class rt extends J{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,s)=>t.reduceRight((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t),s),s=e(t,new Set),i=[];s.forEach(t=>i.unshift(t)),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new et(String(e),tt)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==it&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return it}}rt.finalized=!0,rt.render=(t,e,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const r=s.scopeName,a=R.has(e),n=j&&11===e.nodeType&&!!e.host,o=n&&!H.has(r),l=o?document.createDocumentFragment():e;if(((t,e,s)=>{let r=R.get(e);void 0===r&&(i(e,e.firstChild),R.set(e,r=new $(Object.assign({templateFactory:z},s))),r.appendInto(e)),r.setValue(t),r.commit()})(t,l,Object.assign({templateFactory:Y(r)},s)),o){const t=R.get(l);R.delete(l);const s=t.value instanceof y?t.value.template:void 0;L(r,l,s),i(e,e.firstChild),e.appendChild(l),R.set(e,t)}!a&&n&&window.ShadyCSS.styleElement(e.host)};var at=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,nt="[^\\s]+",ot=/\[([^]*?)\]/gm;function lt(t,e){for(var s=[],i=0,r=t.length;i-1?i:null}};function dt(t){for(var e=[],s=1;s3?0:(t-t%10!=10?1:0)*t%10]}},gt=dt({},mt),ft=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+ft(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ft(Math.floor(Math.abs(e)/60),2)+":"+ft(Math.abs(e)%60,2)}},bt=function(t){return+t-1},yt=[null,"[1-9]\\d?"],vt=[null,nt],wt=["isPm",nt,function(t,e){var s=t.toLowerCase();return s===e.amPm[0]?0:s===e.amPm[1]?1:null}],St=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var s=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?s:-s}return 0}],xt=(ct("monthNamesShort"),ct("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"});var kt=function(t,e,s){if(void 0===e&&(e=xt.default),void 0===s&&(s={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var i=[];e=(e=xt[e]||e).replace(ot,(function(t,e){return i.push(e),"@@@"}));var r=dt(dt({},gt),s);return(e=e.replace(at,(function(e){return _t[e](t,r)}))).replace(/@@@/g,(function(){return i.shift()}))},Ct=function(){try{(new Date).toLocaleDateString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleDateString(e,{year:"numeric",month:"long",day:"numeric"})}:function(t){return kt(t,"mediumDate")},Pt=function(){try{(new Date).toLocaleString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:function(t){return kt(t,"haDateTime")},$t=function(){try{(new Date).toLocaleTimeString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleTimeString(e,{hour:"numeric",minute:"2-digit"})}:function(t){return kt(t,"shortTime")};function Nt(t){return t.substr(0,t.indexOf("."))}function Tt(t,e,s){if("unknown"===e.state||"unavailable"===e.state)return t("state.default."+e.state);if(e.attributes.unit_of_measurement)return e.state+" "+e.attributes.unit_of_measurement;var i=function(t){return Nt(t.entity_id)}(e);if("input_datetime"===i){var r;if(!e.attributes.has_time)return r=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),Ct(r,s);if(!e.attributes.has_date){var a=new Date;return r=new Date(a.getFullYear(),a.getMonth(),a.getDay(),e.attributes.hour,e.attributes.minute),$t(r,s)}return r=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),Pt(r,s)}return e.attributes.device_class&&t("component."+i+".state."+e.attributes.device_class+"."+e.state)||t("component."+i+".state._."+e.state)||e.state}var Mt="hass:bookmark",At=function(t,e,s,i){i=i||{},s=null==s?{}:s;var r=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=s,t.dispatchEvent(r),r},Et={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 Dt(t,e){if(t in Et)return Et[t];switch(t){case"alarm_control_panel":switch(e){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 e&&"off"===e?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===e?"hass:window-closed":"hass:window-open";case"lock":return e&&"unlocked"===e?"hass:lock-open":"hass:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"hass:cast-connected":"hass:cast";case"zwave":switch(e){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 "+t+" ("+e+")"),Mt}}var zt={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},Ot={binary_sensor:function(t){var e=t.state&&"off"===t.state;switch(t.attributes.device_class){case"battery":return e?"hass:battery":"hass:battery-outline";case"cold":return e?"hass:thermometer":"hass:snowflake";case"connectivity":return e?"hass:server-network-off":"hass:server-network";case"door":return e?"hass:door-closed":"hass:door-open";case"garage_door":return e?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return e?"hass:shield-check":"hass:alert";case"heat":return e?"hass:thermometer":"hass:fire";case"light":return e?"hass:brightness-5":"hass:brightness-7";case"lock":return e?"hass:lock":"hass:lock-open";case"moisture":return e?"hass:water-off":"hass:water";case"motion":return e?"hass:walk":"hass:run";case"occupancy":return e?"hass:home-outline":"hass:home";case"opening":return e?"hass:square":"hass:square-outline";case"plug":return e?"hass:power-plug-off":"hass:power-plug";case"presence":return e?"hass:home-outline":"hass:home";case"sound":return e?"hass:music-note-off":"hass:music-note";case"vibration":return e?"hass:crop-portrait":"hass:vibrate";case"window":return e?"hass:window-closed":"hass:window-open";default:return e?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"hass:garage-open":"hass:garage";case"door":return e?"hass:door-open":"hass:door-closed";case"shutter":return e?"hass:window-shutter-open":"hass:window-shutter";case"blind":return e?"hass:blinds-open":"hass:blinds";case"window":return e?"hass:window-open":"hass:window-closed";default:return Dt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in zt)return zt[e];if("battery"===e){var s=Number(t.state);if(isNaN(s))return"hass:battery-unknown";var i=10*Math.round(s/10);return i>=100?"hass:battery":i<=0?"hass:battery-alert":"hass:battery-"+i}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"hass:thermometer":Dt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?Dt("input_datetime"):"hass:calendar":"hass:clock"}};const Rt=["1","2","3","4","5","6","7","8","9","","0","clear"],It={armed_away:"hass:shield-lock",armed_custom_bypass:"hass:security",armed_home:"hass:shield-home",armed_night:"hass:shield-home",disarmed:"hass:shield-check",arming:"hass:shield-outline",pending:"hass:shield-outline",triggered:"hass:bell-ring"},Ut="no_code_provided",Vt="invalid_code_provided",jt=["arming","pending"],Yt={type:"",entity:"",keep_keypad_visible:!1,button_scale:1};var qt={keep_keypad_visible:"Keep the keypad always visible, also when no code input is required.",button_scale:"Scaling factor to apply for resizing the buttons."},Ht={blocking_sensors:"Could not arm due to the following sensors",triggered_sensors:"Alarm was triggered by the following sensors"},Lt={editor:qt,errors:Ht},Ft={keep_keypad_visible:"Gardez le clavier toujours visible, même lorsqu'aucune saisie de code n'est requise.",button_scale:"Scaling factor to apply for resizing the buttons."},Bt={blocking_sensors:"Impossible d'armer en raison des capteurs suivants",triggered_sensors:"L'alarme a été déclenchée par les capteurs suivants"},Wt={editor:Ft,errors:Bt},Jt={en:Object.freeze({__proto__:null,editor:qt,errors:Ht,default:Lt}),fr:Object.freeze({__proto__:null,editor:Ft,errors:Bt,default:Wt})};function Zt(t,e,s="",i=""){const r=e.replace(/['"]+/g,"").replace("-","_");var a;try{a=t.split(".").reduce((t,e)=>t[e],Jt[r])}catch(e){a=t.split(".").reduce((t,e)=>t[e],Jt.en)}if(void 0===a&&(a=t.split(".").reduce((t,e)=>t[e],Jt.en)),""!==s&&""!==i){Array.isArray(s)||(s=[s]),Array.isArray(i)||(i=[i]);for(let t=0;tt.reduceRight((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t),s),s=e(t,new Set),i=[];s.forEach(t=>i.unshift(t)),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new et(String(e),tt)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==it&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return it}}rt.finalized=!0,rt.render=(t,e,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const r=s.scopeName,a=R.has(e),n=j&&11===e.nodeType&&!!e.host,o=n&&!H.has(r),l=o?document.createDocumentFragment():e;if(((t,e,s)=>{let r=R.get(e);void 0===r&&(i(e,e.firstChild),R.set(e,r=new $(Object.assign({templateFactory:z},s))),r.appendInto(e)),r.setValue(t),r.commit()})(t,l,Object.assign({templateFactory:Y(r)},s)),o){const t=R.get(l);R.delete(l);const s=t.value instanceof y?t.value.template:void 0;L(r,l,s),i(e,e.firstChild),e.appendChild(l),R.set(e,t)}!a&&n&&window.ShadyCSS.styleElement(e.host)};var at=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,nt="[^\\s]+",ot=/\[([^]*?)\]/gm;function lt(t,e){for(var s=[],i=0,r=t.length;i-1?i:null}};function dt(t){for(var e=[],s=1;s3?0:(t-t%10!=10?1:0)*t%10]}},gt=dt({},mt),ft=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+ft(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ft(Math.floor(Math.abs(e)/60),2)+":"+ft(Math.abs(e)%60,2)}},_t=function(t){return+t-1},yt=[null,"[1-9]\\d?"],vt=[null,nt],wt=["isPm",nt,function(t,e){var s=t.toLowerCase();return s===e.amPm[0]?0:s===e.amPm[1]?1:null}],St=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var s=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?s:-s}return 0}],xt=(ct("monthNamesShort"),ct("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"});var kt=function(t,e,s){if(void 0===e&&(e=xt.default),void 0===s&&(s={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var i=[];e=(e=xt[e]||e).replace(ot,(function(t,e){return i.push(e),"@@@"}));var r=dt(dt({},gt),s);return(e=e.replace(at,(function(e){return bt[e](t,r)}))).replace(/@@@/g,(function(){return i.shift()}))},Ct=function(){try{(new Date).toLocaleDateString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleDateString(e,{year:"numeric",month:"long",day:"numeric"})}:function(t){return kt(t,"mediumDate")},Pt=function(){try{(new Date).toLocaleString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:function(t){return kt(t,"haDateTime")},$t=function(){try{(new Date).toLocaleTimeString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleTimeString(e,{hour:"numeric",minute:"2-digit"})}:function(t){return kt(t,"shortTime")};function Nt(t){return t.substr(0,t.indexOf("."))}function Mt(t,e,s){if("unknown"===e.state||"unavailable"===e.state)return t("state.default."+e.state);if(e.attributes.unit_of_measurement)return e.state+" "+e.attributes.unit_of_measurement;var i=function(t){return Nt(t.entity_id)}(e);if("input_datetime"===i){var r;if(!e.attributes.has_time)return r=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),Ct(r,s);if(!e.attributes.has_date){var a=new Date;return r=new Date(a.getFullYear(),a.getMonth(),a.getDay(),e.attributes.hour,e.attributes.minute),$t(r,s)}return r=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),Pt(r,s)}return e.attributes.device_class&&t("component."+i+".state."+e.attributes.device_class+"."+e.state)||t("component."+i+".state._."+e.state)||e.state}var Tt="hass:bookmark",At=function(t,e,s,i){i=i||{},s=null==s?{}:s;var r=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=s,t.dispatchEvent(r),r},Et={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 Dt(t,e){if(t in Et)return Et[t];switch(t){case"alarm_control_panel":switch(e){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 e&&"off"===e?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===e?"hass:window-closed":"hass:window-open";case"lock":return e&&"unlocked"===e?"hass:lock-open":"hass:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"hass:cast-connected":"hass:cast";case"zwave":switch(e){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 "+t+" ("+e+")"),Tt}}var zt={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},Ot={binary_sensor:function(t){var e=t.state&&"off"===t.state;switch(t.attributes.device_class){case"battery":return e?"hass:battery":"hass:battery-outline";case"cold":return e?"hass:thermometer":"hass:snowflake";case"connectivity":return e?"hass:server-network-off":"hass:server-network";case"door":return e?"hass:door-closed":"hass:door-open";case"garage_door":return e?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return e?"hass:shield-check":"hass:alert";case"heat":return e?"hass:thermometer":"hass:fire";case"light":return e?"hass:brightness-5":"hass:brightness-7";case"lock":return e?"hass:lock":"hass:lock-open";case"moisture":return e?"hass:water-off":"hass:water";case"motion":return e?"hass:walk":"hass:run";case"occupancy":return e?"hass:home-outline":"hass:home";case"opening":return e?"hass:square":"hass:square-outline";case"plug":return e?"hass:power-plug-off":"hass:power-plug";case"presence":return e?"hass:home-outline":"hass:home";case"sound":return e?"hass:music-note-off":"hass:music-note";case"vibration":return e?"hass:crop-portrait":"hass:vibrate";case"window":return e?"hass:window-closed":"hass:window-open";default:return e?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"hass:garage-open":"hass:garage";case"door":return e?"hass:door-open":"hass:door-closed";case"shutter":return e?"hass:window-shutter-open":"hass:window-shutter";case"blind":return e?"hass:blinds-open":"hass:blinds";case"window":return e?"hass:window-open":"hass:window-closed";default:return Dt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in zt)return zt[e];if("battery"===e){var s=Number(t.state);if(isNaN(s))return"hass:battery-unknown";var i=10*Math.round(s/10);return i>=100?"hass:battery":i<=0?"hass:battery-alert":"hass:battery-"+i}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"hass:thermometer":Dt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?Dt("input_datetime"):"hass:calendar":"hass:clock"}};const Rt=["1","2","3","4","5","6","7","8","9","","0","clear"],Ut={armed_away:"hass:shield-lock",armed_custom_bypass:"hass:security",armed_home:"hass:shield-home",armed_night:"hass:shield-home",disarmed:"hass:shield-check",arming:"hass:shield-outline",pending:"hass:shield-outline",triggered:"hass:bell-ring"},Vt="no_code_provided",It="invalid_code_provided",jt=["arming","pending"],Yt={type:"",entity:"",keep_keypad_visible:!1,button_scale:1};var qt={keep_keypad_visible:"Keep the keypad always visible, also when no code input is required.",button_scale:"Scaling factor to apply for resizing the buttons."},Ht={blocking_sensors:"Could not arm due to the following sensors",triggered_sensors:"Alarm was triggered by the following sensors"},Lt={editor:qt,errors:Ht},Ft={keep_keypad_visible:"Gardez le clavier toujours visible, même lorsqu'aucune saisie de code n'est requise.",button_scale:"Scaling factor to apply for resizing the buttons."},Bt={blocking_sensors:"Impossible d'armer en raison des capteurs suivants",triggered_sensors:"L'alarme a été déclenchée par les capteurs suivants"},Wt={editor:Ft,errors:Bt},Jt={en:Object.freeze({__proto__:null,editor:qt,errors:Ht,default:Lt}),fr:Object.freeze({__proto__:null,editor:Ft,errors:Bt,default:Wt})};function Zt(t,e,s="",i=""){const r=e.replace(/['"]+/g,"").replace("-","_");var a;try{a=t.split(".").reduce((t,e)=>t[e],Jt[r])}catch(e){a=t.split(".").reduce((t,e)=>t[e],Jt.en)}if(void 0===a&&(a=t.split(".").reduce((t,e)=>t[e],Jt.en)),""!==s&&""!==i){Array.isArray(s)||(s=[s]),Array.isArray(i)||(i=[i]);for(let t=0;t e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) @change=${t=>this._updateConfig("entity",t.target.value)} allow-custom-entity > - ${t&&t.attributes.code_arm_required!==t.attributes.code_disarm_required?U` + ${t&&t.attributes.code_arm_required!==t.attributes.code_disarm_required?V` @@ -219,11 +219,11 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) ha-formfield { padding: 20px 0px; } - `}};e([K({attribute:!1})],Gt.prototype,"hass",void 0),e([X()],Gt.prototype,"_config",void 0),Gt=e([Z("alarmo-card-editor")],Gt);var Kt=Object.freeze({__proto__:null,get AlarmoCardEditor(){return Gt}});class Xt extends rt{constructor(){super(...arguments),this.duration=0,this.datetime=null,this.timer=0,this.offset=0}shouldUpdate(t){if(!t.size)return!0;const e=t.get("hass");if(!e||e.themes!==this.hass.themes||e.language!==this.hass.language)return!0;if(e.states[this.entity].state!==this.hass.states[this.entity].state){const t=e.states[this.entity].state,s=this.hass.states[this.entity].state;return jt.includes(s)?this.startTimer():jt.includes(t)&&this.stopTimer(),!0}return!1}firstUpdated(){const t=this.hass.states[this.entity].state;jt.includes(t)&&this.startTimer()}startTimer(){clearInterval(this.timer);const t=this.hass.states[this.entity];if(!t.attributes.expiration||!t.attributes.delay)return;this.duration=t.attributes.delay,this.datetime=new Date(t.attributes.expiration),this.offset=0;const e=this.getRemaining();this.offset=e-this.duration,this.timer=window.setInterval(()=>{this.requestUpdate()},1e3)}stopTimer(){clearInterval(this.timer),this.datetime=null,this.duration=0}getRemaining(){if(!this.datetime)return 0;const t=(this.datetime.getTime()-(new Date).getTime())/1e3-this.offset;return t<0?(clearInterval(this.timer),0):t}getTime(){const t=Math.round(this.getRemaining());return t<=0?"":t}getFraction(){return this.duration?(Math.round(this.getRemaining())-1)/this.duration:1}_stateValue(t){return this.datetime&&this.duration?U` + `}};e([K({attribute:!1})],Gt.prototype,"hass",void 0),e([X()],Gt.prototype,"_config",void 0),Gt=e([Z("alarmo-card-editor")],Gt);var Kt=Object.freeze({__proto__:null,get AlarmoCardEditor(){return Gt}});class Xt extends rt{constructor(){super(...arguments),this.duration=0,this.datetime=null,this.timer=0,this.offset=0}shouldUpdate(t){if(!t.size)return!0;const e=t.get("hass");if(!e||e.themes!==this.hass.themes||e.language!==this.hass.language)return!0;if(e.states[this.entity].state!==this.hass.states[this.entity].state){const t=e.states[this.entity].state,s=this.hass.states[this.entity].state;return jt.includes(s)?this.startTimer():jt.includes(t)&&this.stopTimer(),!0}return!1}firstUpdated(){const t=this.hass.states[this.entity].state;jt.includes(t)&&this.startTimer()}startTimer(){clearInterval(this.timer);const t=this.hass.states[this.entity];if(!t.attributes.expiration||!t.attributes.delay)return;this.duration=t.attributes.delay,this.datetime=new Date(t.attributes.expiration),this.offset=0;const e=this.getRemaining();this.offset=e-this.duration,this.timer=window.setInterval(()=>{this.requestUpdate()},1e3)}stopTimer(){clearInterval(this.timer),this.datetime=null,this.duration=0}getRemaining(){if(!this.datetime)return 0;const t=(this.datetime.getTime()-(new Date).getTime())/1e3-this.offset;return t<0?(clearInterval(this.timer),0):t}getTime(){const t=Math.round(this.getRemaining());return t<=0?"":t}getFraction(){return this.duration?(Math.round(this.getRemaining())-1)/this.duration:1}_stateValue(t){return this.datetime&&this.duration?V` ${this.getTime()} - `:U` - - `}render(){let t=45,e=2*Math.PI*t;const s=this.hass.states[this.entity],i=this.datetime&&this.duration;return U` + `:V` + + `}render(){let t=45,e=2*Math.PI*t;const s=this.hass.states[this.entity],i=this.datetime&&this.duration;return V` e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) opacity: 1; } } - `}}e([K()],Xt.prototype,"hass",void 0),e([K()],Xt.prototype,"entity",void 0),customElements.define("alarmo-state-badge",Xt);class Qt extends rt{shouldUpdate(t){const e=t.get("hass");return!e||!(!this.entity||e.states[this.entity]===this.hass.states[this.entity])}render(){if(!this.hass||!this.entity)return U``;let t=Object.assign({},this.hass.states[this.entity]);void 0!==this.state&&(t=Object.assign(Object.assign({},t),{state:this.state}));const e=function(t){if(!t)return Mt;if(t.attributes.icon)return t.attributes.icon;var e=Nt(t.entity_id);return e in Ot?Ot[e](t):Dt(e,t.state)}(t),s=Tt(this.hass.localize,t,this.hass.language),i=t.attributes.friendly_name||(r=t.entity_id).substr(r.indexOf(".")+1);var r;let a=!!this.state||"on"==t.state;return U` + `}}e([K()],Xt.prototype,"hass",void 0),e([K()],Xt.prototype,"entity",void 0),customElements.define("alarmo-state-badge",Xt);class Qt extends rt{shouldUpdate(t){const e=t.get("hass");return!e||!(!this.entity||e.states[this.entity]===this.hass.states[this.entity])}render(){if(!this.hass||!this.entity)return V``;let t=Object.assign({},this.hass.states[this.entity]);void 0!==this.state&&(t=Object.assign(Object.assign({},t),{state:this.state}));const e=function(t){if(!t)return Tt;if(t.attributes.icon)return t.attributes.icon;var e=Nt(t.entity_id);return e in Ot?Ot[e](t):Dt(e,t.state)}(t),s=Mt(this.hass.localize,t,this.hass.language),i=t.attributes.friendly_name||(r=t.entity_id).substr(r.indexOf(".")+1);var r;let a=!!this.state||"on"==t.state;return V`
At(this,"hass-more-info",{entityId:this.entity})} @@ -415,13 +415,13 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) text-overflow: ellipsis; line-height: normal; } - `]}}e([K()],Qt.prototype,"hass",void 0),e([K()],Qt.prototype,"entity",void 0),e([K()],Qt.prototype,"state",void 0),customElements.define("alarmo-sensor-badge",Qt);class te extends rt{constructor(){super(...arguments),this.disabled=!1,this.scaled=!1}render(){return U` - ${this.scaled?U` + `]}}e([K()],Qt.prototype,"hass",void 0),e([K()],Qt.prototype,"entity",void 0),e([K()],Qt.prototype,"state",void 0),customElements.define("alarmo-sensor-badge",Qt);class te extends rt{constructor(){super(...arguments),this.disabled=!1,this.scaled=!1}render(){return V` + ${this.scaled?V` `:U` + `:V` e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) mwc-button { width: 100%; } - `}}e([K({type:Boolean})],te.prototype,"disabled",void 0),e([K({type:Boolean})],te.prototype,"scaled",void 0),customElements.define("alarmo-button",te);const ee=t=>{class s extends t{connectedCallback(){super.connectedCallback(),this.__checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){super.updated(t),t.has("hass")&&this.__checkSubscribed()}hassSubscribe(){return[]}__checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&(this.__unsubs=this.hassSubscribe())}}return e([K({attribute:!1})],s.prototype,"hass",void 0),s};t.AlarmoCard=class extends(ee(rt)){constructor(){super(...arguments),this._input="",this.warning="",this.timer=0,this.subscribedEntities=[]}static async getConfigElement(){return await Promise.resolve().then((function(){return Kt})),document.createElement("alarmo-card-editor")}async getCardSize(){if(!this._config||!this.hass)return 9;const t=this.hass.states[this._config.entity];return t&&"number"===t.attributes.code_format&&(this._codeRequired(t)||this._config.keep_keypad_visible)?9:4}setConfig(t){if(!t||!t.entity||"alarm_control_panel"!==t.entity.split(".")[0])throw new Error("Invalid configuration provided for entity");if(void 0!==t.button_scale&&("number"!=typeof t.button_scale||t.button_scale<1||t.button_scale>2.5))throw new Error("Invalid configuration provided for button_scale");this._config=Object.assign(Object.assign({},Yt),t)}hassSubscribe(){var t;return(null===(t=this.hass)||void 0===t?void 0:t.user.is_admin)?[this.hass.connection.subscribeEvents(t=>this._fetchData(t),"alarmo_event")]:[]}async _fetchData(t){this.hass&&([Vt,Ut].includes(t.data.event)?this._showInvalidInput():"failed_to_arm"==t.data.event&&(this.warning="blocking_sensors",this._input=""))}shouldUpdate(t){if(t.has("_config"))return!0;const e=t.get("hass");if(!e||e.themes!==this.hass.themes||e.language!==this.hass.language)return!0;if(e.states[this._config.entity]!==this.hass.states[this._config.entity]){const t=e.states[this._config.entity],s=this.hass.states[this._config.entity];return this.processStateUpdate(t,s),!0}return!(!this.subscribedEntities.length||!this.subscribedEntities.some(t=>e.states[t]!==this.hass.states[t]))}processStateUpdate(t,e){("disarmed"==t.state&&"disarmed"!=e.state||"disarmed"==e.state&&"disarmed"!=t.state)&&(window.clearTimeout(this.timer),this._hideInvalidInput(),this._input=""),"disarmed"==t.state&&"disarmed"==e.state&&e.attributes.open_sensors&&(this.warning="blocking_sensors",this._input=""),"arming"==t.state&&"disarmed"==e.state?(this.warning="blocking_sensors",this._input=""):"arming"!==e.state&&(this.subscribedEntities=[])}_codeRequired(t){return t.attributes.code_format&&("disarmed"===t.state&&t.attributes.code_arm_required||"disarmed"!==t.state&&t.attributes.code_disarm_required)}render(){if(!this._config||!this.hass)return U``;const t=this.hass.states[this._config.entity];return t?U` + `}}e([K({type:Boolean})],te.prototype,"disabled",void 0),e([K({type:Boolean})],te.prototype,"scaled",void 0),customElements.define("alarmo-button",te);const ee=t=>{class s extends t{connectedCallback(){super.connectedCallback(),this.__checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){super.updated(t),t.has("hass")&&this.__checkSubscribed()}hassSubscribe(){return[]}__checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&(this.__unsubs=this.hassSubscribe())}}return e([K({attribute:!1})],s.prototype,"hass",void 0),s};t.AlarmoCard=class extends(ee(rt)){constructor(){super(...arguments),this._input="",this.warning="",this.subscribedEntities=[]}static async getConfigElement(){return await Promise.resolve().then((function(){return Kt})),document.createElement("alarmo-card-editor")}async getCardSize(){if(!this._config||!this.hass)return 9;const t=this.hass.states[this._config.entity];return t&&"number"===t.attributes.code_format&&(this._codeRequired(t)||this._config.keep_keypad_visible)?9:4}setConfig(t){if(!t||!t.entity||"alarm_control_panel"!==t.entity.split(".")[0])throw new Error("Invalid configuration provided for entity");if(void 0!==t.button_scale&&("number"!=typeof t.button_scale||t.button_scale<1||t.button_scale>2.5))throw new Error("Invalid configuration provided for button_scale");this._config=Object.assign(Object.assign({},Yt),t)}hassSubscribe(){return[this.hass.connection.subscribeMessage(t=>this._fetchData(t),{type:"alarmo_updated"})]}async _fetchData(t){this.hass&&([It,Vt].includes(t.data.event)?this._showInvalidInput():"failed_to_arm"==t.data.event&&(this.warning="blocking_sensors",this._input=""))}shouldUpdate(t){if(t.has("_config"))return!0;const e=t.get("hass");if(!e||e.themes!==this.hass.themes||e.language!==this.hass.language)return!0;if(e.states[this._config.entity]!==this.hass.states[this._config.entity]){const t=e.states[this._config.entity],s=this.hass.states[this._config.entity];return this.processStateUpdate(t,s),!0}return!(!this.subscribedEntities.length||!this.subscribedEntities.some(t=>e.states[t]!==this.hass.states[t]))}processStateUpdate(t,e){("disarmed"==t.state&&"disarmed"!=e.state||"disarmed"==e.state&&"disarmed"!=t.state)&&(this._hideInvalidInput(),this._input=""),"disarmed"==t.state&&"disarmed"==e.state&&e.attributes.open_sensors&&(this.warning="blocking_sensors",this._input=""),"arming"==t.state&&"disarmed"==e.state?(this.warning="blocking_sensors",this._input=""):"arming"!==e.state&&(this.subscribedEntities=[])}_codeRequired(t){return t.attributes.code_format&&("disarmed"===t.state&&t.attributes.code_arm_required||"disarmed"!==t.state&&t.attributes.code_disarm_required)}render(){if(!this._config||!this.hass)return V``;const t=this.hass.states[this._config.entity];return t?V`
@@ -488,7 +488,7 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) ${this._renderWarning()}
- ${("disarmed"===t.state?this.calcSupportedStates():["disarm"]).map(t=>U` + ${("disarmed"===t.state?this.calcSupportedStates():["disarm"]).map(t=>V` this._handleActionClick(e,t)} style="--content-scale: ${this._config.button_scale}" @@ -499,7 +499,7 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) `)}
- ${this._codeRequired(t)||this._config.keep_keypad_visible?U` + ${this._codeRequired(t)||this._config.keep_keypad_visible?V` e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) id="code_input" .inputmode=${"number"===t.attributes.code_format?"numeric":"text"} > - `:U``} - ${!this._codeRequired(t)&&!this._config.keep_keypad_visible||"number"!==t.attributes.code_format?U``:U` + `:V``} + ${!this._codeRequired(t)&&!this._config.keep_keypad_visible||"number"!==t.attributes.code_format?V``:V`
- ${Rt.map(e=>""===e?U` + ${Rt.map(e=>""===e?V` `:U` + > `:V` e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e)
`} - `:U` + `:V` ${"NOT_RUNNING"!==this.hass.config.state?this.hass.localize("ui.panel.lovelace.warning.entity_not_found","entity",this._config.entity||"[empty]"):this.hass.localize("ui.panel.lovelace.warning.starting")} - `}_renderWarning(){if(!this.hass||!this._config)return U``;const t=this.hass.states[this._config.entity];return t.attributes.open_sensors&&"triggered"==t.state||"blocking_sensors"==this.warning&&t.attributes.open_sensors?U` + `}_renderWarning(){if(!this.hass||!this._config)return V``;const t=this.hass.states[this._config.entity];return t.attributes.open_sensors&&"triggered"==t.state||"blocking_sensors"==this.warning&&t.attributes.open_sensors?V`
@@ -549,7 +549,7 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e)
- ${Object.entries(t.attributes.open_sensors).map(([t])=>(this.subscribedEntities.includes(t)||this.subscribedEntities.push(t),U` + ${Object.entries(t.attributes.open_sensors).map(([t])=>(this.subscribedEntities.includes(t)||this.subscribedEntities.push(t),V`
e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e)
`))}
-
`:U``}calcSupportedStates(){var t;if(!this.hass||!this._config)return[];const e=this.hass.states[null===(t=this._config)||void 0===t?void 0:t.entity].attributes.supported_features||0;let s=[];return 2&e&&s.push("arm_away"),1&e&&s.push("arm_home"),4&e&&s.push("arm_night"),16&e&&s.push("arm_custom_bypass"),s}_handlePadClick(t){const e=t.currentTarget.value;this._hideInvalidInput(),this._input="clear"===e?"":this._input+e}_handleActionClick(t,e){var s;t.target.blur(),this._hideInvalidInput(!1),this.hass.callService("alarm_control_panel","alarm_"+e,{entity_id:this._config.entity,code:this._input}),(null===(s=this.hass)||void 0===s?void 0:s.user.is_admin)||(window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this._handleTimeout()},600)),this.warning=""}_handleTimeout(){if(!this.hass||!this._config)return;this.hass.states[this._config.entity].attributes.open_sensors?(this.warning="blocking_sensors",this._input=""):this._showInvalidInput()}_showInvalidInput(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#code_input");e&&(e.classList.remove("error"),e.classList.add("error"),e.invalid=!0)}_hideInvalidInput(t=!0){var e;const s=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#code_input");s&&s.classList.contains("error")&&(s.classList.remove("error"),s.invalid=!1,t&&(this._input=""))}static get styles(){return st` +
`:V``}calcSupportedStates(){var t;if(!this.hass||!this._config)return[];const e=this.hass.states[null===(t=this._config)||void 0===t?void 0:t.entity].attributes.supported_features||0;let s=[];return 2&e&&s.push("arm_away"),1&e&&s.push("arm_home"),4&e&&s.push("arm_night"),16&e&&s.push("arm_custom_bypass"),s}_handlePadClick(t){const e=t.currentTarget.value;this._hideInvalidInput(),this._input="clear"===e?"":this._input+e}_handleActionClick(t,e){t.target.blur(),this._hideInvalidInput(!1),this.hass.callService("alarm_control_panel","alarm_"+e,{entity_id:this._config.entity,code:this._input}),this.warning=""}_showInvalidInput(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#code_input");e&&(e.classList.remove("error"),e.classList.add("error"),e.invalid=!0)}_hideInvalidInput(t=!0){var e;const s=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#code_input");s&&s.classList.contains("error")&&(s.classList.remove("error"),s.invalid=!1,t&&(this._input=""))}static get styles(){return st` ha-card { padding-bottom: 16px; position: relative; @@ -666,4 +666,4 @@ const Z=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) justify-content: center; align-items: center; } - `}},e([K({attribute:!1})],t.AlarmoCard.prototype,"hass",void 0),e([X()],t.AlarmoCard.prototype,"_config",void 0),e([X()],t.AlarmoCard.prototype,"_input",void 0),e([X()],t.AlarmoCard.prototype,"warning",void 0),t.AlarmoCard=e([Z("alarmo-card")],t.AlarmoCard),window.customCards=window.customCards||[],window.customCards.push({type:"alarmo-card",name:"Alarmo Card",description:"Card for operating Alarmo through Lovelace."}),console.info("%c ALARMO-CARD \n%c Version: "+"v1.5.7".padEnd(7," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray")}({}); + `}},e([K({attribute:!1})],t.AlarmoCard.prototype,"hass",void 0),e([X()],t.AlarmoCard.prototype,"_config",void 0),e([X()],t.AlarmoCard.prototype,"_input",void 0),e([X()],t.AlarmoCard.prototype,"warning",void 0),t.AlarmoCard=e([Z("alarmo-card")],t.AlarmoCard),window.customCards=window.customCards||[],window.customCards.push({type:"alarmo-card",name:"Alarmo Card",description:"Card for operating Alarmo through Lovelace."}),console.info("%c ALARMO-CARD \n%c Version: "+"v1.6.0".padEnd(7," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray")}({}); diff --git a/custom_components/alarmo/card/src/const.ts b/custom_components/alarmo/card/src/const.ts index 7ce736a..091f13f 100755 --- a/custom_components/alarmo/card/src/const.ts +++ b/custom_components/alarmo/card/src/const.ts @@ -1,7 +1,7 @@ import { CardConfig } from "./types"; -export const CARD_VERSION = "v1.5.7" +export const CARD_VERSION = "v1.6.0" export const BUTTONS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "clear"]; diff --git a/custom_components/alarmo/const.py b/custom_components/alarmo/const.py index 79b6fc6..2924c00 100755 --- a/custom_components/alarmo/const.py +++ b/custom_components/alarmo/const.py @@ -26,7 +26,7 @@ from homeassistant.helpers import config_validation as cv -VERSION = "1.5.7" +VERSION = "1.6.0" NAME = "Alarmo" MANUFACTURER = "@nielsfaber" diff --git a/custom_components/alarmo/frontend/dist/alarm-panel.js b/custom_components/alarmo/frontend/dist/alarm-panel.js index 1a8cf36..35569bb 100644 --- a/custom_components/alarmo/frontend/dist/alarm-panel.js +++ b/custom_components/alarmo/frontend/dist/alarm-panel.js @@ -25,7 +25,7 @@ * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */}const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(e,a,t=null)=>{for(;a!==t;){const t=a.nextSibling;e.removeChild(a),a=t}},s=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${s}--\x3e`,r=new RegExp(`${s}|${n}`);class o{constructor(e,a){this.parts=[],this.element=a;const t=[],i=[],n=document.createTreeWalker(a.content,133,null,!1);let o=0,l=-1,u=0;const{strings:m,values:{length:p}}=e;for(;u0;){const a=m[u],t=h.exec(a)[2],i=t.toLowerCase()+"$lit$",s=e.getAttribute(i);e.removeAttribute(i);const n=s.split(r);this.parts.push({type:"attribute",index:l,name:t,strings:n}),u+=n.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),n.currentNode=e.content)}else if(3===e.nodeType){const a=e.data;if(a.indexOf(s)>=0){const i=e.parentNode,s=a.split(r),n=s.length-1;for(let a=0;a{const t=e.length-a.length;return t>=0&&e.slice(t)===a},l=e=>-1!==e.index,c=()=>document.createComment(""),h=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function u(e,a){const{element:{content:t},parts:i}=e,s=document.createTreeWalker(t,133,null,!1);let n=p(i),r=i[n],o=-1,d=0;const l=[];let c=null;for(;s.nextNode();){o++;const e=s.currentNode;for(e.previousSibling===c&&(c=null),a.has(e)&&(l.push(e),null===c&&(c=e)),null!==c&&d++;void 0!==r&&r.index===o;)r.index=null!==c?-1:r.index-d,n=p(i,n),r=i[n]}l.forEach(e=>e.parentNode.removeChild(e))}const m=e=>{let a=11===e.nodeType?0:1;const t=document.createTreeWalker(e,133,null,!1);for(;t.nextNode();)a++;return a},p=(e,a=-1)=>{for(let t=a+1;t{for(;a!==t;){const t=a.nextSibling;e.removeChild(a),a=t}},s=`{{lit-${String(Math.random()).slice(2)}}}`,n=`\x3c!--${s}--\x3e`,r=new RegExp(`${s}|${n}`);class o{constructor(e,a){this.parts=[],this.element=a;const t=[],i=[],n=document.createTreeWalker(a.content,133,null,!1);let o=0,l=-1,m=0;const{strings:u,values:{length:p}}=e;for(;m0;){const a=u[m],t=h.exec(a)[2],i=t.toLowerCase()+"$lit$",s=e.getAttribute(i);e.removeAttribute(i);const n=s.split(r);this.parts.push({type:"attribute",index:l,name:t,strings:n}),m+=n.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),n.currentNode=e.content)}else if(3===e.nodeType){const a=e.data;if(a.indexOf(s)>=0){const i=e.parentNode,s=a.split(r),n=s.length-1;for(let a=0;a{const t=e.length-a.length;return t>=0&&e.slice(t)===a},l=e=>-1!==e.index,c=()=>document.createComment(""),h=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function m(e,a){const{element:{content:t},parts:i}=e,s=document.createTreeWalker(t,133,null,!1);let n=p(i),r=i[n],o=-1,d=0;const l=[];let c=null;for(;s.nextNode();){o++;const e=s.currentNode;for(e.previousSibling===c&&(c=null),a.has(e)&&(l.push(e),null===c&&(c=e)),null!==c&&d++;void 0!==r&&r.index===o;)r.index=null!==c?-1:r.index-d,n=p(i,n),r=i[n]}l.forEach(e=>e.parentNode.removeChild(e))}const u=e=>{let a=11===e.nodeType?0:1;const t=document.createTreeWalker(e,133,null,!1);for(;t.nextNode();)a++;return a},p=(e,a=-1)=>{for(let t=a+1;tnull===e||!("object"==typeof e||"function"==typeof e),A=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class x{constructor(e,a,t){this.dirty=!0,this.element=e,this.name=a,this.strings=t,this.parts=[];for(let e=0;e{try{const e={get capture(){return M=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class E{constructor(e,a,t){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=a,this.eventContext=t,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;v(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=_,e(this)}if(this.__pendingValue===_)return;const e=this.__pendingValue,a=this.value,t=null==e||null!=a&&(e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive),i=null!=e&&(null==a||t);t&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=q(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=_}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const q=e=>e&&(M?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) + */const k=e=>null===e||!("object"==typeof e||"function"==typeof e),A=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class x{constructor(e,a,t){this.dirty=!0,this.element=e,this.name=a,this.strings=t,this.parts=[];for(let e=0;e{try{const e={get capture(){return M=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class q{constructor(e,a,t){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=a,this.eventContext=t,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;v(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=_,e(this)}if(this.__pendingValue===_)return;const e=this.__pendingValue,a=this.value,t=null==e||null!=a&&(e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive),i=null!=e&&(null==a||t);t&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=E(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=_}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const E=e=>e&&(M?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -92,7 +92,7 @@ class b{constructor(e,a,t){this.__parts=[],this.template=e,this.processor=a,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */;function z(e){let a=D.get(e.type);void 0===a&&(a={stringsArray:new WeakMap,keyString:new Map},D.set(e.type,a));let t=a.stringsArray.get(e.strings);if(void 0!==t)return t;const i=e.strings.join(s);return t=a.keyString.get(i),void 0===t&&(t=new o(e,e.getTemplateElement()),a.keyString.set(i,t)),a.stringsArray.set(e.strings,t),t}const D=new Map,N=new WeakMap; + */;function N(e){let a=z.get(e.type);void 0===a&&(a={stringsArray:new WeakMap,keyString:new Map},z.set(e.type,a));let t=a.stringsArray.get(e.strings);if(void 0!==t)return t;const i=e.strings.join(s);return t=a.keyString.get(i),void 0===t&&(t=new o(e,e.getTemplateElement()),a.keyString.set(i,t)),a.stringsArray.set(e.strings,t),t}const z=new Map,D=new WeakMap; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ class b{constructor(e,a,t){this.__parts=[],this.template=e,this.processor=a,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(e,a,t,i){const s=a[0];if("."===s){return new j(e,a.slice(1),t).parts}if("@"===s)return[new E(e,a.slice(1),i.eventContext)];if("?"===s)return[new C(e,a.slice(1),t)];return new x(e,a,t).parts}handleTextExpression(e){return new O(e)}}; +class{handleAttributeExpressions(e,a,t,i){const s=a[0];if("."===s){return new O(e,a.slice(1),t).parts}if("@"===s)return[new q(e,a.slice(1),i.eventContext)];if("?"===s)return[new C(e,a.slice(1),t)];return new x(e,a,t).parts}handleTextExpression(e){return new j(e)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -145,7 +145,7 @@ class{handleAttributeExpressions(e,a,t,i){const s=a[0];if("."===s){return new j( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,R=(e,a)=>`${e}--${a}`;let V=!0;void 0===window.ShadyCSS?V=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),V=!1);const U=e=>a=>{const t=R(a.type,e);let i=D.get(t);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},D.set(t,i));let n=i.stringsArray.get(a.strings);if(void 0!==n)return n;const r=a.strings.join(s);if(n=i.keyString.get(r),void 0===n){const t=a.getTemplateElement();V&&window.ShadyCSS.prepareTemplateDom(t,e),n=new o(a,t),i.keyString.set(r,n)}return i.stringsArray.set(a.strings,n),n},I=["html","svg"],F=new Set,H=(e,a,t)=>{F.add(e);const i=t?t.element:document.createElement("template"),s=a.querySelectorAll("style"),{length:n}=s;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(i,e);const r=document.createElement("style");for(let e=0;e{I.forEach(a=>{const t=D.get(R(a,e));void 0!==t&&t.keyString.forEach(e=>{const{element:{content:a}}=e,t=new Set;Array.from(a.querySelectorAll("style")).forEach(e=>{t.add(e)}),u(e,t)})})})(e);const o=i.content;t?function(e,a,t=null){const{element:{content:i},parts:s}=e;if(null==t)return void i.appendChild(a);const n=document.createTreeWalker(i,133,null,!1);let r=p(s),o=0,d=-1;for(;n.nextNode();){d++;for(n.currentNode===t&&(o=m(a),t.parentNode.insertBefore(a,t));-1!==r&&s[r].index===d;){if(o>0){for(;-1!==r;)s[r].index+=o,r=p(s,r);return}r=p(s,r)}}}(t,r,o.firstChild):o.insertBefore(r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const d=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==d)a.insertBefore(d.cloneNode(!0),a.firstChild);else if(t){o.insertBefore(r,o.firstChild);const e=new Set;e.add(r),u(t,e)}};window.JSCompiler_renameProperty=(e,a)=>e;const Y={toAttribute(e,a){switch(a){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,a){switch(a){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},B=(e,a)=>a!==e&&(a==a||e==e),W={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:B};class Q extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((a,t)=>{const i=this._attributeNameForProperty(t,a);void 0!==i&&(this._attributeToPropertyMap.set(i,t),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,a)=>this._classProperties.set(a,e))}}static createProperty(e,a=W){if(this._ensureClassProperties(),this._classProperties.set(e,a),a.noAccessor||this.prototype.hasOwnProperty(e))return;const t="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,t,a);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,a,t){return{get(){return this[a]},set(i){const s=this[e];this[a]=i,this.requestUpdateInternal(e,s,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||W}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,a=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const t of a)this.createProperty(t,e[t])}}static _attributeNameForProperty(e,a){const t=a.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,a,t=B){return t(e,a)}static _propertyValueFromAttribute(e,a){const t=a.type,i=a.converter||Y,s="function"==typeof i?i:i.fromAttribute;return s?s(e,t):e}static _propertyValueToAttribute(e,a){if(void 0===a.reflect)return;const t=a.type,i=a.converter;return(i&&i.toAttribute||Y.toAttribute)(e,t)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,a)=>{if(this.hasOwnProperty(a)){const e=this[a];delete this[a],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(a,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,a)=>this[a]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,a,t){a!==t&&this._attributeToProperty(e,t)}_propertyToAttribute(e,a,t=W){const i=this.constructor,s=i._attributeNameForProperty(e,t);if(void 0!==s){const e=i._propertyValueToAttribute(a,t);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(s):this.setAttribute(s,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,a){if(8&this._updateState)return;const t=this.constructor,i=t._attributeToPropertyMap.get(e);if(void 0!==i){const e=t.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=t._propertyValueFromAttribute(a,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,a,t){let i=!0;if(void 0!==e){const s=this.constructor;t=t||s.getPropertyOptions(e),s._valueHasChanged(this[e],a,t.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,a),!0!==t.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,t))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,a){return this.requestUpdateInternal(e,a),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const a=this._changedProperties;try{e=this.shouldUpdate(a),e?this.update(a):this._markUpdated()}catch(a){throw e=!1,this._markUpdated(),a}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(a)),this.updated(a))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,a)=>this._propertyToAttribute(a,this[a],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}Q.finalized=!0; + */,R=(e,a)=>`${e}--${a}`;let U=!0;void 0===window.ShadyCSS?U=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),U=!1);const F=e=>a=>{const t=R(a.type,e);let i=z.get(t);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},z.set(t,i));let n=i.stringsArray.get(a.strings);if(void 0!==n)return n;const r=a.strings.join(s);if(n=i.keyString.get(r),void 0===n){const t=a.getTemplateElement();U&&window.ShadyCSS.prepareTemplateDom(t,e),n=new o(a,t),i.keyString.set(r,n)}return i.stringsArray.set(a.strings,n),n},I=["html","svg"],V=new Set,H=(e,a,t)=>{V.add(e);const i=t?t.element:document.createElement("template"),s=a.querySelectorAll("style"),{length:n}=s;if(0===n)return void window.ShadyCSS.prepareTemplateStyles(i,e);const r=document.createElement("style");for(let e=0;e{I.forEach(a=>{const t=z.get(R(a,e));void 0!==t&&t.keyString.forEach(e=>{const{element:{content:a}}=e,t=new Set;Array.from(a.querySelectorAll("style")).forEach(e=>{t.add(e)}),m(e,t)})})})(e);const o=i.content;t?function(e,a,t=null){const{element:{content:i},parts:s}=e;if(null==t)return void i.appendChild(a);const n=document.createTreeWalker(i,133,null,!1);let r=p(s),o=0,d=-1;for(;n.nextNode();){d++;for(n.currentNode===t&&(o=u(a),t.parentNode.insertBefore(a,t));-1!==r&&s[r].index===d;){if(o>0){for(;-1!==r;)s[r].index+=o,r=p(s,r);return}r=p(s,r)}}}(t,r,o.firstChild):o.insertBefore(r,o.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const d=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==d)a.insertBefore(d.cloneNode(!0),a.firstChild);else if(t){o.insertBefore(r,o.firstChild);const e=new Set;e.add(r),m(t,e)}};window.JSCompiler_renameProperty=(e,a)=>e;const Y={toAttribute(e,a){switch(a){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,a){switch(a){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},B=(e,a)=>a!==e&&(a==a||e==e),W={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:B};class Q extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((a,t)=>{const i=this._attributeNameForProperty(t,a);void 0!==i&&(this._attributeToPropertyMap.set(i,t),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,a)=>this._classProperties.set(a,e))}}static createProperty(e,a=W){if(this._ensureClassProperties(),this._classProperties.set(e,a),a.noAccessor||this.prototype.hasOwnProperty(e))return;const t="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,t,a);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,a,t){return{get(){return this[a]},set(i){const s=this[e];this[a]=i,this.requestUpdateInternal(e,s,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||W}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,a=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const t of a)this.createProperty(t,e[t])}}static _attributeNameForProperty(e,a){const t=a.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,a,t=B){return t(e,a)}static _propertyValueFromAttribute(e,a){const t=a.type,i=a.converter||Y,s="function"==typeof i?i:i.fromAttribute;return s?s(e,t):e}static _propertyValueToAttribute(e,a){if(void 0===a.reflect)return;const t=a.type,i=a.converter;return(i&&i.toAttribute||Y.toAttribute)(e,t)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,a)=>{if(this.hasOwnProperty(a)){const e=this[a];delete this[a],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(a,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,a)=>this[a]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,a,t){a!==t&&this._attributeToProperty(e,t)}_propertyToAttribute(e,a,t=W){const i=this.constructor,s=i._attributeNameForProperty(e,t);if(void 0!==s){const e=i._propertyValueToAttribute(a,t);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(s):this.setAttribute(s,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,a){if(8&this._updateState)return;const t=this.constructor,i=t._attributeToPropertyMap.get(e);if(void 0!==i){const e=t.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=t._propertyValueFromAttribute(a,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,a,t){let i=!0;if(void 0!==e){const s=this.constructor;t=t||s.getPropertyOptions(e),s._valueHasChanged(this[e],a,t.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,a),!0!==t.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,t))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,a){return this.requestUpdateInternal(e,a),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const a=this._changedProperties;try{e=this.shouldUpdate(a),e?this.update(a):this._markUpdated()}catch(a){throw e=!1,this._markUpdated(),a}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(a)),this.updated(a))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,a)=>this._propertyToAttribute(a,this[a],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}Q.finalized=!0; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -183,7 +183,7 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const ne={};class re extends Q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const a=(e,t)=>e.reduceRight((e,t)=>Array.isArray(t)?a(t,e):(e.add(t),e),t),t=a(e,new Set),i=[];t.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!ae){const a=Array.prototype.slice.call(e.cssRules).reduce((e,a)=>e+a.cssText,"");return new ie(String(a),te)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ae?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const a=this.render();super.update(e),a!==ne&&this.constructor.render(a,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const a=document.createElement("style");a.textContent=e.cssText,this.renderRoot.appendChild(a)}))}render(){return ne}}re.finalized=!0,re.render=(e,a,t)=>{if(!t||"object"!=typeof t||!t.scopeName)throw new Error("The `scopeName` option is required.");const s=t.scopeName,n=N.has(a),r=V&&11===a.nodeType&&!!a.host,o=r&&!F.has(s),d=o?document.createDocumentFragment():a;if(((e,a,t)=>{let s=N.get(a);void 0===s&&(i(a,a.firstChild),N.set(a,s=new O(Object.assign({templateFactory:z},t))),s.appendInto(a)),s.setValue(e),s.commit()})(e,d,Object.assign({templateFactory:U(s)},t)),o){const e=N.get(d);N.delete(d);const t=e.value instanceof b?e.value.template:void 0;H(s,d,t),i(a,a.firstChild),a.appendChild(d),N.set(a,e)}!n&&r&&window.ShadyCSS.styleElement(a.host)};var oe=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,de="[^\\s]+",le=/\[([^]*?)\]/gm;function ce(e,a){for(var t=[],i=0,s=e.length;i-1?i:null}};function ue(e){for(var a=[],t=1;t3?0:(e-e%10!=10?1:0)*e%10]}},_e=ue({},ve),fe=function(e,a){for(void 0===a&&(a=2),e=String(e);e.length0?"-":"+")+fe(100*Math.floor(Math.abs(a)/60)+Math.abs(a)%60,4)},Z:function(e){var a=e.getTimezoneOffset();return(a>0?"-":"+")+fe(Math.floor(Math.abs(a)/60),2)+":"+fe(Math.abs(a)%60,2)}},we=function(e){return+e-1},ye=[null,"[1-9]\\d?"],$e=[null,de],ke=["isPm",de,function(e,a){var t=e.toLowerCase();return t===a.amPm[0]?0:t===a.amPm[1]?1:null}],Ae=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var a=(e+"").match(/([+-]|\d\d)/gi);if(a){var t=60*+a[1]+parseInt(a[2],10);return"+"===a[0]?t:-t}return 0}],xe=(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"});var Se=function(e,a,t){if(void 0===a&&(a=xe.default),void 0===t&&(t={}),"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 i=[];a=(a=xe[a]||a).replace(le,(function(e,a){return i.push(a),"@@@"}));var s=ue(ue({},_e),t);return(a=a.replace(oe,(function(a){return be[a](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(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 Oe(e){return e.substr(0,e.indexOf("."))}function Ce(e){return e.substr(e.indexOf(".")+1)}var je="hass:bookmark",Te=function(e,a,t,i){i=i||{},t=null==t?{}:t;var s=new Event(a,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=t,e.dispatchEvent(s),s},Me={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 Ee(e,a){if(e in Me)return Me[e];switch(e){case"alarm_control_panel":switch(a){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 a&&"off"===a?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===a?"hass:window-closed":"hass:window-open";case"lock":return a&&"unlocked"===a?"hass:lock-open":"hass:lock";case"media_player":return a&&"off"!==a&&"idle"!==a?"hass:cast-connected":"hass:cast";case"zwave":switch(a){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+" ("+a+")"),je}}var qe=function(e,a,t){void 0===t&&(t=!1),t?history.replaceState(null,"",a):history.pushState(null,"",a),Te(window,"location-changed",{replace:t})},ze={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},De={binary_sensor:function(e){var a=e.state&&"off"===e.state;switch(e.attributes.device_class){case"battery":return a?"hass:battery":"hass:battery-outline";case"cold":return a?"hass:thermometer":"hass:snowflake";case"connectivity":return a?"hass:server-network-off":"hass:server-network";case"door":return a?"hass:door-closed":"hass:door-open";case"garage_door":return a?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return a?"hass:shield-check":"hass:alert";case"heat":return a?"hass:thermometer":"hass:fire";case"light":return a?"hass:brightness-5":"hass:brightness-7";case"lock":return a?"hass:lock":"hass:lock-open";case"moisture":return a?"hass:water-off":"hass:water";case"motion":return a?"hass:walk":"hass:run";case"occupancy":return a?"hass:home-outline":"hass:home";case"opening":return a?"hass:square":"hass:square-outline";case"plug":return a?"hass:power-plug-off":"hass:power-plug";case"presence":return a?"hass:home-outline":"hass:home";case"sound":return a?"hass:music-note-off":"hass:music-note";case"vibration":return a?"hass:crop-portrait":"hass:vibrate";case"window":return a?"hass:window-closed":"hass:window-open";default:return a?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(e){var a="closed"!==e.state;switch(e.attributes.device_class){case"garage":return a?"hass:garage-open":"hass:garage";case"door":return a?"hass:door-open":"hass:door-closed";case"shutter":return a?"hass:window-shutter-open":"hass:window-shutter";case"blind":return a?"hass:blinds-open":"hass:blinds";case"window":return a?"hass:window-open":"hass:window-closed";default:return Ee("cover",e.state)}},sensor:function(e){var a=e.attributes.device_class;if(a&&a in ze)return ze[a];if("battery"===a){var t=Number(e.state);if(isNaN(t))return"hass:battery-unknown";var i=10*Math.round(t/10);return i>=100?"hass:battery":i<=0?"hass:battery-alert":"hass:battery-"+i}var s=e.attributes.unit_of_measurement;return"°C"===s||"°F"===s?"hass:thermometer":Ee("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?Ee("input_datetime"):"hass:calendar":"hass:clock"}};const Ne=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 a=document.createElement("ha-panel-config");await a.routerOptions.routes.automation.load(),e.hass={panels:[{url_path:"tmp",component_name:"developer-tools"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-app-layout")},Pe=se` +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const ne={};class re extends Q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const a=(e,t)=>e.reduceRight((e,t)=>Array.isArray(t)?a(t,e):(e.add(t),e),t),t=a(e,new Set),i=[];t.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!ae){const a=Array.prototype.slice.call(e.cssRules).reduce((e,a)=>e+a.cssText,"");return new ie(String(a),te)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ae?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const a=this.render();super.update(e),a!==ne&&this.constructor.render(a,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const a=document.createElement("style");a.textContent=e.cssText,this.renderRoot.appendChild(a)}))}render(){return ne}}re.finalized=!0,re.render=(e,a,t)=>{if(!t||"object"!=typeof t||!t.scopeName)throw new Error("The `scopeName` option is required.");const s=t.scopeName,n=D.has(a),r=U&&11===a.nodeType&&!!a.host,o=r&&!V.has(s),d=o?document.createDocumentFragment():a;if(((e,a,t)=>{let s=D.get(a);void 0===s&&(i(a,a.firstChild),D.set(a,s=new j(Object.assign({templateFactory:N},t))),s.appendInto(a)),s.setValue(e),s.commit()})(e,d,Object.assign({templateFactory:F(s)},t)),o){const e=D.get(d);D.delete(d);const t=e.value instanceof b?e.value.template:void 0;H(s,d,t),i(a,a.firstChild),a.appendChild(d),D.set(a,e)}!n&&r&&window.ShadyCSS.styleElement(a.host)};var oe=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,de="[^\\s]+",le=/\[([^]*?)\]/gm;function ce(e,a){for(var t=[],i=0,s=e.length;i-1?i:null}};function me(e){for(var a=[],t=1;t3?0:(e-e%10!=10?1:0)*e%10]}},_e=me({},ve),fe=function(e,a){for(void 0===a&&(a=2),e=String(e);e.length0?"-":"+")+fe(100*Math.floor(Math.abs(a)/60)+Math.abs(a)%60,4)},Z:function(e){var a=e.getTimezoneOffset();return(a>0?"-":"+")+fe(Math.floor(Math.abs(a)/60),2)+":"+fe(Math.abs(a)%60,2)}},we=function(e){return+e-1},ye=[null,"[1-9]\\d?"],$e=[null,de],ke=["isPm",de,function(e,a){var t=e.toLowerCase();return t===a.amPm[0]?0:t===a.amPm[1]?1:null}],Ae=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var a=(e+"").match(/([+-]|\d\d)/gi);if(a){var t=60*+a[1]+parseInt(a[2],10);return"+"===a[0]?t:-t}return 0}],xe=(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"});var Se=function(e,a,t){if(void 0===a&&(a=xe.default),void 0===t&&(t={}),"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 i=[];a=(a=xe[a]||a).replace(le,(function(e,a){return i.push(a),"@@@"}));var s=me(me({},_e),t);return(a=a.replace(oe,(function(a){return be[a](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(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 je(e){return e.substr(0,e.indexOf("."))}function Ce(e){return e.substr(e.indexOf(".")+1)}var Oe="hass:bookmark",Te=function(e,a,t,i){i=i||{},t=null==t?{}:t;var s=new Event(a,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=t,e.dispatchEvent(s),s},Me={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 qe(e,a){if(e in Me)return Me[e];switch(e){case"alarm_control_panel":switch(a){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 a&&"off"===a?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===a?"hass:window-closed":"hass:window-open";case"lock":return a&&"unlocked"===a?"hass:lock-open":"hass:lock";case"media_player":return a&&"off"!==a&&"idle"!==a?"hass:cast-connected":"hass:cast";case"zwave":switch(a){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+" ("+a+")"),Oe}}var Ee=function(e,a,t){void 0===t&&(t=!1),t?history.replaceState(null,"",a):history.pushState(null,"",a),Te(window,"location-changed",{replace:t})},Ne={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},ze={binary_sensor:function(e){var a=e.state&&"off"===e.state;switch(e.attributes.device_class){case"battery":return a?"hass:battery":"hass:battery-outline";case"cold":return a?"hass:thermometer":"hass:snowflake";case"connectivity":return a?"hass:server-network-off":"hass:server-network";case"door":return a?"hass:door-closed":"hass:door-open";case"garage_door":return a?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return a?"hass:shield-check":"hass:alert";case"heat":return a?"hass:thermometer":"hass:fire";case"light":return a?"hass:brightness-5":"hass:brightness-7";case"lock":return a?"hass:lock":"hass:lock-open";case"moisture":return a?"hass:water-off":"hass:water";case"motion":return a?"hass:walk":"hass:run";case"occupancy":return a?"hass:home-outline":"hass:home";case"opening":return a?"hass:square":"hass:square-outline";case"plug":return a?"hass:power-plug-off":"hass:power-plug";case"presence":return a?"hass:home-outline":"hass:home";case"sound":return a?"hass:music-note-off":"hass:music-note";case"vibration":return a?"hass:crop-portrait":"hass:vibrate";case"window":return a?"hass:window-closed":"hass:window-open";default:return a?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(e){var a="closed"!==e.state;switch(e.attributes.device_class){case"garage":return a?"hass:garage-open":"hass:garage";case"door":return a?"hass:door-open":"hass:door-closed";case"shutter":return a?"hass:window-shutter-open":"hass:window-shutter";case"blind":return a?"hass:blinds-open":"hass:blinds";case"window":return a?"hass:window-open":"hass:window-closed";default:return qe("cover",e.state)}},sensor:function(e){var a=e.attributes.device_class;if(a&&a in Ne)return Ne[a];if("battery"===a){var t=Number(e.state);if(isNaN(t))return"hass:battery-unknown";var i=10*Math.round(t/10);return i>=100?"hass:battery":i<=0?"hass:battery-alert":"hass:battery-"+i}var s=e.attributes.unit_of_measurement;return"°C"===s||"°F"===s?"hass:thermometer":qe("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?qe("input_datetime"):"hass:calendar":"hass:clock"}};const De=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 a=document.createElement("ha-panel-config");await a.routerOptions.routes.automation.load(),e.hass={panels:[{url_path:"tmp",component_name:"developer-tools"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-app-layout")},Pe=se` ha-card { display: flex; flex-direction: column; @@ -333,7 +333,14 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) flex-direction: column; align-items: flex-start; } -`;var Le={modes_long:{armed_away:"Armed Away",armed_home:"Armed Home",armed_night:"Armed Night",armed_custom_bypass:"Armed Custom"},modes_short:{armed_away:"Away",armed_home:"Home",armed_night:"Night",armed_custom_bypass:"Custom"}},Re={time_slider:{seconds:"sec",minutes:"min",infinite:"infinite",none:"none"},editor:{ui_mode:"Switch to UI",yaml_mode:"Switch to YAML"}},Ve={general:{title:"General",cards:{general:{description:"This panel defines some global settings for the alarm.",fields:{disarm_after_trigger:{heading:"Disarm after trigger",description:"After trigger time has expired, disarm the alarm instead of returning to armed state."},enable_mqtt:{heading:"Enable MQTT",description:"Allow the alarm panel to be controlled through MQTT."},enable_master:{heading:"Enable alarm master",description:"Creates an entity for controlling all areas simultaneously."}},actions:{setup_mqtt:"MQTT Configuration",setup_master:"Master Configuration"}},modes:{title:"Modes",description:"This panel can be used to set up the arm modes of the alarm.",fields:{mode:{armed_away:"Armed away will be used when all people left the house. All doors and windows allowing access to the house will be guarded, as well as motion sensors inside the house.",armed_home:"Armed home (also known as armed stay) will be used when setting the alarm while people are in the house. All doors and windows allowing access to the house will be guarded, but not motion sensors inside the house.",armed_night:"Armed night will be used when setting the alarm before going to sleep. All doors and windows allowing access to the house will be guarded, and selected motion sensors (downstairs) in the house.",armed_custom_bypass:"An extra mode for defining your own security perimeter.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Exit delay",description:"When arming the alarm, within this time period the sensors will not trigger the alarm yet."},entry_delay:{heading:"Entry delay",description:"Delay time until the alarm is triggered after one of the sensors is activated."},trigger_time:{heading:"Trigger time",description:"Time during which the siren will sound"}}},mqtt:{title:"MQTT configuration",description:"This panel can be used for configuration of the MQTT interface.",fields:{state_topic:{heading:"State topic",description:"Topic on which state updates are published"},event_topic:{heading:"Event topic",description:"Topic on which alarm events are published"},command_topic:{heading:"Command topic",description:"Topic on which arm/disarm commands are sent."},require_code:{heading:"Require code",description:"Require the code to be sent with the command."},state_payload:{heading:"Configure payload per state",item:"Define a payload for state '{state}'"},command_payload:{heading:"Configure payload per command",item:"Define a payload for command '{command}'"}}},areas:{title:"Areas",description:"Areas can be used for dividing your alarm system into multiple compartments.",no_items:"There are no areas defined yet.",table:{remarks:"Remarks",summary:"This area contains {summary_sensors} and {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automations"},actions:{add:"Add"}}},dialogs:{create_area:{title:"New area",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editing area '{area}'",name_warning:"Note: changing the name will change the entity ID"},remove_area:{title:"Remove area?",description:"Are you sure you want to remove this area? This area contains {sensors} sensors and {automations} automations, which will be removed as well."},edit_master:{title:"Master configuration"},disable_master:{title:"Disable master?",description:"Are you sure you want to remove the alarm master? This area contains {automations} automations, which will be removed with this action."}}},sensors:{title:"Sensors",cards:{sensors:{description:"Currently configured sensors. Click on an entity to make changes.",no_items:"There are no sensors to be displayed here.",table:{arm_modes:"Arm Modes",always_on:"(Always)"},filter:{label:"Filter by area",no_area:"(No area)"}},add_sensors:{title:"Add Sensors",description:"Add more sensors. Make sure that your sensors have a friendly_name, so you can identify them.",no_items:"There are no available HA entities that can be configured for the alarm. Make sure to include entities of the type binary_sensor.",actions:{add_to_alarm:"add to alarm",show_all:"Show all"}},editor:{title:"Edit Sensor",description:"Configuring the sensor settings of '{entity}'.",fields:{name:{heading:"Name",description:"Overwrite friendly name."},area:{heading:"Area",description:"Select an area which contains this sensor."},device_type:{heading:"Device Type",description:"Choose a device type to automatically apply appropriate settings.",choose:{door:{name:"Door",description:"A door, gate or other entrance that is used for entering/leaving the home."},window:{name:"Window",description:"A window, or a door not used for entering the house such as balcony."},motion:{name:"Motion",description:"Presence sensor or similar device having a delay between activations."},tamper:{name:"Tamper",description:"Detector of sensor cover removal, glass break sensor, etc."},environmental:{name:"Environmental",description:"Smoke/gas sensor, leak detector, etc. (not related to burglar protection)."},other:{name:"Generic"}}},always_on:{heading:"Always on",description:"Sensor should always trigger the alarm."},modes:{heading:"Enabled modes",description:"Alarm modes in which this sensor is active."},arm_on_close:{heading:"Arm after closing",description:"After deactivation of this sensor, the remaining exit delay will automatically be skipped."},immediate:{heading:"Immediate",description:"Activating this sensor will trigger the alarm directly instead of after entry delay."},allow_open:{heading:"Allow open while arming",description:"Allow this sensor to be active shortly after leaving such that it will not block arming."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Trigger when unavailable",description:"When the sensor state becomes 'unavailable', this will activate the sensor."}},actions:{toggle_advanced:"Advanced settings",remove:"Remove"},errors:{description:"Please correct the following errors:",no_area:"No area is selected",no_modes:"No modes are selected for which the sensor should be active"}}}},codes:{title:"Codes",cards:{codes:{description:"Change settings for the code.",fields:{code_arm_required:{heading:"Use arm code",description:"Require a code for arming the alarm"},code_disarm_required:{heading:"Use disarm code",description:"Require a code for disarming the alarm"},code_format:{heading:"Code format",description:"Sets the input type for Lovelace alarm card.",code_format_number:"pincode",code_format_text:"password"}}},user_management:{title:"User management",description:"Each user has its own code to arm/disarm the alarm.",no_items:"There are no users yet",table:{remarks:"Remarks",administrator:"Administrator"},actions:{new_user:"new user"}},new_user:{title:"Create new user",description:"Users can be created for providing access to operating the alarm.",fields:{name:{heading:"Name",description:"Name of the user."},code:{heading:"Code",description:"Code for this user."},confirm_code:{heading:"Confirm code",description:"Repeat the code."},is_admin:{heading:"User is administrator",description:"Allow user to make changes"},can_arm:{heading:"Allow code for arming",description:"Entering this code activates the alarm"},can_disarm:{heading:"Allow code for disarming",description:"Entering this code deactivates the alarm"},is_override_code:{heading:"Is override code",description:"Entering this code will arm the alarm in force"}},errors:{no_name:"No name provided.",no_code:"Code should have 4 characters/numbers minimum.",code_mismatch:"The codes don't match."}},edit_user:{title:"Edit User",description:"Change configuration for user '{name}'.",fields:{old_code:{heading:"Current code",description:"Current code, leave empty to leave unchanged."}}}}},actions:{title:"Actions",cards:{notifications:{title:"Notifications",description:"Using this panel, you can manage notifications to be sent when during a certain alarm event.",table:{enabled:"Enabled",no_items:"There are no notifications created yet."},actions:{new_notification:"new notification"},filter:{label:"Filter by area",no_area:"Alarm master"}},actions:{description:"This panel can be used to switch a device when the alarm state changes.",table:{no_items:"There are no actions created yet."},actions:{new_action:"new action"}},new_notification:{title:"Create notification",description:"Create a new notification.",fields:{name:{heading:"Name",description:"Description for this notification"},event:{heading:"Event",description:"When should the notification be sent",choose:{armed:{name:"Alarm is armed",description:"The alarm is succesfully armed"},disarmed:{name:"Alarm is disarmed",description:"The alarm is disarmed"},triggered:{name:"Alarm is triggered",description:"The alarm is triggered"},arm_failure:{name:"Failed to arm",description:"The arming of the alarm failed due to one or more open sensors"},arming:{name:"Exit delay started",description:"Exit delay started, ready to leave the house."},pending:{name:"Entry delay started",description:"Entry delay started, the alarm will trigger soon."}}},mode:{heading:"Mode",description:"Limit the action to specific arm modes (optional)"},title:{heading:"Title",description:"Title for the notification message"},message:{heading:"Message",description:"Content of the notification message"},target:{heading:"Target",description:"Device to send the push message to"}},actions:{test:"Try it"}},new_action:{title:"Create action",description:"This panel can be used to switch a device when the alarm state changes.",fields:{name:{heading:"Name",description:"Description for this action"},event:{heading:"Event",description:"When should the action be executed"},area:{heading:"Area",description:"Area for which the event applies, leave empty to select the global alarm."},mode:{heading:"Mode",description:"Limit the action to specific arm modes (optional)"},entity:{heading:"Entity",description:"Entity to perform action on"},action:{heading:"Action",description:"Action to perform on the entity",turn_on:"Turn on",turn_off:"Turn off"}}}},validation_errors:{no_triggers:"No state or event provided for the triggering of this automation.",empty_trigger:"One of the triggers has no state or event provided.",invalid_trigger:"One of the triggers has an invalid value: {trigger}",invalid_mode:"Invalid input provided for 'mode': {mode}",no_actions:"No actions are provided to be performed by this automation.",no_service:"One of the actions is missing a service.",invalid_service:"An invalid service name was provided for one of the actions: {service}",no_service_data:"No service data was provided for one of the actions.",no_entity_in_service_data:"No entity_id was provided in the service_data of one of the actions.",no_message_in_service_data:"No message was provided in the service_data of one of the actions."}}},Ue={common:Le,components:Re,title:"Alarm panel",panels:Ve},Ie={modes_long:{armed_away:"Valvestatud eemal",armed_home:"Valvestatud kodus",armed_night:"Valvestatud ööseks",armed_custom_bypass:"Valikuline valvestus"},modes_short:{armed_away:"Eemal",armed_home:"Kodus",armed_night:"Ööseks",armed_custom_bypass:"Valikuline"}},Fe={time_slider:{seconds:"sek",minutes:"min",infinite:"piiranguta",none:"puudub"},editor:{ui_mode:"Kasutajaliides",yaml_mode:"Koodiredaktor"}},He={general:{title:"Üldsätted",cards:{general:{description:"Need seaded kehtivad kõikides valve olekutes.",fields:{disarm_after_trigger:{heading:"Häire summutamine",description:"Peale häire lõppu võta valvest maha miite ära valvesta uuesti."},enable_mqtt:{heading:"Luba MQTT juhtimine",description:"Luba nupustiku juhtimist MQTT abil."},enable_master:{heading:"Luba põhivalvestus",description:"Loob olemi mis haldab kõiki valvestamise alasid korraga."}},actions:{setup_mqtt:"MQTT seadistamine",setup_master:"Põhivalvestuse sätted"}},modes:{title:"Režiimid",description:"Selles vaates seadistatakse valvestamise režiime.",fields:{mode:{armed_away:"Täielik valvestamine kui kedagi pole kodus. Kasutusel on kõik andurid.",armed_home:"Valvestatud kodus ei kasuta liikumisandureid kuid väisuksed ja aknad on valve all.",armed_night:"Valvestatud ööseks ei kasuta määratud liikumisandureid, välisperimeeter on valve all.",armed_custom_bypass:"Valikulise valvestuse puhul saab määrata kasutatavad andurid.",enabled:"Lubatud",disabled:"Keelatud"},exit_delay:{heading:"Ooteaeg valvestamisel",description:"Viivitus enne valvestamise rakendumist."},entry_delay:{heading:"Sisenemise viivitus",description:"Viivitus sisenemisel enne häire rakendumist."},trigger_time:{heading:"Häire kestus",description:"Sireeni jne. aktiveerimise kestus."}}},mqtt:{title:"MQTT sätted",description:"MQTT parameetrite seadistamine.",fields:{state_topic:{heading:"Oleku teema (topic)",description:"Teema milles avaldatakse oleku muutused."},command_topic:{heading:"Käskude teema (topic)",description:"Teema milles avaldatakse valvestamise käsud."},require_code:{heading:"Nõua PIN koodi",description:"Käskude edastamiseks on vajalik PIN kood."},state_payload:{heading:"Määra olekute toimeandmed",item:"Määra oleku '{state}' toimeandmed"},command_payload:{heading:"Määra käskude toimeandmed",item:"Määra käsu '{command}' toimeandmed"}}},areas:{title:"Alad",description:"Alasid kasutatakse elamise jagamiseks valvetsoonideks.",no_items:"Valvestamise alad on loomata.",table:{remarks:"Ala teave",summary:"See ala sisaldab {summary_sensors} ja {summary_automations}.",summary_sensors:"{number} andur(it)",summary_automations:"{number} automatiseering(ut)"},actions:{add:"Lisa"}}},dialogs:{create_area:{title:"Uus ala",fields:{copy_from:"Kopeeri sätted allikast:"}},edit_area:{title:"Ala '{area}' muutmine",name_warning:"NB! Nime muutmisel muutub ka olemi ID"},remove_area:{title:"Kas kustutada ala?",description:"Kas kustutada see ala? Ala kaasab andurid {sensors} ja automatiseeringud {automations} mis samuti eemaldatakse."},edit_master:{title:"Põhiala seaded"},disable_master:{title:"Kas keelata põhiala?",description:"Kas keelata põhiala? Ala kaasab andurid {sensors} ja automatiseeringud {automations} mis samuti eemaldatakse.."}}},sensors:{title:"Andurid",cards:{sensors:{description:"Kasutusel olevad andurid. Klõpsa olemil, et seadistada.",no_items:"Andureid pole lisatud. Alustuseks lisa mõni andur.",table:{arm_modes:"Valvestamise olek",always_on:"(alati)"},filter:{label:"Sordi ala järgi",no_area:"(Alad puuduvad)"}},add_sensors:{title:"Andurite lisamine",description:"Lisa veel andureid. Mõistlik on panna neile arusaadav nimi (friendly_name).",no_items:"Puuduvad valvestamiseks sobivad Home Assistanti olemid. Lisatavad olemid peavad olema olekuandurid (binary_sensor).",actions:{add_to_alarm:"Lisa valvesüsteemile",show_all:"Kuva kõik andurid"}},editor:{title:"Andurite sätted",description:"Muuda olemi '{entity}' sätteid.",fields:{name:{heading:"Nimi",description:"Muuda kuvatavat nime."},area:{heading:"Ala",description:"Vali ala kus see andur asub."},device_type:{heading:"Seadme tüüp",description:"Vali anduri tüüp, et automaatselt rakendada sobivad sätted.",choose:{door:{name:"Uks",description:"Uks, värav või muu piire mida kasutatakse sisenemiseks või väljumiseks."},window:{name:"Aken",description:"Aken või uks mida ei kasutata sisenemiseks nagu rõduuks."},motion:{name:"Liikumisandur",description:"Kohaloleku andurid mille rakendumiste vahel on viide."},tamper:{name:"Terviklikkus",description:"Anduri muukimine või klaasipurustusandur jms."},environmental:{name:"Ohu andurid",description:"Suitsu või gaasilekke andur, veeleke jne. (ei ole seotud sissetungimisega)."},other:{name:"Tavaandur"}}},always_on:{heading:"Alati kasutusel",description:"Andur käivitab häire igas valve olekus."},modes:{heading:"Valve olekute valik",description:"Valve olekud kus seda andurit kasutatakse."},arm_on_close:{heading:"Valvesta sulgemisel",description:"Selle anduri rakendumisel valvestatakse kohe ilma viiveta."},immediate:{heading:"Viivituseta",description:"Andur annab häire ilma viiteta."},allow_open:{heading:"Lahkumisviivitus",description:"See andur ei aktiveeru enne lahkumisviivituse lõppu."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Andurite saadavus",description:"Käivita häire kui andur muutub kättesaamatuks."}},actions:{toggle_advanced:"Täpsemad sätted",remove:"Eemalda"},errors:{description:"Palun paranda jägmised vead:",no_area:"Ala pole määratud",no_modes:"Anduri tüüp on määramata, ei tea kuida kasutada"}}}},codes:{title:"Koodid",cards:{codes:{description:"Valvestuskoodide muutmine.",fields:{code_arm_required:{heading:"Valvestamine koodiga",description:"Valvestamiseks tuleb sisestada kood"},code_disarm_required:{heading:"Valvest vabastamise kood",description:"Valvest vabastamiseks tulem sisestada kood"},code_format:{heading:"Koodi vorming",description:"Kasutajaliidese koodi tüübid.",code_format_number:"PIN kood",code_format_text:"Salasõna"}}},user_management:{title:"Kasutajate haldus",description:"Igal kasutajal on oma juhtkood.",no_items:"Kasutajaid pole määratud",table:{remarks:"Märkused",administrator:"Haldaja"},actions:{new_user:"Uus kasutaja"}},new_user:{title:"Lisa uus kasutaja",description:"Valvesüsteemi kasutaja lisamine.",fields:{name:{heading:"Nimi",description:"Kasutaja nimi."},code:{heading:"Valvestuskood",description:"Selle kasutaja kood."},confirm_code:{heading:"Koodi kinnitamine",description:"Sisesta sama kood uuesti."},is_admin:{heading:"Kasutajal on haldusõigused",description:"Kasutaja saab teha muudatusi."},can_arm:{heading:"Tohib valvestada",description:"Koodi sisestamine valvestab."},can_disarm:{heading:"Tohib valvest maha võtta",description:"Koodi sisestamine võtab valvest maha."},is_override_code:{heading:"Alistuskood",description:"Koodi sisestamine käivitab kohese häire"}},errors:{no_name:"Nimi puudub.",no_code:"Kood peab olema vhemalt 4 tärki.",code_mismatch:"Sisestatud koodid ei klapi."}},edit_user:{title:"Muuda kasutaja sätteid",description:"Muuda kasutaja '{name}' sätteid.",fields:{old_code:{heading:"Kehtiv kood",description:"Kehtiv kood, jäta tühjaks kui ei taha muuta."}}}}},actions:{title:"Toimingud",cards:{notifications:{title:"Teavitused",description:"Halda saadetavaid teavitusi",table:{enabled:"Lubatud",no_items:"Teavitusi pole veel loodud."},actions:{new_notification:"Uus teavitus"},filter:{label:"Sordi alade järgi",no_area:"Põhiala"}},actions:{description:"Arenduses, mõeldud seadmete lülitamiseks.",table:{no_items:"Toiminguid pole veel määratud."},actions:{new_action:"Uus toiming"}},new_notification:{title:"Loo teavitus",description:"Uue teavituse loomine.",fields:{name:{heading:"Nimi",description:"Teavituse kirjeldus"},event:{heading:"Sündmus",description:"Mille puhul teavitada",choose:{armed:{name:"Valvestatud",description:"Valvestamine oli edukas"},disarmed:{name:"Valvest maas",description:"Valve mahavõtmine õnnestus"},triggered:{name:"Häire",description:"Valvesüsteem andis häire"},arm_failure:{name:"Valvestamine nurjus",description:"Valvestamine ei õnnestunud mõne anduri oleku või vea tõttu"},arming:{name:"Valvestamise eelne viivitus algas",description:"Algas valvestamise eelviide, majast võib lahkuda."},pending:{name:"Sisenemise viide rakendus",description:"Märgati sisenemist, häire rakendub peale viidet."}}},mode:{heading:"Olek",description:"Millises valve olekus teavitada (valikuline)"},title:{heading:"Päis",description:"Teavitussõnumi päis"},message:{heading:"Sisu",description:"Teavitussõnumi tekst"},target:{heading:"Saaja",description:"Seade millele edastada teavitus"}},actions:{test:"Try it"}},new_action:{title:"Loo toiming",description:"Seadme oleku muutmine valve oleku muutmisel.",fields:{name:{heading:"Nimi",description:"Toimingu kirjeldus"},event:{heading:"Sündmus",description:"Millisel juhul käivitada toiming"},area:{heading:"Ala",description:"Ala millele sündmus rakendub, põhiala puhul jäta tühjaks."},mode:{heading:"Olek",description:"Millises valve olekus toiming käivitada (valikuline)"},entity:{heading:"Olem",description:"Toimingu olem"},action:{heading:"Toiming",description:"Olemi toiming",turn_on:"Lülita sisse",turn_off:"Lülita välja"}}}},validation_errors:{no_triggers:"Selle tegevuse käivitamiseks puudub vajalik olek või sündmus.",empty_trigger:"Ühel päästikul puudub oleku või sündmuse tingimus.",invalid_trigger:"Ühel päästikul: {trigger} on vigane väärtus",invalid_mode:"Valve olekule: {mode} on sisestatud vigane väärtus",no_actions:"Sellele toimingule pole määratud tegevust.",no_service:"Ühel toimingutest puudub nõutav teenus.",invalid_service:"Ühele toimingule on omistatud sobimatu teenus: {service}",no_service_data:"Ühel toimingul puuduvad teenuse andmed.",no_entity_in_service_data:"Ühel toimingul puudub teenuse andmetes olemi ID.",no_message_in_service_data:"Ühe toimingu teenuse andmetes puuduvad teenuse andmed."}}},Ye={common:Ie,components:Fe,title:"Alarm panel",panels:He},Be={modes_long:{armed_away:"Ingeschakeld Weg",armed_home:"Ingeschakeld Thuis",armed_night:"Ingeschakeld Nacht",armed_custom_bypass:"Ingeschakeld Aangepast"},modes_short:{armed_away:"Weg",armed_home:"Thuis",armed_night:"Nacht",armed_custom_bypass:"Aangepast"}},We={time_slider:{seconds:"sec",minutes:"min",infinite:"oneindig",none:"geen"},editor:{ui_mode:"Wissel naar UI",yaml_mode:"Wissel naar YAML"}},Qe={general:{title:"Algemeen",cards:{general:{description:"Dit paneel definieert enkele instellingen die van toepassing zijn op alle inschakelmodi.",fields:{disarm_after_trigger:{heading:"Uitschakelen na activatie",description:"Nadat de triggertijd is verstreken, schakelt u het alarm uit in plaats van terug te keren naar de ingeschakelde toestand."},enable_mqtt:{heading:"MQTT inschakelen",description:"Allow the alarm panel to be controlled through MQTT."},enable_master:{heading:"Master alarm inschakelen",description:"Creëert een entiteit om alle gebieden tegelijkertijd te besturen."}},actions:{setup_mqtt:"MQTT Configuratie",setup_master:"Master configuratie"}},modes:{title:"Modi",description:"Dit paneel kan worden gebruikt om de inschakelmodi van het alarm in te stellen.",fields:{mode:{armed_away:"Ingeschakeld weg wordt gebruikt als alle mensen het huis hebben verlaten. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, evenals bewegingssensoren in het huis.",armed_home:"Ingeschakeld thuis (ook wel ingeschakeld thuisblijven genoemd) wordt gebruikt bij het instellen van het alarm terwijl er mensen in huis zijn. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, maar bewegingssensoren in het huis worden niet gebruikt.",armed_night:"Ingeschakeld nacht wordt gebruikt bij het instellen van het alarm voordat u gaat slapen. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, en geselecteerde bewegingssensoren (beneden) in het huis.",armed_custom_bypass:"Een extra modus om uw eigen beveiligingsperimeter te definiëren.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Vertrek vertraging",description:"Bij het inschakelen van het alarm zullen de sensoren binnen deze tijdsperiode het alarm nog niet activeren."},entry_delay:{heading:"Binnenkomst vertraging",description:"Vertragingstijd totdat het alarm afgaat nadat een van de sensoren is geactiveerd."},trigger_time:{heading:"Activeer tijd",description:"Tijd waarin de sirene af gaat."}}},mqtt:{title:"MQTT configuratie",description:"Dit paneel kan worden gebruikt voor configuratie van de MQTT-interface.",fields:{state_topic:{heading:"Toestand topic",description:"Topic waarop statusupdates worden gepubliceerd"},command_topic:{heading:"Commando topic",description:"Topic waarop commando's voor in- / uitschakelen worden verzonden."},require_code:{heading:"Vereis code",description:"Vereis dat de code wordt verzonden met de opdracht."},state_payload:{heading:"Configureer de payload per toestand",item:"Definieer een payload voor toestand '{state}'"},command_payload:{heading:"Configureer een payload per commando",item:"Definieer een payload voor commando '{command}'"}}},areas:{title:"Gebieden",description:"Gebieden kunnen worden gebruikt om uw alarmsysteem in meerdere compartimenten op te delen.",no_items:"Er zijn nog geen gebieden gedefinieerd.",table:{remarks:"Opmerkingen",summary:"Dit gebied bevat {summary_sensors} en {summary_automations}.",summary_sensors:"{number} sensoren",summary_automations:"{number} automatiseringen"},actions:{add:"Toevoegen"}}},dialogs:{create_area:{title:"Nieuw gebied",fields:{copy_from:"Kopieer instellingen van"}},edit_area:{title:"Bewerken van gebied '{area}'",name_warning:"Opmerking: als u de naam wijzigt, wordt de entiteits-ID gewijzigd"},remove_area:{title:"Gebied verwijderen?",description:"Weet u zeker dat u dit gebied wilt verwijderen? Dit gebied bevat {sensors} sensoren en {automations} automatiseringen, die ook zullen worden verwijderd."},edit_master:{title:"Master configuratie"},disable_master:{title:"Master uitschakelen?",description:"Weet u zeker dat u het master alarm wilt verwijderen? Dit gebied bevat {automations} automatiseringen, die met deze actie worden verwijderd."}}},sensors:{title:"Sensoren",cards:{sensors:{description:"Momenteel geconfigureerde sensoren. Klik op een entiteit om wijzigingen aan te brengen.",no_items:"Er zijn nog geen sensoren aan het alarm toegevoegd. Zorg ervoor dat u ze eerst toevoegt.",table:{arm_modes:"Inschakelmodi",always_on:"(Altijd)"},filter:{label:"Filter op gebied",no_area:"(Geen gebied)"}},add_sensors:{title:"Voeg sensoren toe",description:"Voeg meer sensoren toe. Zorg ervoor dat uw sensoren een friendly_name hebben, zodat u ze kunt identificeren.",no_items:"Er zijn geen beschikbare HA-entiteiten die voor het alarm kunnen worden geconfigureerd. Zorg ervoor dat u entiteiten van het type binary_sensor opneemt.",actions:{add_to_alarm:"Voeg aan alarm toe",show_all:"Toon alle"}},editor:{title:"Wijzig Sensor",description:"Configureren van de sensorinstellingen van '{entity}'.",fields:{name:{heading:"Naam",description:"Overschrijf vriendelijke naam."},area:{heading:"Gebied",description:"Selecteer een gebied dat deze sensor bevat."},device_type:{heading:"Apparaat Type",description:"Kies een apparaattype om automatisch de juiste instellingen toe te passen.",choose:{door:{name:"Deur",description:"Een deur, poort of andere ingang die wordt gebruikt voor het betreden/verlaten van de woning."},window:{name:"Raam",description:"Een raam of een deur die niet wordt gebruikt om het huis binnen te komen, zoals een balkon."},motion:{name:"Beweging",description:"Aanwezigheidssensor of soortgelijk apparaat met een vertraging tussen activeringen."},tamper:{name:"Sabotage",description:"Detector van verwijdering van sensorkap, glasbreuksensor, enz."},environmental:{name:"Omgeving",description:"Rook/gassensor, lekdetector, etc. (niet gerelateerd aan inbraakbeveiliging)."},other:{name:"Algemeen"}}},always_on:{heading:"Altijd aan",description:"Sensor should always trigger the alarm."},modes:{heading:"Ingeschakelde modi",description:"Alarmmodi waarin deze sensor actief is."},arm_on_close:{heading:"Inschakelen na sluiten",description:"Na deactivering van deze sensor wordt de resterende vertrek vertraging automatisch overgeslagen."},immediate:{heading:"Onmiddelijk",description:"Als deze sensor wordt geactiveerd, wordt het alarm direct geactiveerd in plaats van na de binnenkomst vertraging."},allow_open:{heading:"Sta open toe tijdens het inschakelen",description:"Sta toe dat deze sensor kort na het verlaten actief is, zodat hij het inschakelen niet blokkeert."},auto_bypass:{heading:"Automatisch uitsluiten",description:"Elimineer de sensor als deze actief is tijdens het inschakelen van het alarm."},trigger_unavailable:{heading:"Activeren indien niet beschikbaar",description:"Wanneer de sensorstatus 'niet beschikbaar' wordt, wordt de sensor geactiveerd."}},actions:{toggle_advanced:"Geavanceerde instellingen",remove:"Verwijder"},errors:{description:"Corrigeer de volgende fouten:",no_area:"Er is geen gebied geselecteerd",no_modes:"Er zijn geen modi geselecteerd waarvoor de sensor actief zou moeten zijn"}}}},codes:{title:"Codes",cards:{codes:{description:"Wijzig de instellingen voor de code.",fields:{code_arm_required:{heading:"Gebruik inschakel code",description:"Vereist een code voor het inschakelen van het alarm"},code_disarm_required:{heading:"Gebruik uitschakelcode",description:"Vereist een code om het alarm uit te schakelen"},code_format:{heading:"Code opmaak",description:"Stelt het invoertype in voor de Lovelace alarmkaart.",code_format_number:"pincode",code_format_text:"wachtwoord"}}},user_management:{title:"Gebruikersbeheer",description:"Elke gebruiker heeft zijn eigen code om het alarm in/uit te schakelen.",no_items:"Er zijn nog geen gebruikers",table:{remarks:"Opmerkingen",administrator:"Beheerder"},actions:{new_user:"nieuwe gebruiker"}},new_user:{title:"Maak een nieuwe gebruiker aan",description:"Gebruikers kunnen worden aangemaakt om toegang te verlenen tot het bedienen van het alarm.",fields:{name:{heading:"Naam",description:"Naam van de gebruiker."},code:{heading:"Code",description:"Code voor deze gebruiker."},confirm_code:{heading:"Bevestig de code",description:"Herhaal de code."},is_admin:{heading:"Gebruiker is beheerder",description:"Sta de gebruiker toe om wijzigingen aan te brengen"},can_arm:{heading:"Code toestaan voor inschakeling",description:"Door deze code in te voeren, wordt het alarm geactiveerd"},can_disarm:{heading:"Code toestaan voor uitschakelen",description:"Door deze code in te voeren, wordt het alarm gedeactiveerd"},is_override_code:{heading:"Is een forceer code",description:"Als u deze code invoert, wordt het alarm geforceerd geactiveerd"}},errors:{no_name:"Geen naam opgegeven.",no_code:"Code moet minimaal 4 tekens/cijfers bevatten.",code_mismatch:"De codes komen niet overeen."}},edit_user:{title:"Wijzig Gebruiker",description:"Wijzig de configuratie voor gebruiker '{name}'.",fields:{old_code:{heading:"Huidige code",description:"Huidige code, laat leeg om ongewijzigd te laten."}}}}},actions:{title:"Acties",cards:{notifications:{title:"Meldingen",description:"Met dit paneel kunt u meldingen beheren die moeten worden verzonden tijdens een bepaalde alarmgebeurtenis",table:{enabled:"Ingeschakeld",no_items:"Er zijn nog geen notificaties aangemaakt."},actions:{new_notification:"nieuwe melding"},filter:{label:"Filter op gebied",no_area:"Alarm master"}},actions:{description:"Dit paneel kan worden gebruikt om een apparaat te schakelen wanneer de status van het alarm veranderd.",table:{no_items:"Er zijn nog geen acties gemaakt."},actions:{new_action:"nieuwe actie"}},new_notification:{title:"Maak een melding",description:"Maak een nieuwe melding.",fields:{name:{heading:"Naam",description:"Beschrijving voor deze melding"},event:{heading:"Gebeurtenis",description:"Wanneer moet de melding worden verzonden",choose:{armed:{name:"Alarm is is ingeschakeld",description:"Het alarm is succesvol ingeschakeld"},disarmed:{name:"Alarm is uitgeschakeld",description:"Het alarm is uitgeschakeld"},triggered:{name:"Alarm is afgegaan",description:"Het alarm gaat af"},arm_failure:{name:"Kan niet inschakelen",description:"Het inschakelen van het alarm is mislukt vanwege een of meerdere blokkerende sensoren"},arming:{name:"Vertrek",description:"Vertrekvertraging ingegaan, tijd om het huis te verlaten."},pending:{name:"Binnenkomst",description:"Binnenkomstvertraging ingegaan, het alarm dient te worden uitgeschakeld."}}},mode:{heading:"Mode",description:"Beperk de actie tot specifieke inschakel modi (optioneel)"},title:{heading:"Titel",description:"Titel voor het meldingsbericht"},message:{heading:"Bericht",description:"Inhoud van het meldingsbericht"},target:{heading:"Doel",description:"Apparaat om het push-bericht naar te sturen"}},actions:{test:"Uitproberen"}},new_action:{title:"Maak een actie",description:"Dit paneel kan worden gebruikt om een apparaat te schakelen wanneer de alarmstatus verandert.",fields:{name:{heading:"Naam",description:"Beschrijving voor deze actie"},event:{heading:"Gebeurtenis",description:"Wanneer moet de actie worden uitgevoerd"},area:{heading:"Gebied",description:"Het gebied waarop de gebeurtenis van toepassing is, laat leeg om het algemene alarm te selecteren."},mode:{heading:"Mode",description:"Beperk de actie tot specifieke inschakel modi (optioneel)"},entity:{heading:"Entiteit",description:"Entiteit om actie op uit te voeren"},action:{heading:"Actie",description:"Actie die op de entiteit moet worden uitgevoerd",turn_on:"Zet aan",turn_off:"Zet uit"}}}},validation_errors:{no_triggers:"Er is geen toestand of gebeurtenis voorzien voor het activeren van deze automatisering.",empty_trigger:"Voor een van de triggers is geen status of gebeurtenis opgegeven.",invalid_trigger:"Een van de triggers heeft een ongeldige waarde: {trigger}",invalid_mode:"Ongeldige invoer opgegeven voor 'mode': {mode}",no_actions:"Er zijn geen acties ingesteld uit te voeren door deze automatisering.",no_service:"Een van de acties mist een service.",invalid_service:"Er is een ongeldige servicenaam opgegeven voor een van de acties: {service}",no_service_data:"Voor een van de acties zijn geen servicegegevens opgegeven.",no_entity_in_service_data:"Er is geen entity_id opgegeven in de service_data van een van de acties.",no_message_in_service_data:"Er is geen bericht opgegeven in de service_data van een van de acties."}}},Ge={common:Be,components:We,title:"Alarmpaneel",panels:Qe},Ke={modes_long:{armed_away:"Activée en mode absence",armed_home:"Activée en mode présence",armed_night:"Activée en mode nuit",armed_custom_bypass:"Activée en mode personnalisé"},modes_short:{armed_away:"Absence",armed_home:"Présence",armed_night:"Nuit",armed_custom_bypass:"Personnalisé"}},Ze={time_slider:{seconds:"sec",minutes:"min",infinite:"infini",none:"Aucune"},editor:{ui_mode:"Afficher l'éditeur visuel",yaml_mode:"Afficher l'éditeur de code"}},Je={general:{title:"Généraux",cards:{general:{description:"Ce panneau définit les paramètres globaux de l'alarme.",fields:{disarm_after_trigger:{heading:"Désactivation après déclenchement",description:"Lors que le temps de fonctionnement de la sirène est écoulé, désactive l'alarme au lieu de la réactiver."},enable_mqtt:{heading:"Utilisation avec MQTT",description:"Permet au panneau d'alarme d'être contrôlé via MQTT."},enable_master:{heading:"Activation de commande centralisée",description:"Créer une entité pour piloter toutes les zone en même temps."}},actions:{setup_mqtt:"Configuration MQTT",setup_master:"Configuration pricipale"}},modes:{title:"Modes",description:"Ce panneau définit le mode de gestion pour chaque type d'activation.",fields:{mode:{armed_away:"Ce mode sera utilisé lorsque toutes les personnes auront quitté la maison. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées, les détecteurs de mouvement à l'intérieur de la maison seront opérationnels.",armed_home:"Ce mode sera utilisée lorsque des personnes sont dans la maison. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées (périmétrie), les détecteurs de mouvement à l'intérieur de la maison seront inopérants.",armed_night:"Ce mode sera utilisée lors du réglage de l'alarme avant de s'endormir. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées, et les capteurs de mouvement sélectionnés (ex : rez de chaussée) dans la maison seront opérationnels.",armed_custom_bypass:"Ce mode supplémentaire permet de définir votre propre périmètre de sécurité.",enabled:"Actif",disabled:"Inactif"},exit_delay:{heading:"Délai pour sortir",description:"Lors de l'activation, pendant cette période, les capteurs ne déclencheront pas l'alarme."},entry_delay:{heading:"Délai pour entrer",description:"Temps d'attente avant que l'alarme ne se déclenche après détection d'un des capteurs."},trigger_time:{heading:"Temps de fonctionnement",description:"Temps de fonctionnement de la sirène"}}},mqtt:{title:"Configuration MQTT",description:"Ce panneau peut être utilisé pour la configuration de l'interface MQTT.",fields:{state_topic:{heading:"Etat de données",description:"Donnée sur laquelle les mises à jour d'état sont publiées"},event_topic:{heading:"Evènement de données",description:"Donnée sur laquelle les évènements d'état sont publiés"},command_topic:{heading:"Commande de donnée",description:"Donnée sur laquelle les commandes d'armement / désarmement sont envoyées."},require_code:{heading:"Code requis",description:"Exige que le code soit envoyé avec la commande."},state_payload:{heading:"Configurer une valeur par état",item:"Définir une valeur par état '{state}'"},command_payload:{heading:"Configurer une valeur par commande",item:"Définir une valeur par commande '{command}'"}}},areas:{title:"Zones",description:"Les zones peuvent être utilisées pour diviser votre système d'alarme en plusieurs secteurs.",no_items:"Il n'y a pas encore de zones définies.",table:{remarks:"Remarque",summary:"Cette zone contient des {summary_sensors} et {summary_automations}.",summary_sensors:"{number} capteurs",summary_automations:"{number} automations"},actions:{add:"Ajouter"}}},dialogs:{create_area:{title:"Nouvelle zone",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editer la zone '{area}'",name_warning:"Note: Changer le nom changera l'entity ID"},remove_area:{title:"Suppression de zone?",description:"Etes vous sur de vouloir supprimer cette zone? Cette zone contient {sensors} des capteurs et {automations} automatisations, qui seront également supprimés."},edit_master:{title:"Configuration principale"},disable_master:{title:"Désactiver la configuration principale?",description:"Etes vous sur de vouloir supprimer la configuration principale? Cette zone contient {automations} automatisations, qui seront également supprimées."}}},sensors:{title:"Capteurs",cards:{sensors:{description:"Capteurs actuellement configurés. Cliquez sur une entité pour apporter des modifications.",no_items:"Il n'y a pas encore de capteur ajouté à l'alarme. Assurez-vous de les ajouter d'abord.",table:{arm_modes:"Type d'activation",always_on:"(Toujours)"},filter:{label:"Filtrer par zone",no_area:"Aucune zone"}},add_sensors:{title:"Ajouter un capteur",description:"Ajoutez plus de capteurs. Assurez-vous que vos capteurs ont un nom personnalisé afin de pouvoir les identifier.",no_items:"Aucune entité HA disponible ne peut être configurée pour l'alarme. Assurez-vous d'inclure les entités de type binary_sensor.",actions:{add_to_alarm:"Ajouter à l'alarme",show_all:"Tout montrer"}},editor:{title:"Editer un capteur",description:"Configurer les paramètres du capteur '{entity}'.",fields:{name:{heading:"Nom",description:"Remplacer le nom personnalisé (friendly name)."},area:{heading:"Zone",description:"Selectionner une zone contenant ce capteur."},device_type:{heading:"Type de détection",description:"Choisissez un type de détection pour appliquer automatiquement les paramètres appropriés.",choose:{door:{name:"Porte",description:"Une porte, un portail ou une autre entrée utilisée pour entrer / sortir de la maison."},window:{name:"Fenêtre",description:"Une fenêtre, ou une porte non utilisée pour entrer dans la maison comme un balcon."},motion:{name:"Mouvement",description:"Capteur de présence ou appareil similaire présentant un délai entre les activations."},tamper:{name:"Effraction",description:"Détection d'arrachage du capteur, capteur de bris de verre, etc.."},environmental:{name:"Détecteur Environmental",description:"Détecteur de fumée / gaz, détecteur de fuite, etc. (non lié à la protection anti-effraction)."},other:{name:"Générique"}}},always_on:{heading:"Toujours en service",description:"Le capteur doit toujours déclencher l'alarme."},modes:{heading:"Mode possible",description:"Modes d'alarme dans lesquels ce capteur est actif."},arm_on_close:{heading:"Activer après fermeture",description:"Après la désactivation de ce capteur, le délai de sortie restant sera automatiquement ignoré."},immediate:{heading:"Immédiat",description:"L'activation de ce capteur déclenchera l'alarme immédiatement plutôt qu'après le délai d'entrée."},allow_open:{heading:"Autoriser l'ouverture lors de l'activation",description:"Permet à ce capteur d'être actif, peu de temps après votre départ afin qu'il ne bloque pas l'armement."},auto_bypass:{heading:"Bypass automatique",description:"Exclut ce capteur de l'alarme s'il est ouvert lors de l'armement."},trigger_unavailable:{heading:"Déclenchement lorsqu'il n'est pas disponible",description:"Lorsque l'état du capteur devient `` indisponible '', cela activera le capteur."}},actions:{toggle_advanced:"Paramètres avancées",remove:"Supprimer"},errors:{description:"Veuillez corriger les erreurs suivantes:",no_area:"Aucune zone n'est sélectionnée",no_modes:"Aucun mode sélectionné pour lequel le capteur doit être actif"}}}},codes:{title:"Codes",cards:{codes:{description:"Gestion des paramètres des codes.",fields:{code_arm_required:{heading:"Utiliser un code pour l'activation",description:"Code requis pour l'activation de l'alarme"},code_disarm_required:{heading:"Utiliser un code pour la désactivation",description:"Code requis pour la désactivation de l'alarme"},code_format:{heading:"Format du code",description:"Définit le type d'entrée pour la carte d'alarme Lovelace.",code_format_number:"pincode",code_format_text:"password"}}},user_management:{title:"Gestion des utilisateurs",description:"Chaque utilisateur a son propre code pour activer / désactiver l'alarme.",no_items:"Il n'y a aucun utilisateur de défini",table:{remarks:"Remarque",administrator:"Administrateur"},actions:{new_user:"Nouvel utilisateur"}},new_user:{title:"Créer un nouvel utilisateur",description:"Des utilisateurs peuvent être créés pour donner accès au fonctionnement de l'alarme.",fields:{name:{heading:"Nom",description:"Nom de l'utilisateur."},code:{heading:"Code",description:"Code personnel de l'utilisateur."},confirm_code:{heading:"Confirmation du code",description:"Répèter le code."},is_admin:{heading:"L'utilisateur est aussi administrateur",description:"Autorise l'utilisateur à effectuer des changements."},can_arm:{heading:"Demande de code pour l'activation",description:"Entrer ce code pour activer l'alarme."},can_disarm:{heading:"Demande de code pour désactivation",description:"Entrer ce code pour désactiver l'alarme."},is_override_code:{heading:"Code de sécurité",description:"La saisie de ce code forcera l'activation l'alarme."}},errors:{no_name:"Aucun nom saisi.",no_code:"Le code doit contenir 4 caractères/chiffres minimum.",code_mismatch:"Les codes sont différents."}},edit_user:{title:"Editer l'utilisateur",description:"Changer la configuration pour l'utilisateur '{name}'.",fields:{old_code:{heading:"Code utilisé",description:"Code actuel, laissez vide pour ne rien changer."}}}}},actions:{title:"Actions",cards:{notifications:{title:"Notifications",description:"À l'aide de ce panneau, vous pouvez gérer les notifications à envoyer lors d'un évènement d'alarme",table:{enabled:"Active",no_items:"Il n'y a aucune notification de créée."},actions:{new_notification:"Nouvelle notification"},filter:{label:"Filtrer par zone",no_area:"Alarme principale"}},actions:{description:"Ce panneau est utilisé pour changer d'état les appareils de votre choix.",table:{no_items:"Il n'y a aucune action de créer."},actions:{new_action:"Nouvelle action"}},new_notification:{title:"Créer une notification",description:"Créer une nouvelle notification.",fields:{name:{heading:"Nom",description:"Description de la notification"},event:{heading:"Evènement",description:"Détermine quand la notification doit être envoyée",choose:{armed:{name:"Alarme activée ",description:"l'alarme s'est correctement activée"},disarmed:{name:"Alarme désactivée",description:"L'alarme est désactivée"},triggered:{name:"Alarme déclenchée",description:"L'alarme est déclenchée"},arm_failure:{name:"Armement impossible",description:"L'armement est impossible dû à un ou plusieurs capteurs"},arming:{name:"Délai de sortie activé",description:"Le délai de sortie est activé, vous devez quitter la maison."},pending:{name:"Délai d'entrée activé",description:"Le délai d'entrée est activé, l'alarme va se déclencher."}}},mode:{heading:"Mode",description:"Limite la notification à un mode spécifique (optionnel)"},title:{heading:"Titre",description:"Titre du message de la notification"},message:{heading:"Message",description:"Contenu du message de la notification"},target:{heading:"Cible",description:"Appareil recevant le message"}},actions:{test:"Essai"}},new_action:{title:"Créer une action",description:"Ce panneau peut être utilisé pour commuter un appareil lorsque l'état de l'alarme change.",fields:{name:{heading:"Nom",description:"Description de l'action"},event:{heading:"Evènement",description:"Détermine quand l'action doit être exécutée"},area:{heading:"Zone",description:"Zone pour laquelle l'évènement s'applique, laissez vide pour sélectionner l'alarme globale."},mode:{heading:"Mode",description:"Limite l'action à un mode spécifique (optionnel)"},entity:{heading:"Entité",description:"Entité sur laquelle effectuer une action"},action:{heading:"Action",description:"Action à exécuter sur l'entité",turn_on:"Mettre à on",turn_off:"Mettre à off"}}}},validation_errors:{no_triggers:"Aucun état ou évènement prévu pour le déclenchement de cette automatisation.",empty_trigger:"L'un des déclencheurs n'a aucun état ou évènement fourni.",invalid_trigger:"L'un des déclencheurs a une valeur non valide: {trigger}",invalid_mode:"Entrée non valide fournie par le 'mode': {mode}",no_actions:"Aucune action n'est prévue pour être effectuée par cette automatisation.",no_service:"Il manque un service dans l’une des actions.",invalid_service:"Un nom de service non valide a été fourni pour l'une des actions: {service}",no_service_data:"Aucune donnée de service n'a été fournie pour l'une des actions.",no_entity_in_service_data:"Aucun entity_id n'a été fourni dans le service_data de l'une des actions.",no_message_in_service_data:"Aucun message n'a été fourni dans le service_data de l'une des actions."}}},Xe={common:Ke,components:Ze,title:"Gestion de L'alarme",panels:Je},ea={modes_long:{armed_away:"Modalità 'fuori casa' attiva",armed_home:"Modalità 'in casa' attiva",armed_night:"Modalità 'notte' attiva",armed_custom_bypass:"Modalità 'personalizzato' attiva"},modes_short:{armed_away:"Fuori casa",armed_home:"In casa",armed_night:"Notte",armed_custom_bypass:"Personalizzato"}},aa={time_slider:{seconds:"sec",minutes:"min",infinite:"infinito",none:"niente"},editor:{ui_mode:"Passa a UI",yaml_mode:"Passa a YAML"}},ta={general:{title:"Generali",cards:{general:{description:"Questo pannello definisce alcune impostazioni da applicare alle modalità di allarme.",fields:{disarm_after_trigger:{heading:"Disattiva allarme dopo l'attivazione",description:"Dopo che il tempo di attivazione è scaduto, disattivare l'allarme invece di tornare allo stato inserito."},enable_mqtt:{heading:"Abilita MQTT",description:"Permetti al pannello allarme di essere controllato attraverso MQTT."},enable_master:{heading:"Enable alarm master",description:"Creates an entity for controlling all areas simultaneously."}},actions:{setup_mqtt:"Configurazione MQTT",setup_master:"Master Configuration"}},modes:{title:"Modes",description:"This panel can be used to set up the arm modes of the alarm.",fields:{mode:{armed_away:"Modalità 'fuori casa': da utilizzare quando tutte le persone lasciano la casa. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi, così come i sensori di movimento all'interno della casa.",armed_home:"Modalità 'in casa': da utilizzare quando si attiva l'allarme mentre le persone sono in casa. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi, ma non i sensori di movimento all'interno della casa.",armed_night:"Modalità 'notte': da utilizzare quando si imposta la sveglia prima di andare a dormire. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi e sensori di movimento selezionati (ad esempio al piano di sotto) nella casa.",armed_custom_bypass:"Modalità 'personalizzato': da utilizzare per definire una modalità di allarme specifica per le esigenze dell'utilizzatore.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Tempo di preattivazione",description:"Quando si attiva l'allarme, entro questo periodo di tempo i sensori non attiveranno ancora l'allarme."},entry_delay:{heading:"Ritardo di attivazione",description:"Tempo di ritardo fino allo scatto dell'allarme dopo l'attivazione di uno dei sensori."},trigger_time:{heading:"Tempo di attivazione",description:"Tempo durante il quale suonerà la sirena"}}},mqtt:{title:"Configurazione MQTT",description:"Questo pannello può essere usato per le impostazioni MQTT.",fields:{state_topic:{heading:"Topic di stato",description:"Topic su cui vengono pubblicati gli aggiornamenti di stato"},command_topic:{heading:"Topic di comando",description:"Topic su cui vengono inviati i comandi di inserimento / disinserimento."},require_code:{heading:"Richiedi Codice",description:"Richiedi il codice da inviare con il comando."},state_payload:{heading:"Configura payload per stato",item:"Definisci un payload per lo stato '{state}'"},command_payload:{heading:"Configura payload per comando",item:"Definisci un payload per il comando '{command}'"}}},areas:{title:"Areas",description:"Areas can be used for dividing your alarm system into multiple compartments.",no_items:"There are no areas defined yet.",table:{remarks:"Remarks",summary:"This area contains {summary_sensors} and {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automations"},actions:{add:"Add"}}},dialogs:{create_area:{title:"New area",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editing area '{area}'",name_warning:"Note: changing the name will change the entity ID"},remove_area:{title:"Remove area?",description:"Are you sure you want to remove this area? This area contains {sensors} sensors and {automations} automations, which will be removed as well."},edit_master:{title:"Master configuration"},disable_master:{title:"Disable master?",description:"Are you sure you want to remove the alarm master? This area contains {automations} automations, which will be removed with this action."}}},sensors:{title:"Sensori",cards:{sensors:{description:"Sensori attualmente configurati. Clicca sull'entità per modificare.",no_items:"Non ci sono ancora sensori aggiunti a questo allarme. Assicurati di aggiungerli prima.",table:{arm_modes:"Modalità di attivazione",always_on:"(Sempre)"},filter:{label:"Filter by area",no_area:"(No area)"}},add_sensors:{title:"Aggiungi Sensori",description:"Aggiungi più sensori. Assicurati che i sensori abbiano un friendly_name (nome amichevole), in modo da identificarli più facilmente.",no_items:"Non ci sono entità disponibili che possono essere configurate con l'allarme. Assicurati di includere entità del tipo binary_sensor (sensore binario).",actions:{add_to_alarm:"aggiungi all'allarme",show_all:"Mostra tutti"}},editor:{title:"Modifica Sensore",description:"Configura le impostazioni del sensore '{entity}'.",fields:{name:{heading:"Nome",description:"Sovrascrivi friendly name."},area:{heading:"Area",description:"Select an area which contains this sensor."},device_type:{heading:"Device Type",description:"Choose a device type to automatically apply appropriate settings.",choose:{door:{name:"Door",description:"A door, gate or other entrance that is used for entering/leaving the home."},window:{name:"Window",description:"A window, or a door not used for entering the house such as balcony."},motion:{name:"Motion",description:"Presence sensor or similar device having a delay between activations."},tamper:{name:"Tamper",description:"Detector of sensor cover removal, glass break sensor, etc."},environmental:{name:"Environmental",description:"Smoke/gas sensor, leak detector, etc. (not related to burglar protection)."},other:{name:"Generic"}}},always_on:{heading:"Sempre attivo",description:"Il sensore attiverà sempre l'allarme."},modes:{heading:"Modalità attive",description:"Modalità di allarme in cui il sensore risulta collegato."},arm_on_close:{heading:"Arm after closing",description:"After deactivation of this sensor, the remaining exit delay will automatically be skipped."},immediate:{heading:"Immediato",description:"Il sensore si attiva saltando il ritardo."},allow_open:{heading:"Permetti apertura",description:"Consentire a questo sensore di rimanere attivo poco dopo essere usciti."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Fai scattare l'allarme quando non disponibile",description:"L'allarme scatterà quando lo stato del sensore diverrà 'non disponibile'."}},actions:{toggle_advanced:"Advanced settings",remove:"Remove"},errors:{description:"Please correct the following errors:",no_area:"No area is selected",no_modes:"No modes are selected for which the sensor should be active"}}}},codes:{title:"Codici",cards:{codes:{description:"Modifica le impostazioni dei codici.",fields:{code_arm_required:{heading:"Usa codice d'attivazione",description:"Richiedi un codice per attivare l'allarme"},code_disarm_required:{heading:"Usa codice di disattivazione",description:"Richiedi un codice per disattivare l'allarme"},code_format:{heading:"Formato del codice",description:"Imposta il tipo di codice da digitare nella card di Lovelace.",code_format_number:"codice numerico",code_format_text:"password"}}},user_management:{title:"Gestione utente",description:"Ogni utente ha il suo codice per attivare/disattivare l'allarme.",no_items:"Non è stato creato nessun utente per ora",table:{remarks:"Ruolo",administrator:"Amministratore"},actions:{new_user:"nuovo utente"}},new_user:{title:"Crea nuovo utente",description:"Gli utenti potranno operare con l'allarme.",fields:{name:{heading:"Nome",description:"Nome dell'utente."},code:{heading:"Codice operativo",description:"Codice che utilizzerà quest'utente."},confirm_code:{heading:"Ripeti codice operativo",description:"Ripeti il codice operativo scelto."},is_admin:{heading:"L'utente è un amministratore",description:"Ciò consente al utente di effettuare modifiche al sistema di allarme"},can_arm:{heading:"Utilizza codice per attivare l'allarme",description:"Utilizza codice per attivare l'allarme"},can_disarm:{heading:"Utilizza codice per disattivare l'allarme",description:"Utilizza codice per disattivare l'allarme"},is_override_code:{heading:"E' un codice di forzatura",description:"Inserendo questo codice forzerai lo stato di attivazione dell'allarme"}},errors:{no_name:"Non hai inserito il nome.",no_code:"Il codice deve avere almeno 4 numeri o caratteri.",code_mismatch:"Il codice scelto non combacia, verifica il codice inserito."}},edit_user:{title:"Modifica Utente",description:"Cambia impostazioni per l'utente '{name}'.",fields:{old_code:{heading:"Modifica Codice",description:"Codice attuale, lascia vuoto per non modificare."}}}}},actions:{title:"Azioni",cards:{notifications:{title:"Notifiche",description:"Con questo pannello puoi gestire le notifiche da inviare quanto accade un determinato evento",table:{enabled:"Abilitato",no_items:"Non è stata creata nessuna notifica per ora."},actions:{new_notification:"nuova notifica"},filter:{label:"Filter by area",no_area:"Alarm master"}},actions:{description:"Questo pannello è in fase di sviluppo. Sarà usato per cambiare lo stato di una o più entità.",table:{no_items:"Non è stata creata nessuna azione per ora."},actions:{new_action:"nuova azione"}},new_notification:{title:"Crea notifica",description:"Crea una nuova notifica.",fields:{name:{heading:"Nome",description:"Descrizione della notifica"},event:{heading:"Evento",description:"Quando questa notifica deve essere inviata",choose:{armed:{name:"Alarm is armed",description:"The alarm is succesfully armed"},disarmed:{name:"Alarm is disarmed",description:"The alarm is disarmed"},triggered:{name:"Alarm is triggered",description:"The alarm is triggered"},arm_failure:{name:"Failed to arm",description:"The arming of the alarm failed due to one or more open sensors"},arming:{name:"Exit delay started",description:"Exit delay started, ready to leave the house."},pending:{name:"Entry delay started",description:"Entry delay started, the alarm will trigger soon."}}},mode:{heading:"Modalità",description:"Limita ad una specifica modalità di allarme (opzionale)"},title:{heading:"Titolo",description:"Titolo per il messaggio di notifica"},message:{heading:"Messaggio",description:"Contenuto del messaggio di notifica"},target:{heading:"Destinatario",description:"Dispositivo a cui inviare il messaggio di notifica"}},actions:{test:"Try it"}},new_action:{title:"Crea azione",description:"Questo pannello può essere usato per cambiare lo stato di un entità quando lo stato dell'allarme cambia.",fields:{name:{heading:"Nome",description:"Descrizione dell'azione"},event:{heading:"Evento",description:"Quando questa azione deve essere eseguita"},area:{heading:"Area",description:"Area for which the event applies, leave empty to select the global alarm."},mode:{heading:"Modalità",description:"Limita ad una specifica modalità di allarme (opzionale)"},entity:{heading:"Entità",description:"Entità su cui eseguire l'azione"},action:{heading:"Azione",description:"Azione che deve eseguire l'entità",turn_on:"Accendi",turn_off:"Spegni"}}}},validation_errors:{no_triggers:"Nessuno evento o modalità scelto per l'attivazione di questa azione.",empty_trigger:"Evento o modalità mancante per questa azione.",invalid_trigger:"Uno degli eventi selezionati ha un valore non valido: {trigger}",invalid_mode:"Input selezionato non valido per la modalità: {mode}",no_actions:"Nessuna azione è stata scelta per questa azione.",no_service:"Una di queste azioni ha un servizio mancante.",invalid_service:"Il nome del servizio non è valido per una delle azioni: {service}",no_service_data:"Dati del servizio non inseriti per una delle azioni.",no_entity_in_service_data:"Nessun entity_id è stata inserita in service_data di una delle azioni.",no_message_in_service_data:"Nessun messaggio è stato inserito nel service_data di una delle azioni."}}},ia={common:ea,components:aa,title:"Alarm panel",panels:ta},sa={modes_long:{armed_away:"Mode fora de casa activat",armed_home:"Mode a casa activat",armed_night:"Mode nit activat",armed_custom_bypass:"Mode personalitzat activat"},modes_short:{armed_away:"Fora",armed_home:"Casa",armed_night:"Nit",armed_custom_bypass:"Personalitzat"}},na={time_slider:{seconds:"seg",minutes:"min",infinite:"infinit",none:"cap"},editor:{ui_mode:"Canvia a UI",yaml_mode:"Canvia a YAML"}},ra={general:{title:"General",cards:{general:{description:"Aquest tauler defineix alguns paràmetres globals de l'alarma.",fields:{disarm_after_trigger:{heading:"Desactivar després del disparador",description:"Quan hagi transcorregut el temps d’activació, desactiveu l’alarma en lloc de tornar a l’estat armat."},enable_mqtt:{heading:"Activa MQTT",description:"Permet controlar el tauler d'alarma mitjançant MQTT."},enable_master:{heading:"Activa l'alarma mestra",description:"Crea una entitat per controlar totes les àrees simultàniament."}},actions:{setup_mqtt:"Configuració MQTT",setup_master:"Configuració mestra"}},modes:{title:"Modes",description:"Aquest tauler es pot utilitzar per configurar els modes d'activació de l'alarma.",fields:{mode:{armed_away:"El mode fora de casa s'utilitzarà quan totes les persones surtin de casa. Es controlen totes les portes i finestres que permeten l'accés a la casa, així com els sensors de moviment dins de la casa.",armed_home:"El mode a casa (també conegut com mode casa) s'utilitzarà quan configureu l'alarma mentre hi hagi persones a la casa. Es controlen totes les portes i finestres que permetin l'accés a la casa, però no els sensors de moviment a l'interior de la casa.",armed_night:"El mode nit s'utilitzarà quan configureu l'alarma abans d'anar a dormir. Es controlaran totes les portes i finestres que permetin l'accés a la casa i es seleccionaran els sensors de moviment (per exemple, a la planta baixa) de la casa.",armed_custom_bypass:"Un mode addicional per definir el vostre propi perímetre de seguretat.",enabled:"Activat",disabled:"Desactivat"},exit_delay:{heading:"Retard de sortida",description:"Quan activeu l'alarma, en aquest període de temps els sensors encara no activaran l'alarma."},entry_delay:{heading:"Retard d'entrada",description:"Temps de retard fins que s'activi l'alarma després que s'activi un dels sensors."},trigger_time:{heading:"Temps d'activació",description:"Temps durant el qual sonarà la sirena"}}},mqtt:{title:"Configuració MQTT",description:"Aquest tauler es pot utilitzar per configurar la interfície MQTT.",fields:{state_topic:{heading:"Tema d'estat",description:"Tema sobre el qual es publiquen les actualitzacions d'estat"},event_topic:{heading:"Tema d'esdeveniment",description:"Tema sobre el qual es publiquen els esdeveniments d'alarma"},command_topic:{heading:"Tama d'ordre",description:"Tema sobre el qual s'envien les ordres d'activació/desactivació."},require_code:{heading:"Requereix codi",description:"Requereix l'enviament d'un codi amb l'ordre."},state_payload:{heading:"Configura la càrrega útil per estat",item:"Definiu una càrrega útil per a l'estat '{state}'"},command_payload:{heading:"Configura la càrrega útil per ordre",item:"Definiu una càrrega útil per a l'ordre '{command}'"}}},areas:{title:"Àrees",description:"Les àrees es poden utilitzar per dividir el sistema d'alarma en diversos compartiments.",no_items:"Encara no hi ha àrees definides.",table:{remarks:"Observacions",summary:"Aquesta àrea conté {summary_sensors} i {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automatismes"},actions:{add:"Afegeix"}}},dialogs:{create_area:{title:"Àrea nova",fields:{copy_from:"Copia la configuració de"}},edit_area:{title:"Edita l'àrea '{area}'",name_warning:"Nota: si canvieu el nom, es canviarà l'identificador d'entitat"},remove_area:{title:"Voleu eliminar l'àrea?",description:"Confirmeu que voleu eliminar aquesta àrea? Aquesta àrea conté {sensors} sensors i {automatismes} automatismes, que també s'eliminaran."},edit_master:{title:"Configuració mestra"},disable_master:{title:"Voleu desactivar l'alarma mestra?",description:"Confirmeu que voleu eliminar l'alarma mestra? Aquesta àrea conté automatismes {automatismes}, que s'eliminaran amb aquesta acció."}}},sensors:{title:"Sensors",cards:{sensors:{description:"Sensors configurats actualment. Feu clic a una entitat per fer canvis.",no_items:"No hi ha cap sensor per mostrar",table:{arm_modes:"Modes d'armat",always_on:"(Sempre)"},filter:{label:"Filtra per àrea",no_area:"(Sense àrea)"}},add_sensors:{title:"Afegeix sensors",description:"Afegiu més sensors. Assegureu-vos que els vostres sensors tinguin un friendly_name perquè pugueu identificar-los.",no_items:"No hi ha entitats HA disponibles que es puguin configurar per a l'alarma. Assegureu-vos d'incloure entitats del tipus binary_sensor.",actions:{add_to_alarm:"afegeix a l'alarma",show_all:"Mostra-ho tot"}},editor:{title:"Edita el sensor",description:"Edita la configuració del sensor de '{entity}'.",fields:{name:{heading:"Nom",description:"Sobreescriu el friendly_name"},area:{heading:"Àrea",description:"Seleccioneu una àrea que contingui aquest sensor."},device_type:{heading:"Tipus de dispositiu",description:"Trieu un tipus de dispositiu per aplicar automàticament la configuració adequada.",choose:{door:{name:"Porta",description:"Porta, porta de garatge o altra entrada que s'utilitzi per entrar/sortir de casa."},window:{name:"Finestra",description:"Finestra o una porta que no s'utilitza per entrar a la casa, com ara un balcó."},motion:{name:"Moviment",description:"Sensor de presència o dispositiu similar que té un retard entre les activacions."},tamper:{name:"Antisabotatge",description:"Detector de retirada de la coberta del sensor, sensor de trencament de vidre, etc."},environmental:{name:"Ambiental",description:"Sensor de fum o gas, detector de fuites, etc. (no relacionat amb la protecció antirobatori)."},other:{name:"Genèric"}}},always_on:{heading:"Sempre activat",description:"El sensor sempre ha de disparar l'alarma."},modes:{heading:"Modes habilitats",description:"Modes d'alarma en què aquest sensor està actiu."},arm_on_close:{heading:"Arma després de tancar",description:"Després de la desactivació d'aquest sensor, s'omet automàticament el temps de retard de sortida restant."},immediate:{heading:"Immediat",description:"L'activació d'aquest sensor activarà l'alarma directament sense temps de retard a l'entrada."},allow_open:{heading:"Permet obrir mentre s'arma l'alarma",description:"Permeteu que aquest sensor estigui actiu poc després de configurar-lo de manera que no bloquegi l'activació de l'alarma."},auto_bypass:{heading:"Omet automàticament",description:"Excloeu aquest sensor de l'alarma si està obert mentre s'arma l'alarma."},trigger_unavailable:{heading:"Activador quan no estigui disponible",description:"Quan l'estat del sensor no estigui disponible, això activarà el sensor."}},actions:{toggle_advanced:"Configuració avançada",remove:"Elimina"},errors:{description:"Corregiu els errors següents:",no_area:"No s'ha seleccionat cap àrea",no_modes:"No s'han seleccionat modes per als quals el sensor hauria d'estar actiu"}}}},codes:{title:"Codis",cards:{codes:{description:"Canvieu la configuració del codi.",fields:{code_arm_required:{heading:"Utilitzeu un codi d'activació",description:"Requereix un codi per activar l'alarma"},code_disarm_required:{heading:"Utilitzeu un codi de desactivació",description:"Requereix un codi per desactivar l'alarma"},code_format:{heading:"Format del codi",description:"Estableix el tipus de codi per a la targeta d'alarma Lovelace.",code_format_number:"codi PIN",code_format_text:"contrasenya"}}},user_management:{title:"Gestió d'usuaris",description:"Cada usuari té el seu propi codi per activar/desactivar l'alarma.",no_items:"Encara no hi ha usuaris",table:{remarks:"Observacions",administrator:"Administrador"},actions:{new_user:"usuari nou"}},new_user:{title:"Crea un usuari nou",description:"Es poden crear usuaris per proporcionar accés al funcionament de l'alarma.",fields:{name:{heading:"Nom",description:"Nom de l'usuari."},code:{heading:"Codi",description:"Codi d'aquest usuari."},confirm_code:{heading:"Confirmeu el codi",description:"Repetiu el codi."},is_admin:{heading:"L'usuari és administrador",description:"Permetre a l'usuari fer canvis"},can_arm:{heading:"Permetre que el codi active l'alarma",description:"Entering this code activates the alarm"},can_disarm:{heading:"Permetre que el codi desactive l'alarma",description:"Entering this code deactivates the alarm"},is_override_code:{heading:"És un codi de sobreescriptura",description:"Si introduïu aquest codi, es forçarà l'estat d'activació de l'alarma"}},errors:{no_name:"No s'ha proporcionat cap nom.",no_code:"El codi ha de tenir 4 caràcters o números com a mínim.",code_mismatch:"Els codis no coincideixen."}},edit_user:{title:"Edita l'usuari",description:"Canvia la configuració de l'usuari '{name}'.",fields:{old_code:{heading:"Codi actual",description:"Codi actual, deixeu-lo en blanc per deixar-lo sense canvis."}}}}},actions:{title:"Accions",cards:{notifications:{title:"Notificacions",description:"Utilitzant aquest tauler, podeu gestionar les notificacions que s'envien quan es produeix un determinat esdeveniment d'alarma.",table:{enabled:"Activat",no_items:"Encara no s'han creat notificacions."},actions:{new_notification:"nova notificació"},filter:{label:"Filtra per àrea",no_area:"Alarma mestra"}},actions:{description:"Aquest tauler es pot utilitzar per canviar un dispositiu quan l'estat d'alarma canvia.",table:{no_items:"Encara no s'han creat accions."},actions:{new_action:"nova acció"}},new_notification:{title:"Crea una notificació",description:"Crea una nova notificació.",fields:{name:{heading:"Nom",description:"Descripció d'aquesta notificació"},event:{heading:"Esdeveniment",description:"Quan s'ha d'enviar la notificació",choose:{armed:{name:"L'alarma està activada",description:"L'alarma s'ha activat correctament"},disarmed:{name:"L'alarma està desactivada",description:"L'alarma està desactivada"},triggered:{name:"L'alarma s'activat per esdeveniment",description:"L'alarma s'activat per esdeveniment"},arm_failure:{name:"No s'ha pogut activar l'alarma",description:"L'activació de l'alarma ha fallat a causa d'un o més sensors estan oberts"},arming:{name:"S'ha iniciat el retard de sortida",description:"S'ha iniciat el retard de sortida, a punt per sortir de casa."},pending:{name:"S'ha iniciat el retard d'entrada",description:"El retard d'entrada s'ha iniciat, l'alarma s'activarà aviat."}}},mode:{heading:"Mode",description:"Limita l'acció a modes específics d'activació (opcional)"},title:{heading:"Títol",description:"Títol del missatge de notificació"},message:{heading:"Missatge",description:"Contingut del missatge de notificació"},target:{heading:"Destinatari",description:"Dispositiu al qual enviar el missatge"}},actions:{test:"Prova-ho"}},new_action:{title:"Crea una acció",description:"Aquest tauler es pot utilitzar per canviar un dispositiu quan l'estat d'alarma canvia.",fields:{name:{heading:"Nom",description:"Descripció d'aquesta acció"},event:{heading:"Esdeveniment",description:"Quan s'ha d'executar l'acció"},area:{heading:"Àrea",description:"Àrea per a la qual s'aplica l'esdeveniment, deixeu-la en blanc per seleccionar l'alarma global."},mode:{heading:"Mode",description:"Limita l'acció a modes específics d'activació (opcional)"},entity:{heading:"Entitat",description:"Entitat en què es realitzarà l'acció"},action:{heading:"Acció",description:"Acció a realitzar a l'entitat",turn_on:"Activa",turn_off:"Desactiva"}}}},validation_errors:{no_triggers:"No s'ha proporcionat cap estat ni cap esdeveniment per activar aquesta automatització.",empty_trigger:"No s'ha proporcionat estat ni esdeveniment d'un dels activadors.",invalid_trigger:"Un dels activadors té un valor no vàlid: {trigger}",invalid_mode:"S'ha proporcionat una entrada no vàlida per al mode: {mode}",no_actions:"No s'han indicat accions per aquesta automatització",no_service:"Falta un servei a una de les accions.",invalid_service:"S'ha proporcionat un nom de servei no vàlid per a una de les accions: {service}",no_service_data:"No s'han proporcionat dades de servei per a una de les accions.",no_entity_in_service_data:"No s'ha proporcionat cap entity_id a la service_data d'una de les accions.",no_message_in_service_data:"No s'ha proporcionat cap missatge a la service_data d'una de les accions."}}},oa={common:sa,components:na,title:"Tauler alarma",panels:ra},da={en:Object.freeze({__proto__:null,common:Le,components:Re,title:"Alarm panel",panels:Ve,default:Ue}),et:Object.freeze({__proto__:null,common:Ie,components:Fe,title:"Alarm panel",panels:He,default:Ye}),nl:Object.freeze({__proto__:null,common:Be,components:We,title:"Alarmpaneel",panels:Qe,default:Ge}),fr:Object.freeze({__proto__:null,common:Ke,components:Ze,title:"Gestion de L'alarme",panels:Je,default:Xe}),it:Object.freeze({__proto__:null,common:ea,components:aa,title:"Alarm panel",panels:ta,default:ia}),ca:Object.freeze({__proto__:null,common:sa,components:na,title:"Tauler alarma",panels:ra,default:oa})};function la(e,a,t="",i=""){const s=a.replace(/['"]+/g,"").replace("-","_");var n;try{n=e.split(".").reduce((e,a)=>e[a],da[s])}catch(a){n=e.split(".").reduce((e,a)=>e[a],da.en)}if(void 0===n&&(n=e.split(".").reduce((e,a)=>e[a],da.en)),""!==t&&""!==i){Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);for(let e=0;e0&&this.value<60&&(this.unit="sec"),"min"==this.unit&&(this.scaleFactor=1/60),"min"==this.unit&&(this.step=1)}render(){return L` +`;var Le,Re,Ue={modes_long:{armed_away:"Armed Away",armed_home:"Armed Home",armed_night:"Armed Night",armed_custom_bypass:"Armed Custom"},modes_short:{armed_away:"Away",armed_home:"Home",armed_night:"Night",armed_custom_bypass:"Custom"}},Fe={time_slider:{seconds:"sec",minutes:"min",infinite:"infinite",none:"none"},editor:{ui_mode:"To UI",yaml_mode:"To YAML",edit_in_yaml:"Edit in YAML"}},Ie={general:{title:"General",cards:{general:{description:"This panel defines some global settings for the alarm.",fields:{disarm_after_trigger:{heading:"Disarm after trigger",description:"After trigger time has expired, disarm the alarm instead of returning to armed state."},enable_mqtt:{heading:"Enable MQTT",description:"Allow the alarm panel to be controlled through MQTT."},enable_master:{heading:"Enable alarm master",description:"Creates an entity for controlling all areas simultaneously."}},actions:{setup_mqtt:"MQTT Configuration",setup_master:"Master Configuration"}},modes:{title:"Modes",description:"This panel can be used to set up the arm modes of the alarm.",fields:{mode:{armed_away:"Armed away will be used when all people left the house. All doors and windows allowing access to the house will be guarded, as well as motion sensors inside the house.",armed_home:"Armed home (also known as armed stay) will be used when setting the alarm while people are in the house. All doors and windows allowing access to the house will be guarded, but not motion sensors inside the house.",armed_night:"Armed night will be used when setting the alarm before going to sleep. All doors and windows allowing access to the house will be guarded, and selected motion sensors (downstairs) in the house.",armed_custom_bypass:"An extra mode for defining your own security perimeter.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Exit delay",description:"When arming the alarm, within this time period the sensors will not trigger the alarm yet."},entry_delay:{heading:"Entry delay",description:"Delay time until the alarm is triggered after one of the sensors is activated."},trigger_time:{heading:"Trigger time",description:"Time during which the siren will sound"}}},mqtt:{title:"MQTT configuration",description:"This panel can be used for configuration of the MQTT interface.",fields:{state_topic:{heading:"State topic",description:"Topic on which state updates are published"},event_topic:{heading:"Event topic",description:"Topic on which alarm events are published"},command_topic:{heading:"Command topic",description:"Topic on which arm/disarm commands are sent."},require_code:{heading:"Require code",description:"Require the code to be sent with the command."},state_payload:{heading:"Configure payload per state",item:"Define a payload for state '{state}'"},command_payload:{heading:"Configure payload per command",item:"Define a payload for command '{command}'"}}},areas:{title:"Areas",description:"Areas can be used for dividing your alarm system into multiple compartments.",no_items:"There are no areas defined yet.",table:{remarks:"Remarks",summary:"This area contains {summary_sensors} and {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automations"},actions:{add:"Add"}}},dialogs:{create_area:{title:"New area",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editing area '{area}'",name_warning:"Note: changing the name will change the entity ID"},remove_area:{title:"Remove area?",description:"Are you sure you want to remove this area? This area contains {sensors} sensors and {automations} automations, which will be removed as well."},edit_master:{title:"Master configuration"},disable_master:{title:"Disable master?",description:"Are you sure you want to remove the alarm master? This area contains {automations} automations, which will be removed with this action."}}},sensors:{title:"Sensors",cards:{sensors:{description:"Currently configured sensors. Click on an entity to make changes.",no_items:"There are no sensors to be displayed here.",table:{arm_modes:"Arm Modes",always_on:"(Always)"},filter:{label:"Filter by area",no_area:"(No area)"}},add_sensors:{title:"Add Sensors",description:"Add more sensors. Make sure that your sensors have a friendly_name, so you can identify them.",no_items:"There are no available HA entities that can be configured for the alarm. Make sure to include entities of the type binary_sensor.",actions:{add_to_alarm:"add to alarm",show_all:"Show all"}},editor:{title:"Edit Sensor",description:"Configuring the sensor settings of '{entity}'.",fields:{name:{heading:"Name",description:"Overwrite friendly name."},area:{heading:"Area",description:"Select an area which contains this sensor."},device_type:{heading:"Device Type",description:"Choose a device type to automatically apply appropriate settings.",choose:{door:{name:"Door",description:"A door, gate or other entrance that is used for entering/leaving the home."},window:{name:"Window",description:"A window, or a door not used for entering the house such as balcony."},motion:{name:"Motion",description:"Presence sensor or similar device having a delay between activations."},tamper:{name:"Tamper",description:"Detector of sensor cover removal, glass break sensor, etc."},environmental:{name:"Environmental",description:"Smoke/gas sensor, leak detector, etc. (not related to burglar protection)."},other:{name:"Generic"}}},always_on:{heading:"Always on",description:"Sensor should always trigger the alarm."},modes:{heading:"Enabled modes",description:"Alarm modes in which this sensor is active."},arm_on_close:{heading:"Arm after closing",description:"After deactivation of this sensor, the remaining exit delay will automatically be skipped."},immediate:{heading:"Immediate",description:"Activating this sensor will trigger the alarm directly instead of after entry delay."},allow_open:{heading:"Allow open while arming",description:"Allow this sensor to be active shortly after leaving such that it will not block arming."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Trigger when unavailable",description:"When the sensor state becomes 'unavailable', this will activate the sensor."}},actions:{toggle_advanced:"Advanced settings",remove:"Remove"},errors:{description:"Please correct the following errors:",no_area:"No area is selected",no_modes:"No modes are selected for which the sensor should be active"}}}},codes:{title:"Codes",cards:{codes:{description:"Change settings for the code.",fields:{code_arm_required:{heading:"Use arm code",description:"Require a code for arming the alarm"},code_disarm_required:{heading:"Use disarm code",description:"Require a code for disarming the alarm"},code_format:{heading:"Code format",description:"Sets the input type for Lovelace alarm card.",code_format_number:"pincode",code_format_text:"password"}}},user_management:{title:"User management",description:"Each user has its own code to arm/disarm the alarm.",no_items:"There are no users yet",table:{remarks:"Remarks",administrator:"Administrator"},actions:{new_user:"new user"}},new_user:{title:"Create new user",description:"Users can be created for providing access to operating the alarm.",fields:{name:{heading:"Name",description:"Name of the user."},code:{heading:"Code",description:"Code for this user."},confirm_code:{heading:"Confirm code",description:"Repeat the code."},is_admin:{heading:"User is administrator",description:"Allow user to make changes"},can_arm:{heading:"Allow code for arming",description:"Entering this code activates the alarm"},can_disarm:{heading:"Allow code for disarming",description:"Entering this code deactivates the alarm"},is_override_code:{heading:"Is override code",description:"Entering this code will arm the alarm in force"}},errors:{no_name:"No name provided.",no_code:"Code should have 4 characters/numbers minimum.",code_mismatch:"The codes don't match."}},edit_user:{title:"Edit User",description:"Change configuration for user '{name}'.",fields:{old_code:{heading:"Current code",description:"Current code, leave empty to leave unchanged."}}}}},actions:{title:"Actions",cards:{notifications:{title:"Notifications",description:"Using this panel, you can manage notifications to be sent when during a certain alarm event.",table:{enabled:"Enabled",no_items:"There are no notifications created yet."},actions:{new_notification:"new notification"},filter:{label:"Filter by area",no_area:"(No area)"}},actions:{description:"This panel can be used to switch a device when the alarm state changes.",table:{no_items:"There are no actions created yet."},actions:{new_action:"new action"}},new_notification:{title:"Configure notification",description:"Receive a notification when arming/disarming the alarm, on activation, etc.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Event",description:"When should the notification be sent",choose:{armed:{name:"Alarm is armed",description:"The alarm is succesfully armed"},disarmed:{name:"Alarm is disarmed",description:"The alarm is disarmed"},triggered:{name:"Alarm is triggered",description:"The alarm is triggered"},arm_failure:{name:"Failed to arm",description:"The arming of the alarm failed due to one or more open sensors"},arming:{name:"Exit delay started",description:"Exit delay started, ready to leave the house."},pending:{name:"Entry delay started",description:"Entry delay started, the alarm will trigger soon."}}},mode:{heading:"Mode",description:"Limit the action to specific arm modes (optional)"},title:{heading:"Title",description:"Title for the notification message"},message:{heading:"Message",description:"Content of the notification message",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Target",description:"Device to send the push message to"},name:{heading:"Name",description:"Description for this notification",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Try it"}},new_action:{title:"Configure action",description:"Switch lights or devices (such as sirens) when arming/disarming the alarm, on activation, etc.",fields:{event:{heading:"Event",description:"When should the action be executed"},area:{heading:"Area",description:"Area for which the event applies, leave empty to select the global alarm."},mode:{heading:"Mode",description:"Limit the action to specific arm modes (optional)"},entity:{heading:"Entity",description:"Entity to perform action on"},action:{heading:"Action",description:"Action to perform on the entity",turn_on:"Turn on",turn_off:"Turn off"},name:{heading:"Name",description:"Description for this action",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},Ve={common:Ue,components:Fe,title:"Alarm panel",panels:Ie},He={modes_long:{armed_away:"Valvestatud eemal",armed_home:"Valvestatud kodus",armed_night:"Valvestatud ööseks",armed_custom_bypass:"Valikuline valvestus"},modes_short:{armed_away:"Eemal",armed_home:"Kodus",armed_night:"Ööseks",armed_custom_bypass:"Valikuline"}},Ye={time_slider:{seconds:"sek",minutes:"min",infinite:"piiranguta",none:"puudub"},editor:{ui_mode:"Kasutajaliides",yaml_mode:"Koodiredaktor",edit_in_yaml:"Edit in YAML"}},Be={general:{title:"Üldsätted",cards:{general:{description:"Need seaded kehtivad kõikides valve olekutes.",fields:{disarm_after_trigger:{heading:"Häire summutamine",description:"Peale häire lõppu võta valvest maha miite ära valvesta uuesti."},enable_mqtt:{heading:"Luba MQTT juhtimine",description:"Luba nupustiku juhtimist MQTT abil."},enable_master:{heading:"Luba põhivalvestus",description:"Loob olemi mis haldab kõiki valvestamise alasid korraga."}},actions:{setup_mqtt:"MQTT seadistamine",setup_master:"Põhivalvestuse sätted"}},modes:{title:"Režiimid",description:"Selles vaates seadistatakse valvestamise režiime.",fields:{mode:{armed_away:"Täielik valvestamine kui kedagi pole kodus. Kasutusel on kõik andurid.",armed_home:"Valvestatud kodus ei kasuta liikumisandureid kuid väisuksed ja aknad on valve all.",armed_night:"Valvestatud ööseks ei kasuta määratud liikumisandureid, välisperimeeter on valve all.",armed_custom_bypass:"Valikulise valvestuse puhul saab määrata kasutatavad andurid.",enabled:"Lubatud",disabled:"Keelatud"},exit_delay:{heading:"Ooteaeg valvestamisel",description:"Viivitus enne valvestamise rakendumist."},entry_delay:{heading:"Sisenemise viivitus",description:"Viivitus sisenemisel enne häire rakendumist."},trigger_time:{heading:"Häire kestus",description:"Sireeni jne. aktiveerimise kestus."}}},mqtt:{title:"MQTT sätted",description:"MQTT parameetrite seadistamine.",fields:{state_topic:{heading:"Oleku teema (topic)",description:"Teema milles avaldatakse oleku muutused."},event_topic:{heading:"Event topic",description:"Topic on which alarm events are published"},command_topic:{heading:"Käskude teema (topic)",description:"Teema milles avaldatakse valvestamise käsud."},require_code:{heading:"Nõua PIN koodi",description:"Käskude edastamiseks on vajalik PIN kood."},state_payload:{heading:"Määra olekute toimeandmed",item:"Määra oleku '{state}' toimeandmed"},command_payload:{heading:"Määra käskude toimeandmed",item:"Määra käsu '{command}' toimeandmed"}}},areas:{title:"Alad",description:"Alasid kasutatakse elamise jagamiseks valvetsoonideks.",no_items:"Valvestamise alad on loomata.",table:{remarks:"Ala teave",summary:"See ala sisaldab {summary_sensors} ja {summary_automations}.",summary_sensors:"{number} andur(it)",summary_automations:"{number} automatiseering(ut)"},actions:{add:"Lisa"}}},dialogs:{create_area:{title:"Uus ala",fields:{copy_from:"Kopeeri sätted allikast:"}},edit_area:{title:"Ala '{area}' muutmine",name_warning:"NB! Nime muutmisel muutub ka olemi ID"},remove_area:{title:"Kas kustutada ala?",description:"Kas kustutada see ala? Ala kaasab andurid {sensors} ja automatiseeringud {automations} mis samuti eemaldatakse."},edit_master:{title:"Põhiala seaded"},disable_master:{title:"Kas keelata põhiala?",description:"Kas keelata põhiala? Ala kaasab andurid {sensors} ja automatiseeringud {automations} mis samuti eemaldatakse.."}}},sensors:{title:"Andurid",cards:{sensors:{description:"Kasutusel olevad andurid. Klõpsa olemil, et seadistada.",no_items:"Andureid pole lisatud. Alustuseks lisa mõni andur.",table:{arm_modes:"Valvestamise olek",always_on:"(alati)"},filter:{label:"Sordi ala järgi",no_area:"(Alad puuduvad)"}},add_sensors:{title:"Andurite lisamine",description:"Lisa veel andureid. Mõistlik on panna neile arusaadav nimi (friendly_name).",no_items:"Puuduvad valvestamiseks sobivad Home Assistanti olemid. Lisatavad olemid peavad olema olekuandurid (binary_sensor).",actions:{add_to_alarm:"Lisa valvesüsteemile",show_all:"Kuva kõik andurid"}},editor:{title:"Andurite sätted",description:"Muuda olemi '{entity}' sätteid.",fields:{name:{heading:"Nimi",description:"Muuda kuvatavat nime."},area:{heading:"Ala",description:"Vali ala kus see andur asub."},device_type:{heading:"Seadme tüüp",description:"Vali anduri tüüp, et automaatselt rakendada sobivad sätted.",choose:{door:{name:"Uks",description:"Uks, värav või muu piire mida kasutatakse sisenemiseks või väljumiseks."},window:{name:"Aken",description:"Aken või uks mida ei kasutata sisenemiseks nagu rõduuks."},motion:{name:"Liikumisandur",description:"Kohaloleku andurid mille rakendumiste vahel on viide."},tamper:{name:"Terviklikkus",description:"Anduri muukimine või klaasipurustusandur jms."},environmental:{name:"Ohu andurid",description:"Suitsu või gaasilekke andur, veeleke jne. (ei ole seotud sissetungimisega)."},other:{name:"Tavaandur"}}},always_on:{heading:"Alati kasutusel",description:"Andur käivitab häire igas valve olekus."},modes:{heading:"Valve olekute valik",description:"Valve olekud kus seda andurit kasutatakse."},arm_on_close:{heading:"Valvesta sulgemisel",description:"Selle anduri rakendumisel valvestatakse kohe ilma viiveta."},immediate:{heading:"Viivituseta",description:"Andur annab häire ilma viiteta."},allow_open:{heading:"Lahkumisviivitus",description:"See andur ei aktiveeru enne lahkumisviivituse lõppu."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Andurite saadavus",description:"Käivita häire kui andur muutub kättesaamatuks."}},actions:{toggle_advanced:"Täpsemad sätted",remove:"Eemalda"},errors:{description:"Palun paranda jägmised vead:",no_area:"Ala pole määratud",no_modes:"Anduri tüüp on määramata, ei tea kuida kasutada"}}}},codes:{title:"Koodid",cards:{codes:{description:"Valvestuskoodide muutmine.",fields:{code_arm_required:{heading:"Valvestamine koodiga",description:"Valvestamiseks tuleb sisestada kood"},code_disarm_required:{heading:"Valvest vabastamise kood",description:"Valvest vabastamiseks tulem sisestada kood"},code_format:{heading:"Koodi vorming",description:"Kasutajaliidese koodi tüübid.",code_format_number:"PIN kood",code_format_text:"Salasõna"}}},user_management:{title:"Kasutajate haldus",description:"Igal kasutajal on oma juhtkood.",no_items:"Kasutajaid pole määratud",table:{remarks:"Märkused",administrator:"Haldaja"},actions:{new_user:"Uus kasutaja"}},new_user:{title:"Lisa uus kasutaja",description:"Valvesüsteemi kasutaja lisamine.",fields:{name:{heading:"Nimi",description:"Kasutaja nimi."},code:{heading:"Valvestuskood",description:"Selle kasutaja kood."},confirm_code:{heading:"Koodi kinnitamine",description:"Sisesta sama kood uuesti."},is_admin:{heading:"Kasutajal on haldusõigused",description:"Kasutaja saab teha muudatusi."},can_arm:{heading:"Tohib valvestada",description:"Koodi sisestamine valvestab."},can_disarm:{heading:"Tohib valvest maha võtta",description:"Koodi sisestamine võtab valvest maha."},is_override_code:{heading:"Alistuskood",description:"Koodi sisestamine käivitab kohese häire"}},errors:{no_name:"Nimi puudub.",no_code:"Kood peab olema vhemalt 4 tärki.",code_mismatch:"Sisestatud koodid ei klapi."}},edit_user:{title:"Muuda kasutaja sätteid",description:"Muuda kasutaja '{name}' sätteid.",fields:{old_code:{heading:"Kehtiv kood",description:"Kehtiv kood, jäta tühjaks kui ei taha muuta."}}}}},actions:{title:"Toimingud",cards:{notifications:{title:"Teavitused",description:"Halda saadetavaid teavitusi",table:{enabled:"Lubatud",no_items:"Teavitusi pole veel loodud."},actions:{new_notification:"Uus teavitus"},filter:{label:"Sordi alade järgi",no_area:"(Alad puuduvad)"}},actions:{description:"Arenduses, mõeldud seadmete lülitamiseks.",table:{no_items:"Toiminguid pole veel määratud."},actions:{new_action:"Uus toiming"}},new_notification:{title:"Loo teavitus",description:"Uue teavituse loomine.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Sündmus",description:"Mille puhul teavitada",choose:{armed:{name:"Valvestatud",description:"Valvestamine oli edukas"},disarmed:{name:"Valvest maas",description:"Valve mahavõtmine õnnestus"},triggered:{name:"Häire",description:"Valvesüsteem andis häire"},arm_failure:{name:"Valvestamine nurjus",description:"Valvestamine ei õnnestunud mõne anduri oleku või vea tõttu"},arming:{name:"Valvestamise eelne viivitus algas",description:"Algas valvestamise eelviide, majast võib lahkuda."},pending:{name:"Sisenemise viide rakendus",description:"Märgati sisenemist, häire rakendub peale viidet."}}},mode:{heading:"Olek",description:"Millises valve olekus teavitada (valikuline)"},title:{heading:"Päis",description:"Teavitussõnumi päis"},message:{heading:"Sisu",description:"Teavitussõnumi tekst",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Saaja",description:"Seade millele edastada teavitus"},name:{heading:"Nimi",description:"Teavituse kirjeldus",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Try it"}},new_action:{title:"Loo toiming",description:"Seadme oleku muutmine valve oleku muutmisel.",fields:{event:{heading:"Sündmus",description:"Millisel juhul käivitada toiming"},area:{heading:"Ala",description:"Ala millele sündmus rakendub, põhiala puhul jäta tühjaks."},mode:{heading:"Olek",description:"Millises valve olekus toiming käivitada (valikuline)"},entity:{heading:"Olem",description:"Toimingu olem"},action:{heading:"Toiming",description:"Olemi toiming",turn_on:"Lülita sisse",turn_off:"Lülita välja"},name:{heading:"Nimi",description:"Toimingu kirjeldus",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},We={common:He,components:Ye,title:"Alarm panel",panels:Be},Qe={modes_long:{armed_away:"Ingeschakeld Weg",armed_home:"Ingeschakeld Thuis",armed_night:"Ingeschakeld Nacht",armed_custom_bypass:"Ingeschakeld Aangepast"},modes_short:{armed_away:"Weg",armed_home:"Thuis",armed_night:"Nacht",armed_custom_bypass:"Aangepast"}},Ge={time_slider:{seconds:"sec",minutes:"min",infinite:"oneindig",none:"geen"},editor:{ui_mode:"Naar UI",yaml_mode:"Naar YAML",edit_in_yaml:"In YAML bewerken"}},Ke={general:{title:"Algemeen",cards:{general:{description:"Dit paneel definieert enkele instellingen die van toepassing zijn op alle inschakelmodi.",fields:{disarm_after_trigger:{heading:"Uitschakelen na activatie",description:"Nadat de triggertijd is verstreken, schakelt u het alarm uit in plaats van terug te keren naar de ingeschakelde toestand."},enable_mqtt:{heading:"MQTT inschakelen",description:"Allow the alarm panel to be controlled through MQTT."},enable_master:{heading:"Master alarm inschakelen",description:"Creëert een entiteit om alle gebieden tegelijkertijd te besturen."}},actions:{setup_mqtt:"MQTT Configuratie",setup_master:"Master configuratie"}},modes:{title:"Modi",description:"Dit paneel kan worden gebruikt om de inschakelmodi van het alarm in te stellen.",fields:{mode:{armed_away:"Ingeschakeld weg wordt gebruikt als alle mensen het huis hebben verlaten. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, evenals bewegingssensoren in het huis.",armed_home:"Ingeschakeld thuis (ook wel ingeschakeld thuisblijven genoemd) wordt gebruikt bij het instellen van het alarm terwijl er mensen in huis zijn. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, maar bewegingssensoren in het huis worden niet gebruikt.",armed_night:"Ingeschakeld nacht wordt gebruikt bij het instellen van het alarm voordat u gaat slapen. Alle deuren en ramen die toegang geven tot het huis worden bewaakt, en geselecteerde bewegingssensoren (beneden) in het huis.",armed_custom_bypass:"Een extra modus om uw eigen beveiligingsperimeter te definiëren.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Vertrek vertraging",description:"Bij het inschakelen van het alarm zullen de sensoren binnen deze tijdsperiode het alarm nog niet activeren."},entry_delay:{heading:"Binnenkomst vertraging",description:"Vertragingstijd totdat het alarm afgaat nadat een van de sensoren is geactiveerd."},trigger_time:{heading:"Activeer tijd",description:"Tijd waarin de sirene af gaat."}}},mqtt:{title:"MQTT configuratie",description:"Dit paneel kan worden gebruikt voor configuratie van de MQTT-interface.",fields:{state_topic:{heading:"Toestand topic",description:"Topic waarop statusupdates worden gepubliceerd"},event_topic:{heading:"Gebeurtenis topic",description:"Topic waarop gebeurtenissen worden gepubliceerd"},command_topic:{heading:"Commando topic",description:"Topic waarop commando's voor in- / uitschakelen worden verzonden."},require_code:{heading:"Vereis code",description:"Vereis dat de code wordt verzonden met de opdracht."},state_payload:{heading:"Configureer de payload per toestand",item:"Definieer een payload voor toestand '{state}'"},command_payload:{heading:"Configureer een payload per commando",item:"Definieer een payload voor commando '{command}'"}}},areas:{title:"Gebieden",description:"Gebieden kunnen worden gebruikt om uw alarmsysteem in meerdere compartimenten op te delen.",no_items:"Er zijn nog geen gebieden gedefinieerd.",table:{remarks:"Opmerkingen",summary:"Dit gebied bevat {summary_sensors} en {summary_automations}.",summary_sensors:"{number} sensoren",summary_automations:"{number} automatiseringen"},actions:{add:"Toevoegen"}}},dialogs:{create_area:{title:"Nieuw gebied",fields:{copy_from:"Kopieer instellingen van"}},edit_area:{title:"Bewerken van gebied '{area}'",name_warning:"Opmerking: als u de naam wijzigt, wordt de entiteits-ID gewijzigd"},remove_area:{title:"Gebied verwijderen?",description:"Weet u zeker dat u dit gebied wilt verwijderen? Dit gebied bevat {sensors} sensoren en {automations} automatiseringen, die ook zullen worden verwijderd."},edit_master:{title:"Master configuratie"},disable_master:{title:"Master uitschakelen?",description:"Weet u zeker dat u het master alarm wilt verwijderen? Dit gebied bevat {automations} automatiseringen, die met deze actie worden verwijderd."}}},sensors:{title:"Sensoren",cards:{sensors:{description:"Momenteel geconfigureerde sensoren. Klik op een entiteit om wijzigingen aan te brengen.",no_items:"Er zijn nog geen sensoren aan het alarm toegevoegd. Zorg ervoor dat u ze eerst toevoegt.",table:{arm_modes:"Inschakelmodi",always_on:"(Altijd)"},filter:{label:"Filter op gebied",no_area:"(Geen gebied)"}},add_sensors:{title:"Voeg sensoren toe",description:"Voeg meer sensoren toe. Zorg ervoor dat uw sensoren een friendly_name hebben, zodat u ze kunt identificeren.",no_items:"Er zijn geen beschikbare HA-entiteiten die voor het alarm kunnen worden geconfigureerd. Zorg ervoor dat u entiteiten van het type binary_sensor opneemt.",actions:{add_to_alarm:"Voeg aan alarm toe",show_all:"Toon alle"}},editor:{title:"Wijzig Sensor",description:"Configureren van de sensorinstellingen van '{entity}'.",fields:{name:{heading:"Naam",description:"Overschrijf vriendelijke naam."},area:{heading:"Gebied",description:"Selecteer een gebied dat deze sensor bevat."},device_type:{heading:"Apparaat Type",description:"Kies een apparaattype om automatisch de juiste instellingen toe te passen.",choose:{door:{name:"Deur",description:"Een deur, poort of andere ingang die wordt gebruikt voor het betreden/verlaten van de woning."},window:{name:"Raam",description:"Een raam of een deur die niet wordt gebruikt om het huis binnen te komen, zoals een balkon."},motion:{name:"Beweging",description:"Aanwezigheidssensor of soortgelijk apparaat met een vertraging tussen activeringen."},tamper:{name:"Sabotage",description:"Detector van verwijdering van sensorkap, glasbreuksensor, enz."},environmental:{name:"Omgeving",description:"Rook/gassensor, lekdetector, etc. (niet gerelateerd aan inbraakbeveiliging)."},other:{name:"Algemeen"}}},always_on:{heading:"Altijd aan",description:"Sensor should always trigger the alarm."},modes:{heading:"Ingeschakelde modi",description:"Alarmmodi waarin deze sensor actief is."},arm_on_close:{heading:"Inschakelen na sluiten",description:"Na deactivering van deze sensor wordt de resterende vertrek vertraging automatisch overgeslagen."},immediate:{heading:"Onmiddelijk",description:"Als deze sensor wordt geactiveerd, wordt het alarm direct geactiveerd in plaats van na de binnenkomst vertraging."},allow_open:{heading:"Sta open toe tijdens het inschakelen",description:"Sta toe dat deze sensor kort na het verlaten actief is, zodat hij het inschakelen niet blokkeert."},auto_bypass:{heading:"Automatisch uitsluiten",description:"Elimineer de sensor als deze actief is tijdens het inschakelen van het alarm."},trigger_unavailable:{heading:"Activeren indien niet beschikbaar",description:"Wanneer de sensorstatus 'niet beschikbaar' wordt, wordt de sensor geactiveerd."}},actions:{toggle_advanced:"Geavanceerde instellingen",remove:"Verwijder"},errors:{description:"Corrigeer de volgende fouten:",no_area:"Er is geen gebied geselecteerd",no_modes:"Er zijn geen modi geselecteerd waarvoor de sensor actief zou moeten zijn"}}}},codes:{title:"Codes",cards:{codes:{description:"Wijzig de instellingen voor de code.",fields:{code_arm_required:{heading:"Gebruik inschakel code",description:"Vereist een code voor het inschakelen van het alarm"},code_disarm_required:{heading:"Gebruik uitschakelcode",description:"Vereist een code om het alarm uit te schakelen"},code_format:{heading:"Code opmaak",description:"Stelt het invoertype in voor de Lovelace alarmkaart.",code_format_number:"pincode",code_format_text:"wachtwoord"}}},user_management:{title:"Gebruikersbeheer",description:"Elke gebruiker heeft zijn eigen code om het alarm in/uit te schakelen.",no_items:"Er zijn nog geen gebruikers",table:{remarks:"Opmerkingen",administrator:"Beheerder"},actions:{new_user:"nieuwe gebruiker"}},new_user:{title:"Maak een nieuwe gebruiker aan",description:"Gebruikers kunnen worden aangemaakt om toegang te verlenen tot het bedienen van het alarm.",fields:{name:{heading:"Naam",description:"Naam van de gebruiker."},code:{heading:"Code",description:"Code voor deze gebruiker."},confirm_code:{heading:"Bevestig de code",description:"Herhaal de code."},is_admin:{heading:"Gebruiker is beheerder",description:"Sta de gebruiker toe om wijzigingen aan te brengen"},can_arm:{heading:"Code toestaan voor inschakeling",description:"Door deze code in te voeren, wordt het alarm geactiveerd"},can_disarm:{heading:"Code toestaan voor uitschakelen",description:"Door deze code in te voeren, wordt het alarm gedeactiveerd"},is_override_code:{heading:"Is een forceer code",description:"Als u deze code invoert, wordt het alarm geforceerd geactiveerd"}},errors:{no_name:"Geen naam opgegeven.",no_code:"Code moet minimaal 4 tekens/cijfers bevatten.",code_mismatch:"De codes komen niet overeen."}},edit_user:{title:"Wijzig Gebruiker",description:"Wijzig de configuratie voor gebruiker '{name}'.",fields:{old_code:{heading:"Huidige code",description:"Huidige code, laat leeg om ongewijzigd te laten."}}}}},actions:{title:"Acties",cards:{notifications:{title:"Meldingen",description:"Met dit paneel kunt u meldingen beheren die moeten worden verzonden tijdens een bepaalde alarmgebeurtenis",table:{enabled:"Ingeschakeld",no_items:"Er zijn nog geen notificaties aangemaakt."},actions:{new_notification:"nieuwe melding"},filter:{label:"Filter op gebied",no_area:"(Geen gebied)"}},actions:{description:"Dit paneel kan worden gebruikt om een apparaat te schakelen wanneer de status van het alarm veranderd.",table:{no_items:"Er zijn nog geen acties gemaakt."},actions:{new_action:"nieuwe actie"}},new_notification:{title:"Notificatie instellen",description:"Ontvang een notificatie wanneer het alarm wordt in- of uitgeschakeld, wordt geactiveerd etc.",trigger:"Conditie",action:"Taak",options:"Opties",fields:{event:{heading:"Gebeurtenis",description:"Wanneer moet de notificatie worden verzonden",choose:{armed:{name:"Alarm is ingeschakeld",description:"Het alarm is succesvol ingeschakeld"},disarmed:{name:"Alarm is uitgeschakeld",description:"Het alarm is uitgeschakeld"},triggered:{name:"Alarm is afgegaan",description:"Het alarm gaat af"},arm_failure:{name:"Kan niet inschakelen",description:"Het inschakelen van het alarm is mislukt vanwege een of meerdere blokkerende sensoren"},arming:{name:"Vertrek",description:"Vertrekvertraging ingegaan, tijd om het huis te verlaten."},pending:{name:"Binnenkomst",description:"Binnenkomstvertraging ingegaan, het alarm dient te worden uitgeschakeld."}}},mode:{heading:"Modi",description:"Beperk de actie tot specifieke inschakel modi."},title:{heading:"Titel",description:"Titel voor de notificatie"},message:{heading:"Bericht",description:"Tekst voor de notificatie",insert_wildcard:"Wildcard invoegen",placeholders:{armed:"Het alarm is ingeschakeld op {{arm_mode}}",disarmed:"Het alarm is nu uit",triggered:"Het alarm is geactiveerd! Oorzaak: {{open_sensors}}.",arm_failure:"Het alarm kon niet worden ingeschakeld. Oorzaak: {{open_sensors}}.",arming:"Het alarm wordt ingeschakeld, verlaat het huis.",pending:"Het alarm moet nu worden uitgeschakeld, anders wordt deze geactiveerd."}},target:{heading:"Doel",description:"Apparaat om het push-bericht naar te sturen"},name:{heading:"Naam",description:"Beschrijving voor deze notificatie",placeholders:{armed:"Stuur notificatie naar {target} bij inschakelen",disarmed:"Stuur notificatie naar {target} bij uitschakelen",triggered:"Stuur notificatie naar {target} bij alarm",arm_failure:"Stuur notificatie naar {target} bij fout",arming:"Stuur notificatie naar {target} bij vertrek",pending:"Stuur notificatie naar {target} bij binnenkomst"}},delete:{heading:"Automatisering verwijderen",description:"Verwijder deze automatisering permanent"}},actions:{test:"Testen"}},new_action:{title:"Actie instellen",description:"Schakel verlichting of apparaatuur (bijv. sirene) wanneer het alarm wordt in- of uitgeschakeld, wordt geactiveerd etc.",fields:{event:{heading:"Gebeurtenis",description:"Wanneer moet de actie worden uitgevoerd"},area:{heading:"Gebied",description:"Het gebied waarop de gebeurtenis van toepassing is, laat leeg om het algemene alarm te selecteren."},mode:{heading:"Mode",description:"Beperk de actie tot specifieke inschakel modi (optioneel)"},entity:{heading:"Entiteit",description:"Entiteit om actie op uit te voeren"},action:{heading:"Actie",description:"Actie die op de entiteit moet worden uitgevoerd",turn_on:"Zet aan",turn_off:"Zet uit"},name:{heading:"Naam",description:"Beschrijving voor deze actie",placeholders:{armed:"Schakel {target} naar {state} bij inschakelen",disarmed:"Schakel {target} naar {state} bij uitschakelen",triggered:"Schakel {target} naar {state} bij alarm",arm_failure:"Schakel {target} naar {state} bij fout",arming:"Schakel {target} naar {state} bij vertrek",pending:"Schakel {target} naar {state} bij binnenkomst"}}}}}}},Ze={common:Qe,components:Ge,title:"Alarmpaneel",panels:Ke},Je={modes_long:{armed_away:"Activée en mode absence",armed_home:"Activée en mode présence",armed_night:"Activée en mode nuit",armed_custom_bypass:"Activée en mode personnalisé"},modes_short:{armed_away:"Absence",armed_home:"Présence",armed_night:"Nuit",armed_custom_bypass:"Personnalisé"}},Xe={time_slider:{seconds:"sec",minutes:"min",infinite:"infini",none:"Aucune"},editor:{ui_mode:"Afficher l'éditeur visuel",yaml_mode:"Afficher l'éditeur de code",edit_in_yaml:"Edit in YAML"}},ea={general:{title:"Généraux",cards:{general:{description:"Ce panneau définit les paramètres globaux de l'alarme.",fields:{disarm_after_trigger:{heading:"Désactivation après déclenchement",description:"Lors que le temps de fonctionnement de la sirène est écoulé, désactive l'alarme au lieu de la réactiver."},enable_mqtt:{heading:"Utilisation avec MQTT",description:"Permet au panneau d'alarme d'être contrôlé via MQTT."},enable_master:{heading:"Activation de commande centralisée",description:"Créer une entité pour piloter toutes les zone en même temps."}},actions:{setup_mqtt:"Configuration MQTT",setup_master:"Configuration pricipale"}},modes:{title:"Modes",description:"Ce panneau définit le mode de gestion pour chaque type d'activation.",fields:{mode:{armed_away:"Ce mode sera utilisé lorsque toutes les personnes auront quitté la maison. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées, les détecteurs de mouvement à l'intérieur de la maison seront opérationnels.",armed_home:"Ce mode sera utilisée lorsque des personnes sont dans la maison. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées (périmétrie), les détecteurs de mouvement à l'intérieur de la maison seront inopérants.",armed_night:"Ce mode sera utilisée lors du réglage de l'alarme avant de s'endormir. Toutes les portes et fenêtres permettant l'accès à la maison seront surveillées, et les capteurs de mouvement sélectionnés (ex : rez de chaussée) dans la maison seront opérationnels.",armed_custom_bypass:"Ce mode supplémentaire permet de définir votre propre périmètre de sécurité.",enabled:"Actif",disabled:"Inactif"},exit_delay:{heading:"Délai pour sortir",description:"Lors de l'activation, pendant cette période, les capteurs ne déclencheront pas l'alarme."},entry_delay:{heading:"Délai pour entrer",description:"Temps d'attente avant que l'alarme ne se déclenche après détection d'un des capteurs."},trigger_time:{heading:"Temps de fonctionnement",description:"Temps de fonctionnement de la sirène"}}},mqtt:{title:"Configuration MQTT",description:"Ce panneau peut être utilisé pour la configuration de l'interface MQTT.",fields:{state_topic:{heading:"Etat de données",description:"Donnée sur laquelle les mises à jour d'état sont publiées"},event_topic:{heading:"Evènement de données",description:"Donnée sur laquelle les évènements d'état sont publiés"},command_topic:{heading:"Commande de donnée",description:"Donnée sur laquelle les commandes d'armement / désarmement sont envoyées."},require_code:{heading:"Code requis",description:"Exige que le code soit envoyé avec la commande."},state_payload:{heading:"Configurer une valeur par état",item:"Définir une valeur par état '{state}'"},command_payload:{heading:"Configurer une valeur par commande",item:"Définir une valeur par commande '{command}'"}}},areas:{title:"Zones",description:"Les zones peuvent être utilisées pour diviser votre système d'alarme en plusieurs secteurs.",no_items:"Il n'y a pas encore de zones définies.",table:{remarks:"Remarque",summary:"Cette zone contient des {summary_sensors} et {summary_automations}.",summary_sensors:"{number} capteurs",summary_automations:"{number} automations"},actions:{add:"Ajouter"}}},dialogs:{create_area:{title:"Nouvelle zone",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editer la zone '{area}'",name_warning:"Note: Changer le nom changera l'entity ID"},remove_area:{title:"Suppression de zone?",description:"Etes vous sur de vouloir supprimer cette zone? Cette zone contient {sensors} des capteurs et {automations} automatisations, qui seront également supprimés."},edit_master:{title:"Configuration principale"},disable_master:{title:"Désactiver la configuration principale?",description:"Etes vous sur de vouloir supprimer la configuration principale? Cette zone contient {automations} automatisations, qui seront également supprimées."}}},sensors:{title:"Capteurs",cards:{sensors:{description:"Capteurs actuellement configurés. Cliquez sur une entité pour apporter des modifications.",no_items:"Il n'y a pas encore de capteur ajouté à l'alarme. Assurez-vous de les ajouter d'abord.",table:{arm_modes:"Type d'activation",always_on:"(Toujours)"},filter:{label:"Filtrer par zone",no_area:"(Aucune zone)"}},add_sensors:{title:"Ajouter un capteur",description:"Ajoutez plus de capteurs. Assurez-vous que vos capteurs ont un nom personnalisé afin de pouvoir les identifier.",no_items:"Aucune entité HA disponible ne peut être configurée pour l'alarme. Assurez-vous d'inclure les entités de type binary_sensor.",actions:{add_to_alarm:"Ajouter à l'alarme",show_all:"Tout montrer"}},editor:{title:"Editer un capteur",description:"Configurer les paramètres du capteur '{entity}'.",fields:{name:{heading:"Nom",description:"Remplacer le nom personnalisé (friendly name)."},area:{heading:"Zone",description:"Selectionner une zone contenant ce capteur."},device_type:{heading:"Type de détection",description:"Choisissez un type de détection pour appliquer automatiquement les paramètres appropriés.",choose:{door:{name:"Porte",description:"Une porte, un portail ou une autre entrée utilisée pour entrer / sortir de la maison."},window:{name:"Fenêtre",description:"Une fenêtre, ou une porte non utilisée pour entrer dans la maison comme un balcon."},motion:{name:"Mouvement",description:"Capteur de présence ou appareil similaire présentant un délai entre les activations."},tamper:{name:"Effraction",description:"Détection d'arrachage du capteur, capteur de bris de verre, etc.."},environmental:{name:"Détecteur Environmental",description:"Détecteur de fumée / gaz, détecteur de fuite, etc. (non lié à la protection anti-effraction)."},other:{name:"Générique"}}},always_on:{heading:"Toujours en service",description:"Le capteur doit toujours déclencher l'alarme."},modes:{heading:"Mode possible",description:"Modes d'alarme dans lesquels ce capteur est actif."},arm_on_close:{heading:"Activer après fermeture",description:"Après la désactivation de ce capteur, le délai de sortie restant sera automatiquement ignoré."},immediate:{heading:"Immédiat",description:"L'activation de ce capteur déclenchera l'alarme immédiatement plutôt qu'après le délai d'entrée."},allow_open:{heading:"Autoriser l'ouverture lors de l'activation",description:"Permet à ce capteur d'être actif, peu de temps après votre départ afin qu'il ne bloque pas l'armement."},auto_bypass:{heading:"Bypass automatique",description:"Exclut ce capteur de l'alarme s'il est ouvert lors de l'armement."},trigger_unavailable:{heading:"Déclenchement lorsqu'il n'est pas disponible",description:"Lorsque l'état du capteur devient `` indisponible '', cela activera le capteur."}},actions:{toggle_advanced:"Paramètres avancées",remove:"Supprimer"},errors:{description:"Veuillez corriger les erreurs suivantes:",no_area:"Aucune zone n'est sélectionnée",no_modes:"Aucun mode sélectionné pour lequel le capteur doit être actif"}}}},codes:{title:"Codes",cards:{codes:{description:"Gestion des paramètres des codes.",fields:{code_arm_required:{heading:"Utiliser un code pour l'activation",description:"Code requis pour l'activation de l'alarme"},code_disarm_required:{heading:"Utiliser un code pour la désactivation",description:"Code requis pour la désactivation de l'alarme"},code_format:{heading:"Format du code",description:"Définit le type d'entrée pour la carte d'alarme Lovelace.",code_format_number:"pincode",code_format_text:"password"}}},user_management:{title:"Gestion des utilisateurs",description:"Chaque utilisateur a son propre code pour activer / désactiver l'alarme.",no_items:"Il n'y a aucun utilisateur de défini",table:{remarks:"Remarque",administrator:"Administrateur"},actions:{new_user:"Nouvel utilisateur"}},new_user:{title:"Créer un nouvel utilisateur",description:"Des utilisateurs peuvent être créés pour donner accès au fonctionnement de l'alarme.",fields:{name:{heading:"Nom",description:"Nom de l'utilisateur."},code:{heading:"Code",description:"Code personnel de l'utilisateur."},confirm_code:{heading:"Confirmation du code",description:"Répèter le code."},is_admin:{heading:"L'utilisateur est aussi administrateur",description:"Autorise l'utilisateur à effectuer des changements."},can_arm:{heading:"Demande de code pour l'activation",description:"Entrer ce code pour activer l'alarme."},can_disarm:{heading:"Demande de code pour désactivation",description:"Entrer ce code pour désactiver l'alarme."},is_override_code:{heading:"Code de sécurité",description:"La saisie de ce code forcera l'activation l'alarme."}},errors:{no_name:"Aucun nom saisi.",no_code:"Le code doit contenir 4 caractères/chiffres minimum.",code_mismatch:"Les codes sont différents."}},edit_user:{title:"Editer l'utilisateur",description:"Changer la configuration pour l'utilisateur '{name}'.",fields:{old_code:{heading:"Code utilisé",description:"Code actuel, laissez vide pour ne rien changer."}}}}},actions:{title:"Actions",cards:{notifications:{title:"Notifications",description:"À l'aide de ce panneau, vous pouvez gérer les notifications à envoyer lors d'un évènement d'alarme",table:{enabled:"Active",no_items:"Il n'y a aucune notification de créée."},actions:{new_notification:"Nouvelle notification"},filter:{label:"Filtrer par zone",no_area:"(Aucune zone)"}},actions:{description:"Ce panneau est utilisé pour changer d'état les appareils de votre choix.",table:{no_items:"Il n'y a aucune action de créer."},actions:{new_action:"Nouvelle action"}},new_notification:{title:"Créer une notification",description:"Créer une nouvelle notification.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Evènement",description:"Détermine quand la notification doit être envoyée",choose:{armed:{name:"Alarme activée ",description:"l'alarme s'est correctement activée"},disarmed:{name:"Alarme désactivée",description:"L'alarme est désactivée"},triggered:{name:"Alarme déclenchée",description:"L'alarme est déclenchée"},arm_failure:{name:"Armement impossible",description:"L'armement est impossible dû à un ou plusieurs capteurs"},arming:{name:"Délai de sortie activé",description:"Le délai de sortie est activé, vous devez quitter la maison."},pending:{name:"Délai d'entrée activé",description:"Le délai d'entrée est activé, l'alarme va se déclencher."}}},mode:{heading:"Mode",description:"Limite la notification à un mode spécifique (optionnel)"},title:{heading:"Titre",description:"Titre du message de la notification"},message:{heading:"Message",description:"Contenu du message de la notification",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Cible",description:"Appareil recevant le message"},name:{heading:"Nom",description:"Description de la notification",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Essai"}},new_action:{title:"Créer une action",description:"Ce panneau peut être utilisé pour commuter un appareil lorsque l'état de l'alarme change.",fields:{event:{heading:"Evènement",description:"Détermine quand l'action doit être exécutée"},area:{heading:"Zone",description:"Zone pour laquelle l'évènement s'applique, laissez vide pour sélectionner l'alarme globale."},mode:{heading:"Mode",description:"Limite l'action à un mode spécifique (optionnel)"},entity:{heading:"Entité",description:"Entité sur laquelle effectuer une action"},action:{heading:"Action",description:"Action à exécuter sur l'entité",turn_on:"Mettre à on",turn_off:"Mettre à off"},name:{heading:"Nom",description:"Description de l'action",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},aa={common:Je,components:Xe,title:"Gestion de L'alarme",panels:ea},ta={modes_long:{armed_away:"Modalità 'fuori casa' attiva",armed_home:"Modalità 'in casa' attiva",armed_night:"Modalità 'notte' attiva",armed_custom_bypass:"Modalità 'personalizzato' attiva"},modes_short:{armed_away:"Fuori casa",armed_home:"In casa",armed_night:"Notte",armed_custom_bypass:"Personalizzato"}},ia={time_slider:{seconds:"sec",minutes:"min",infinite:"infinito",none:"niente"},editor:{ui_mode:"Passa a UI",yaml_mode:"Passa a YAML",edit_in_yaml:"Edit in YAML"}},sa={general:{title:"Generali",cards:{general:{description:"Questo pannello definisce alcune impostazioni da applicare alle modalità di allarme.",fields:{disarm_after_trigger:{heading:"Disattiva allarme dopo l'attivazione",description:"Dopo che il tempo di attivazione è scaduto, disattivare l'allarme invece di tornare allo stato inserito."},enable_mqtt:{heading:"Abilita MQTT",description:"Permetti al pannello allarme di essere controllato attraverso MQTT."},enable_master:{heading:"Enable alarm master",description:"Creates an entity for controlling all areas simultaneously."}},actions:{setup_mqtt:"Configurazione MQTT",setup_master:"Master Configuration"}},modes:{title:"Modes",description:"This panel can be used to set up the arm modes of the alarm.",fields:{mode:{armed_away:"Modalità 'fuori casa': da utilizzare quando tutte le persone lasciano la casa. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi, così come i sensori di movimento all'interno della casa.",armed_home:"Modalità 'in casa': da utilizzare quando si attiva l'allarme mentre le persone sono in casa. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi, ma non i sensori di movimento all'interno della casa.",armed_night:"Modalità 'notte': da utilizzare quando si imposta la sveglia prima di andare a dormire. Tutti i sensori di porte e finestre che consentono l'accesso alla casa saranno attivi e sensori di movimento selezionati (ad esempio al piano di sotto) nella casa.",armed_custom_bypass:"Modalità 'personalizzato': da utilizzare per definire una modalità di allarme specifica per le esigenze dell'utilizzatore.",enabled:"Enabled",disabled:"Disabled"},exit_delay:{heading:"Tempo di preattivazione",description:"Quando si attiva l'allarme, entro questo periodo di tempo i sensori non attiveranno ancora l'allarme."},entry_delay:{heading:"Ritardo di attivazione",description:"Tempo di ritardo fino allo scatto dell'allarme dopo l'attivazione di uno dei sensori."},trigger_time:{heading:"Tempo di attivazione",description:"Tempo durante il quale suonerà la sirena"}}},mqtt:{title:"Configurazione MQTT",description:"Questo pannello può essere usato per le impostazioni MQTT.",fields:{state_topic:{heading:"Topic di stato",description:"Topic su cui vengono pubblicati gli aggiornamenti di stato"},event_topic:{heading:"Event topic",description:"Topic on which alarm events are published"},command_topic:{heading:"Topic di comando",description:"Topic su cui vengono inviati i comandi di inserimento / disinserimento."},require_code:{heading:"Richiedi Codice",description:"Richiedi il codice da inviare con il comando."},state_payload:{heading:"Configura payload per stato",item:"Definisci un payload per lo stato '{state}'"},command_payload:{heading:"Configura payload per comando",item:"Definisci un payload per il comando '{command}'"}}},areas:{title:"Areas",description:"Areas can be used for dividing your alarm system into multiple compartments.",no_items:"There are no areas defined yet.",table:{remarks:"Remarks",summary:"This area contains {summary_sensors} and {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automations"},actions:{add:"Add"}}},dialogs:{create_area:{title:"New area",fields:{copy_from:"Copy settings from"}},edit_area:{title:"Editing area '{area}'",name_warning:"Note: changing the name will change the entity ID"},remove_area:{title:"Remove area?",description:"Are you sure you want to remove this area? This area contains {sensors} sensors and {automations} automations, which will be removed as well."},edit_master:{title:"Master configuration"},disable_master:{title:"Disable master?",description:"Are you sure you want to remove the alarm master? This area contains {automations} automations, which will be removed with this action."}}},sensors:{title:"Sensori",cards:{sensors:{description:"Sensori attualmente configurati. Clicca sull'entità per modificare.",no_items:"Non ci sono ancora sensori aggiunti a questo allarme. Assicurati di aggiungerli prima.",table:{arm_modes:"Modalità di attivazione",always_on:"(Sempre)"},filter:{label:"Filter by area",no_area:"(No area)"}},add_sensors:{title:"Aggiungi Sensori",description:"Aggiungi più sensori. Assicurati che i sensori abbiano un friendly_name (nome amichevole), in modo da identificarli più facilmente.",no_items:"Non ci sono entità disponibili che possono essere configurate con l'allarme. Assicurati di includere entità del tipo binary_sensor (sensore binario).",actions:{add_to_alarm:"aggiungi all'allarme",show_all:"Mostra tutti"}},editor:{title:"Modifica Sensore",description:"Configura le impostazioni del sensore '{entity}'.",fields:{name:{heading:"Nome",description:"Sovrascrivi friendly name."},area:{heading:"Area",description:"Select an area which contains this sensor."},device_type:{heading:"Device Type",description:"Choose a device type to automatically apply appropriate settings.",choose:{door:{name:"Door",description:"A door, gate or other entrance that is used for entering/leaving the home."},window:{name:"Window",description:"A window, or a door not used for entering the house such as balcony."},motion:{name:"Motion",description:"Presence sensor or similar device having a delay between activations."},tamper:{name:"Tamper",description:"Detector of sensor cover removal, glass break sensor, etc."},environmental:{name:"Environmental",description:"Smoke/gas sensor, leak detector, etc. (not related to burglar protection)."},other:{name:"Generic"}}},always_on:{heading:"Sempre attivo",description:"Il sensore attiverà sempre l'allarme."},modes:{heading:"Modalità attive",description:"Modalità di allarme in cui il sensore risulta collegato."},arm_on_close:{heading:"Arm after closing",description:"After deactivation of this sensor, the remaining exit delay will automatically be skipped."},immediate:{heading:"Immediato",description:"Il sensore si attiva saltando il ritardo."},allow_open:{heading:"Permetti apertura",description:"Consentire a questo sensore di rimanere attivo poco dopo essere usciti."},auto_bypass:{heading:"Bypass automatically",description:"Exclude this sensor from the alarm if it is open while arming."},trigger_unavailable:{heading:"Fai scattare l'allarme quando non disponibile",description:"L'allarme scatterà quando lo stato del sensore diverrà 'non disponibile'."}},actions:{toggle_advanced:"Advanced settings",remove:"Remove"},errors:{description:"Please correct the following errors:",no_area:"No area is selected",no_modes:"No modes are selected for which the sensor should be active"}}}},codes:{title:"Codici",cards:{codes:{description:"Modifica le impostazioni dei codici.",fields:{code_arm_required:{heading:"Usa codice d'attivazione",description:"Richiedi un codice per attivare l'allarme"},code_disarm_required:{heading:"Usa codice di disattivazione",description:"Richiedi un codice per disattivare l'allarme"},code_format:{heading:"Formato del codice",description:"Imposta il tipo di codice da digitare nella card di Lovelace.",code_format_number:"codice numerico",code_format_text:"password"}}},user_management:{title:"Gestione utente",description:"Ogni utente ha il suo codice per attivare/disattivare l'allarme.",no_items:"Non è stato creato nessun utente per ora",table:{remarks:"Ruolo",administrator:"Amministratore"},actions:{new_user:"nuovo utente"}},new_user:{title:"Crea nuovo utente",description:"Gli utenti potranno operare con l'allarme.",fields:{name:{heading:"Nome",description:"Nome dell'utente."},code:{heading:"Codice operativo",description:"Codice che utilizzerà quest'utente."},confirm_code:{heading:"Ripeti codice operativo",description:"Ripeti il codice operativo scelto."},is_admin:{heading:"L'utente è un amministratore",description:"Ciò consente al utente di effettuare modifiche al sistema di allarme"},can_arm:{heading:"Utilizza codice per attivare l'allarme",description:"Utilizza codice per attivare l'allarme"},can_disarm:{heading:"Utilizza codice per disattivare l'allarme",description:"Utilizza codice per disattivare l'allarme"},is_override_code:{heading:"E' un codice di forzatura",description:"Inserendo questo codice forzerai lo stato di attivazione dell'allarme"}},errors:{no_name:"Non hai inserito il nome.",no_code:"Il codice deve avere almeno 4 numeri o caratteri.",code_mismatch:"Il codice scelto non combacia, verifica il codice inserito."}},edit_user:{title:"Modifica Utente",description:"Cambia impostazioni per l'utente '{name}'.",fields:{old_code:{heading:"Modifica Codice",description:"Codice attuale, lascia vuoto per non modificare."}}}}},actions:{title:"Azioni",cards:{notifications:{title:"Notifiche",description:"Con questo pannello puoi gestire le notifiche da inviare quanto accade un determinato evento",table:{enabled:"Abilitato",no_items:"Non è stata creata nessuna notifica per ora."},actions:{new_notification:"nuova notifica"},filter:{label:"Filter by area",no_area:"(No area)"}},actions:{description:"Questo pannello è in fase di sviluppo. Sarà usato per cambiare lo stato di una o più entità.",table:{no_items:"Non è stata creata nessuna azione per ora."},actions:{new_action:"nuova azione"}},new_notification:{title:"Crea notifica",description:"Crea una nuova notifica.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Evento",description:"Quando questa notifica deve essere inviata",choose:{armed:{name:"Alarm is armed",description:"The alarm is succesfully armed"},disarmed:{name:"Alarm is disarmed",description:"The alarm is disarmed"},triggered:{name:"Alarm is triggered",description:"The alarm is triggered"},arm_failure:{name:"Failed to arm",description:"The arming of the alarm failed due to one or more open sensors"},arming:{name:"Exit delay started",description:"Exit delay started, ready to leave the house."},pending:{name:"Entry delay started",description:"Entry delay started, the alarm will trigger soon."}}},mode:{heading:"Modalità",description:"Limita ad una specifica modalità di allarme (opzionale)"},title:{heading:"Titolo",description:"Titolo per il messaggio di notifica"},message:{heading:"Messaggio",description:"Contenuto del messaggio di notifica",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Destinatario",description:"Dispositivo a cui inviare il messaggio di notifica"},name:{heading:"Nome",description:"Descrizione della notifica",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Try it"}},new_action:{title:"Crea azione",description:"Questo pannello può essere usato per cambiare lo stato di un entità quando lo stato dell'allarme cambia.",fields:{event:{heading:"Evento",description:"Quando questa azione deve essere eseguita"},area:{heading:"Area",description:"Area for which the event applies, leave empty to select the global alarm."},mode:{heading:"Modalità",description:"Limita ad una specifica modalità di allarme (opzionale)"},entity:{heading:"Entità",description:"Entità su cui eseguire l'azione"},action:{heading:"Azione",description:"Azione che deve eseguire l'entità",turn_on:"Accendi",turn_off:"Spegni"},name:{heading:"Nome",description:"Descrizione dell'azione",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},na={common:ta,components:ia,title:"Alarm panel",panels:sa},ra={modes_long:{armed_away:"Mode fora de casa activat",armed_home:"Mode a casa activat",armed_night:"Mode nit activat",armed_custom_bypass:"Mode personalitzat activat"},modes_short:{armed_away:"Fora",armed_home:"Casa",armed_night:"Nit",armed_custom_bypass:"Personalitzat"}},oa={time_slider:{seconds:"seg",minutes:"min",infinite:"infinit",none:"cap"},editor:{ui_mode:"Canvia a UI",yaml_mode:"Canvia a YAML",edit_in_yaml:"Edit in YAML"}},da={general:{title:"General",cards:{general:{description:"Aquest tauler defineix alguns paràmetres globals de l'alarma.",fields:{disarm_after_trigger:{heading:"Desactivar després del disparador",description:"Quan hagi transcorregut el temps d’activació, desactiveu l’alarma en lloc de tornar a l’estat armat."},enable_mqtt:{heading:"Activa MQTT",description:"Permet controlar el tauler d'alarma mitjançant MQTT."},enable_master:{heading:"Activa l'alarma mestra",description:"Crea una entitat per controlar totes les àrees simultàniament."}},actions:{setup_mqtt:"Configuració MQTT",setup_master:"Configuració mestra"}},modes:{title:"Modes",description:"Aquest tauler es pot utilitzar per configurar els modes d'activació de l'alarma.",fields:{mode:{armed_away:"El mode fora de casa s'utilitzarà quan totes les persones surtin de casa. Es controlen totes les portes i finestres que permeten l'accés a la casa, així com els sensors de moviment dins de la casa.",armed_home:"El mode a casa (també conegut com mode casa) s'utilitzarà quan configureu l'alarma mentre hi hagi persones a la casa. Es controlen totes les portes i finestres que permetin l'accés a la casa, però no els sensors de moviment a l'interior de la casa.",armed_night:"El mode nit s'utilitzarà quan configureu l'alarma abans d'anar a dormir. Es controlaran totes les portes i finestres que permetin l'accés a la casa i es seleccionaran els sensors de moviment (per exemple, a la planta baixa) de la casa.",armed_custom_bypass:"Un mode addicional per definir el vostre propi perímetre de seguretat.",enabled:"Activat",disabled:"Desactivat"},exit_delay:{heading:"Retard de sortida",description:"Quan activeu l'alarma, en aquest període de temps els sensors encara no activaran l'alarma."},entry_delay:{heading:"Retard d'entrada",description:"Temps de retard fins que s'activi l'alarma després que s'activi un dels sensors."},trigger_time:{heading:"Temps d'activació",description:"Temps durant el qual sonarà la sirena"}}},mqtt:{title:"Configuració MQTT",description:"Aquest tauler es pot utilitzar per configurar la interfície MQTT.",fields:{state_topic:{heading:"Tema d'estat",description:"Tema sobre el qual es publiquen les actualitzacions d'estat"},event_topic:{heading:"Tema d'esdeveniment",description:"Tema sobre el qual es publiquen els esdeveniments d'alarma"},command_topic:{heading:"Tama d'ordre",description:"Tema sobre el qual s'envien les ordres d'activació/desactivació."},require_code:{heading:"Requereix codi",description:"Requereix l'enviament d'un codi amb l'ordre."},state_payload:{heading:"Configura la càrrega útil per estat",item:"Definiu una càrrega útil per a l'estat '{state}'"},command_payload:{heading:"Configura la càrrega útil per ordre",item:"Definiu una càrrega útil per a l'ordre '{command}'"}}},areas:{title:"Àrees",description:"Les àrees es poden utilitzar per dividir el sistema d'alarma en diversos compartiments.",no_items:"Encara no hi ha àrees definides.",table:{remarks:"Observacions",summary:"Aquesta àrea conté {summary_sensors} i {summary_automations}.",summary_sensors:"{number} sensors",summary_automations:"{number} automatismes"},actions:{add:"Afegeix"}}},dialogs:{create_area:{title:"Àrea nova",fields:{copy_from:"Copia la configuració de"}},edit_area:{title:"Edita l'àrea '{area}'",name_warning:"Nota: si canvieu el nom, es canviarà l'identificador d'entitat"},remove_area:{title:"Voleu eliminar l'àrea?",description:"Confirmeu que voleu eliminar aquesta àrea? Aquesta àrea conté {sensors} sensors i {automatismes} automatismes, que també s'eliminaran."},edit_master:{title:"Configuració mestra"},disable_master:{title:"Voleu desactivar l'alarma mestra?",description:"Confirmeu que voleu eliminar l'alarma mestra? Aquesta àrea conté automatismes {automatismes}, que s'eliminaran amb aquesta acció."}}},sensors:{title:"Sensors",cards:{sensors:{description:"Sensors configurats actualment. Feu clic a una entitat per fer canvis.",no_items:"No hi ha cap sensor per mostrar",table:{arm_modes:"Modes d'armat",always_on:"(Sempre)"},filter:{label:"Filtra per àrea",no_area:"(Sense àrea)"}},add_sensors:{title:"Afegeix sensors",description:"Afegiu més sensors. Assegureu-vos que els vostres sensors tinguin un friendly_name perquè pugueu identificar-los.",no_items:"No hi ha entitats HA disponibles que es puguin configurar per a l'alarma. Assegureu-vos d'incloure entitats del tipus binary_sensor.",actions:{add_to_alarm:"afegeix a l'alarma",show_all:"Mostra-ho tot"}},editor:{title:"Edita el sensor",description:"Edita la configuració del sensor de '{entity}'.",fields:{name:{heading:"Nom",description:"Sobreescriu el friendly_name"},area:{heading:"Àrea",description:"Seleccioneu una àrea que contingui aquest sensor."},device_type:{heading:"Tipus de dispositiu",description:"Trieu un tipus de dispositiu per aplicar automàticament la configuració adequada.",choose:{door:{name:"Porta",description:"Porta, porta de garatge o altra entrada que s'utilitzi per entrar/sortir de casa."},window:{name:"Finestra",description:"Finestra o una porta que no s'utilitza per entrar a la casa, com ara un balcó."},motion:{name:"Moviment",description:"Sensor de presència o dispositiu similar que té un retard entre les activacions."},tamper:{name:"Antisabotatge",description:"Detector de retirada de la coberta del sensor, sensor de trencament de vidre, etc."},environmental:{name:"Ambiental",description:"Sensor de fum o gas, detector de fuites, etc. (no relacionat amb la protecció antirobatori)."},other:{name:"Genèric"}}},always_on:{heading:"Sempre activat",description:"El sensor sempre ha de disparar l'alarma."},modes:{heading:"Modes habilitats",description:"Modes d'alarma en què aquest sensor està actiu."},arm_on_close:{heading:"Arma després de tancar",description:"Després de la desactivació d'aquest sensor, s'omet automàticament el temps de retard de sortida restant."},immediate:{heading:"Immediat",description:"L'activació d'aquest sensor activarà l'alarma directament sense temps de retard a l'entrada."},allow_open:{heading:"Permet obrir mentre s'arma l'alarma",description:"Permeteu que aquest sensor estigui actiu poc després de configurar-lo de manera que no bloquegi l'activació de l'alarma."},auto_bypass:{heading:"Omet automàticament",description:"Excloeu aquest sensor de l'alarma si està obert mentre s'arma l'alarma."},trigger_unavailable:{heading:"Activador quan no estigui disponible",description:"Quan l'estat del sensor no estigui disponible, això activarà el sensor."}},actions:{toggle_advanced:"Configuració avançada",remove:"Elimina"},errors:{description:"Corregiu els errors següents:",no_area:"No s'ha seleccionat cap àrea",no_modes:"No s'han seleccionat modes per als quals el sensor hauria d'estar actiu"}}}},codes:{title:"Codis",cards:{codes:{description:"Canvieu la configuració del codi.",fields:{code_arm_required:{heading:"Utilitzeu un codi d'activació",description:"Requereix un codi per activar l'alarma"},code_disarm_required:{heading:"Utilitzeu un codi de desactivació",description:"Requereix un codi per desactivar l'alarma"},code_format:{heading:"Format del codi",description:"Estableix el tipus de codi per a la targeta d'alarma Lovelace.",code_format_number:"codi PIN",code_format_text:"contrasenya"}}},user_management:{title:"Gestió d'usuaris",description:"Cada usuari té el seu propi codi per activar/desactivar l'alarma.",no_items:"Encara no hi ha usuaris",table:{remarks:"Observacions",administrator:"Administrador"},actions:{new_user:"usuari nou"}},new_user:{title:"Crea un usuari nou",description:"Es poden crear usuaris per proporcionar accés al funcionament de l'alarma.",fields:{name:{heading:"Nom",description:"Nom de l'usuari."},code:{heading:"Codi",description:"Codi d'aquest usuari."},confirm_code:{heading:"Confirmeu el codi",description:"Repetiu el codi."},is_admin:{heading:"L'usuari és administrador",description:"Permetre a l'usuari fer canvis"},can_arm:{heading:"Permetre que el codi active l'alarma",description:"Entering this code activates the alarm"},can_disarm:{heading:"Permetre que el codi desactive l'alarma",description:"Entering this code deactivates the alarm"},is_override_code:{heading:"És un codi de sobreescriptura",description:"Si introduïu aquest codi, es forçarà l'estat d'activació de l'alarma"}},errors:{no_name:"No s'ha proporcionat cap nom.",no_code:"El codi ha de tenir 4 caràcters o números com a mínim.",code_mismatch:"Els codis no coincideixen."}},edit_user:{title:"Edita l'usuari",description:"Canvia la configuració de l'usuari '{name}'.",fields:{old_code:{heading:"Codi actual",description:"Codi actual, deixeu-lo en blanc per deixar-lo sense canvis."}}}}},actions:{title:"Accions",cards:{notifications:{title:"Notificacions",description:"Utilitzant aquest tauler, podeu gestionar les notificacions que s'envien quan es produeix un determinat esdeveniment d'alarma.",table:{enabled:"Activat",no_items:"Encara no s'han creat notificacions."},actions:{new_notification:"nova notificació"},filter:{label:"Filtra per àrea",no_area:"(Sense àrea)"}},actions:{description:"Aquest tauler es pot utilitzar per canviar un dispositiu quan l'estat d'alarma canvia.",table:{no_items:"Encara no s'han creat accions."},actions:{new_action:"nova acció"}},new_notification:{title:"Crea una notificació",description:"Crea una nova notificació.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Esdeveniment",description:"Quan s'ha d'enviar la notificació",choose:{armed:{name:"L'alarma està activada",description:"L'alarma s'ha activat correctament"},disarmed:{name:"L'alarma està desactivada",description:"L'alarma està desactivada"},triggered:{name:"L'alarma s'activat per esdeveniment",description:"L'alarma s'activat per esdeveniment"},arm_failure:{name:"No s'ha pogut activar l'alarma",description:"L'activació de l'alarma ha fallat a causa d'un o més sensors estan oberts"},arming:{name:"S'ha iniciat el retard de sortida",description:"S'ha iniciat el retard de sortida, a punt per sortir de casa."},pending:{name:"S'ha iniciat el retard d'entrada",description:"El retard d'entrada s'ha iniciat, l'alarma s'activarà aviat."}}},mode:{heading:"Mode",description:"Limita l'acció a modes específics d'activació (opcional)"},title:{heading:"Títol",description:"Títol del missatge de notificació"},message:{heading:"Missatge",description:"Contingut del missatge de notificació",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Destinatari",description:"Dispositiu al qual enviar el missatge"},name:{heading:"Nom",description:"Descripció d'aquesta notificació",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Prova-ho"}},new_action:{title:"Crea una acció",description:"Aquest tauler es pot utilitzar per canviar un dispositiu quan l'estat d'alarma canvia.",fields:{event:{heading:"Esdeveniment",description:"Quan s'ha d'executar l'acció"},area:{heading:"Àrea",description:"Àrea per a la qual s'aplica l'esdeveniment, deixeu-la en blanc per seleccionar l'alarma global."},mode:{heading:"Mode",description:"Limita l'acció a modes específics d'activació (opcional)"},entity:{heading:"Entitat",description:"Entitat en què es realitzarà l'acció"},action:{heading:"Acció",description:"Acció a realitzar a l'entitat",turn_on:"Activa",turn_off:"Desactiva"},name:{heading:"Nom",description:"Descripció d'aquesta acció",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},la={common:ra,components:oa,title:"Tauler alarma",panels:da},ca={modes_long:{armed_away:"Armado ausente",armed_home:"Armado en casa",armed_night:"Armado nocturno",armed_custom_bypass:"Armado personalizado"},modes_short:{armed_away:"Ausente",armed_home:"En casa",armed_night:"Nocturno",armed_custom_bypass:"Personalizado"}},ha={time_slider:{seconds:"seg",minutes:"min",infinite:"infinito",none:"ninguno"},editor:{ui_mode:"Editar en la UI",yaml_mode:"Editar en YAML",edit_in_yaml:"Edit in YAML"}},ma={general:{title:"General",cards:{general:{description:"Este panel define algunos ajustes globales para la alarma.",fields:{disarm_after_trigger:{heading:"Desarmar después de disparar",description:"Una vez transcurrido el tiempo de activación, desactivar la alarma en lugar de volver al estado de armada."},enable_mqtt:{heading:"Habilitar MQTT",description:"Permitir que el panel de alarma se controle a través de MQTT."},enable_master:{heading:"Habilitar alarma maestra",description:"Crea una entidad para controlar todas las áreas simultáneamente."}},actions:{setup_mqtt:"Configuración MQTT",setup_master:"Configuración maestra"}},modes:{title:"Modos",description:"Este panel se puede utilizar para configurar los modos de armado de la alarma.",fields:{mode:{armed_away:"Armado ausente se utilizará cuando todas las personas salgan de la casa. Todas las puertas y ventanas que permitan el acceso a la casa estarán vigiladas, así como los sensores de movimiento dentro de la casa.",armed_home:"Armado en casa (también conocido como estancia armada) se utilizará cuando se active la alarma mientras haya personas en la casa. Todas las puertas y ventanas que permitan el acceso a la casa estarán protegidas, pero no los sensores de movimiento dentro de la casa.",armed_night:"Armado nocturno se usará al configurar la alarma antes de irse a dormir. Todas las puertas y ventanas que permitan el acceso a la casa estarán resguardadas y se seleccionarán sensores de movimiento en la casa.",armed_custom_bypass:"Un modo adicional para definir su propio perímetro de seguridad.",enabled:"Habilitar",disabled:"Deshabilitar"},exit_delay:{heading:"Retardo de salida",description:"Al armar la alarma, dentro de este período de tiempo, los sensores aún no dispararán la alarma."},entry_delay:{heading:"Retardo de entrada",description:"Tiempo de retardo hasta que se activa la alarma después de que se active alguno de los sensores."},trigger_time:{heading:"Tiempo de activación",description:"Tiempo durante el cual sonará la sirena."}}},mqtt:{title:"Configuración MQTT",description:"Este panel se puede utilizar para configurar la interfaz MQTT.",fields:{state_topic:{heading:"Tema del estado",description:"Tema sobre el que se publican las actualizaciones de estado."},event_topic:{heading:"Tema del evento",description:"Tema sobre el que se publican los eventos de alarma."},command_topic:{heading:"Tema del comando",description:"Tema sobre el que se envían los comandos de armado / desarmado."},require_code:{heading:"Requerir código",description:"Requiere que el código se envíe con el comando."},state_payload:{heading:"Configurar la carga útil por estado",item:"Defina una carga útil para el estado '{state}'"},command_payload:{heading:"Configurar la carga útil por comando",item:"Defina una carga útil para el comando '{command}'"}}},areas:{title:"Áreas",description:"Las áreas se pueden utilizar para dividir su sistema de alarma en varios compartimentos.",no_items:"Aún no hay áreas definidas.",table:{remarks:"Comentarios",summary:"Esta área contiene {summary_sensors} y {summary_automations}.",summary_sensors:"{number} sensores",summary_automations:"{number} automatizaciones"},actions:{add:"Agregar"}}},dialogs:{create_area:{title:"Nueva área",fields:{copy_from:"Copiar la configuración de"}},edit_area:{title:"Editando área '{area}'",name_warning:"Nota: cambiar el nombre cambiará el ID de la entidad."},remove_area:{title:"¿Eliminar área?",description:"¿Está seguro de que desea eliminar esta área? Esta área contiene {sensors} sensores y {automations} automatizaciones que también se eliminarán."},edit_master:{title:"Configuración maestra"},disable_master:{title:"¿Deshabilitar maestro?",description:"¿Está seguro de que desea eliminar la alarma maestra? Esta área contiene {sensors} sensores y {automations} automatizaciones que también se eliminarán."}}},sensors:{title:"Sensores",cards:{sensors:{description:"Sensores configurados actualmente. Haga clic en una entidad para realizar cambios.",no_items:"No hay sensores para mostrar aquí.",table:{arm_modes:"Modos de armado",always_on:"(Siempre)"},filter:{label:"Filtrar por área",no_area:"(Sin área)"}},add_sensors:{title:"Agregar sensores",description:"Agrega más sensores. Asegúrate de que tus sensores tengan un nombre amigable, para que puedas identificarlos.",no_items:"No hay entidades HA disponibles que se puedan configurar para la alarma. Asegúrese de incluir entidades del tipo sensor binario.",actions:{add_to_alarm:"agregar a la alarma",show_all:"Mostrar todo"}},editor:{title:"Editar sensor",description:"Configurando los ajustes del sensor de '{entity}'.",fields:{name:{heading:"Nombre",description:"Sobrescribir nombre descriptivo."},area:{heading:"Área",description:"Seleccione un área que contenga este sensor."},device_type:{heading:"Tipo de dispositivo",description:"Elija un tipo de dispositivo para aplicar automáticamente la configuración adecuada.",choose:{door:{name:"Puerta",description:"Una puerta, portón u otra entrada que se utilice para entrar / salir de la casa."},window:{name:"Ventana",description:"Una ventana o una puerta que no se use para entrar a la casa, como un balcón."},motion:{name:"Movimiento",description:"Sensor de presencia o dispositivo similar que tiene un retardo entre activaciones."},tamper:{name:"Sabotaje",description:"Detector de extracción de la cubierta del sensor, sensor de rotura de vidrio, etc."},environmental:{name:"Medioambiental",description:"Sensor de humo / gas, detector de fugas, etc. (no relacionado con la protección antirrobo)."},other:{name:"Genérico"}}},always_on:{heading:"Siempre encendido",description:"El sensor siempre debe activar la alarma."},modes:{heading:"Modos habilitados",description:"Modos de alarma en los que este sensor está activo."},arm_on_close:{heading:"Armar después de cerrar",description:"Después de la desactivación de este sensor, el retardo de salida restante se saltará automáticamente."},immediate:{heading:"Inmediato",description:"La activación de este sensor activará la alarma directamente en lugar de después del retardo de entrada."},allow_open:{heading:"Permitir abrir mientras se arma",description:"Permita que este sensor se active poco después de salir de manera que no bloquee el armado."},auto_bypass:{heading:"Omitir automáticamente",description:"Excluya este sensor de la alarma si está abierto mientras se arma."},trigger_unavailable:{heading:"Activar cuando no esté disponible",description:"Cuando el estado del sensor se vuelve 'no disponible', esto activará el sensor."}},actions:{toggle_advanced:"Configuración avanzada",remove:"Eliminar"},errors:{description:"Por favor, corrija los siguientes errores:",no_area:"No se ha seleccionado ninguna área.",no_modes:"No se han seleccionados modos para los que el sensor deba estar activo."}}}},codes:{title:"Códigos",cards:{codes:{description:"Cambiar la configuración del código.",fields:{code_arm_required:{heading:"Usar código de armado",description:"Requiere un código para armar la alarma."},code_disarm_required:{heading:"Usar código de desarmado",description:"Requiere un código para desarmar la alarma."},code_format:{heading:"Formato del código",description:"Establece el tipo de entrada para la tarjeta de la alarma.",code_format_number:"código PIN",code_format_text:"contraseña"}}},user_management:{title:"Gestión de usuarios",description:"Cada usuario tiene su propio código para armar / desarmar la alarma.",no_items:"Aún no hay usuarios",table:{remarks:"Comentarios",administrator:"Administrador"},actions:{new_user:"nuevo usuario"}},new_user:{title:"Crear nuevo usuario",description:"Se pueden crear usuarios para proporcionar acceso a la operación de la alarma.",fields:{name:{heading:"Nombre",description:"Nombre del usuario."},code:{heading:"Código",description:"Código para este usuario."},confirm_code:{heading:"Confirmar código",description:"Repite el código."},is_admin:{heading:"El usuario es administrador",description:"Permitir al usuario realizar cambios."},can_arm:{heading:"Permitir código para armar",description:"Al ingresar este código se activa la alarma."},can_disarm:{heading:"Permitir código para desarmar",description:"Al ingresar este código se desactiva la alarma."},is_override_code:{heading:"Es un código de anulación",description:"Al ingresar este código se forzará el armado de la alarma."}},errors:{no_name:"No se proporcionó ningún nombre.",no_code:"El código debe tener 4 caracteres / números como mínimo.",code_mismatch:"Los códigos no coinciden."}},edit_user:{title:"Editar usuario",description:"Cambiar la configuración del usuario '{name}'.",fields:{old_code:{heading:"Código actual",description:"Código actual, déjelo en blanco para no modificarlo."}}}}},actions:{title:"Acciones",cards:{notifications:{title:"Notificaciones",description:"Usando este panel, puede administrar las notificaciones que se enviarán durante un evento de alarma determinado.",table:{enabled:"Habilitado",no_items:"Aún no se han creado notificaciones."},actions:{new_notification:"nueva notificación"},filter:{label:"Filtrar por área",no_area:"(Sin área)"}},actions:{description:"Este panel se puede utilizar para cambiar un dispositivo cuando cambia el estado de alarma.",table:{no_items:"Aún no se han creado acciones."},actions:{new_action:"nueva acción"}},new_notification:{title:"Crear notificación",description:"Crear una nueva notificación.",trigger:"Condition",action:"Task",options:"Options",fields:{event:{heading:"Evento",description:"Cuándo debe enviarse la notificación.",choose:{armed:{name:"La alarma está armada",description:"La alarma está correctamente armada."},disarmed:{name:"La alarma está desarmada",description:"La alarma está desarmada."},triggered:{name:"Se ha disparado la alarma",description:"La alarma se ha disparado."},arm_failure:{name:"No se pudo armar",description:"El armado de la alarma falló debido a uno o más sensores abiertos."},arming:{name:"Se ha iniciado el retardo de salida",description:"Se ha iniciado el retardo de salida, listo para salir de la casa."},pending:{name:"Se ha iniciado el retardo de entrada",description:"Se ha iniciado el retardo de entrada, la alarma se disparará pronto."}}},mode:{heading:"Modo",description:"Limita la acción a modos de armado específicos (opcional)."},title:{heading:"Título",description:"Título del mensaje de notificación."},message:{heading:"Mensaje",description:"Contenido del mensaje de notificación.",insert_wildcard:"Insert wildcard",placeholders:{armed:"The alarm is set to {{arm_mode}}",disarmed:"The alarm is now OFF",triggered:"The alarm is triggered! Cause: {{open_sensors}}.",arm_failure:"The alarm could not be armed right now, due to: {{open_sensors}}.",arming:"The alarm will be armed soon, please leave the house.",pending:"The alarm is about to trigger, disarm it quickly!"}},target:{heading:"Objetivo",description:"Dispositivo al que enviar el mensaje push."},name:{heading:"Nombre",description:"Descripción de esta notificación.",placeholders:{armed:"Notify {target} upon arming",disarmed:"Notify {target} upon disarming",triggered:"Notify {target} when triggered",arm_failure:"Notify {target} on failure",arming:"Notify {target} when leaving",pending:"Notify {target} when arriving"}},delete:{heading:"Delete automation",description:"Permanently remove this automation"}},actions:{test:"Pruébelo"}},new_action:{title:"Crear acción",description:"Este panel se puede utilizar para cambiar un dispositivo cuando cambia el estado de la alarma.",fields:{event:{heading:"Evento",description:"¿Cuándo debe ejecutarse la acción?"},area:{heading:"Área",description:"Área para la que se aplica el evento, déjelo en blanco para seleccionar la alarma global."},mode:{heading:"Modo",description:"Limita la acción a modos de armado específicos (opcional)"},entity:{heading:"Entidad",description:"Entidad sobre la que realizar la acción."},action:{heading:"Acción",description:"Acción a realizar en la entidad.",turn_on:"Activar",turn_off:"Desactivar"},name:{heading:"Nombre",description:"Descripción de esta acción.",placeholders:{armed:"Set {entity} to {state} upon arming",disarmed:"Set {entity} to {state} upon disarming",triggered:"Set {entity} to {state} when triggered",arm_failure:"Set {entity} to {state} on failure",arming:"Set {entity} to {state} when leaving",pending:"Set {entity} to {state} when arriving"}}}}}}},ua={common:ca,components:ha,title:"Panel de alarma",panels:ma},pa={en:Object.freeze({__proto__:null,common:Ue,components:Fe,title:"Alarm panel",panels:Ie,default:Ve}),et:Object.freeze({__proto__:null,common:He,components:Ye,title:"Alarm panel",panels:Be,default:We}),nl:Object.freeze({__proto__:null,common:Qe,components:Ge,title:"Alarmpaneel",panels:Ke,default:Ze}),fr:Object.freeze({__proto__:null,common:Je,components:Xe,title:"Gestion de L'alarme",panels:ea,default:aa}),it:Object.freeze({__proto__:null,common:ta,components:ia,title:"Alarm panel",panels:sa,default:na}),ca:Object.freeze({__proto__:null,common:ra,components:oa,title:"Tauler alarma",panels:da,default:la}),es:Object.freeze({__proto__:null,common:ca,components:ha,title:"Panel de alarma",panels:ma,default:ua})};function ga(e,a,t="",i=""){const s=a.replace(/['"]+/g,"").replace("-","_");var n;try{n=e.split(".").reduce((e,a)=>e[a],pa[s])}catch(a){n=e.split(".").reduce((e,a)=>e[a],pa.en)}if(void 0===n&&(n=e.split(".").reduce((e,a)=>e[a],pa.en)),""!==t&&""!==i){Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);for(let e=0;ee.callWS({type:"alarmo/config"}),_a=e=>e.callWS({type:"alarmo/sensors"}),fa=e=>e.callWS({type:"alarmo/users"}),ba=e=>e.callWS({type:"alarmo/automations"}),wa=(e,a)=>e.callApi("POST","alarmo/config",a),ya=(e,a)=>e.callApi("POST","alarmo/sensors",a),$a=(e,a)=>e.callApi("POST","alarmo/users",a),ka=(e,a)=>e.callApi("POST","alarmo/automations",a),Aa=(e,a)=>e.callApi("POST","alarmo/automations",{automation_id:a,remove:!0}),xa=e=>e.callWS({type:"alarmo/areas"}),Sa=(e,a)=>e.callApi("POST","alarmo/area",a);var ja,Ca,Oa,Ta,Ma,qa;function Ea(e){return function(e){if(!e)return Oe;if(e.attributes.icon)return e.attributes.icon;var a=je(e.entity_id);return a in ze?ze[a](e):qe(a,e.state)}(e)}function Na(e){return(e=e.replace("_"," ")).charAt(0).toUpperCase()+e.slice(1)}function za(e){return e?e.attributes&&e.attributes.friendly_name?e.attributes.friendly_name:String(e.entity_id.split(".").pop()):"(unrecognized entity)"}function Da(e){let a=[];return e.forEach(e=>{a.find(a=>"object"==typeof e?function(...e){return e.every(a=>JSON.stringify(a)===JSON.stringify(e[0]))}(a,e):a===e)||a.push(e)}),a}function Pa(e,a){return e?Object.entries(e).filter(([e])=>a.includes(e)).reduce((e,[a,t])=>Object.assign(e,{[a]:t}),{}):{}}!function(e){e.ArmedAway="hass:car-traction-control",e.ArmedHome="hass:home-outline",e.ArmedNight="hass:weather-night",e.ArmedCustom="hass:star-outline"}(ja||(ja={})),function(e){e.STATE_ALARM_DISARMED="disarmed",e.STATE_ALARM_ARMED_HOME="armed_home",e.STATE_ALARM_ARMED_AWAY="armed_away",e.STATE_ALARM_ARMED_NIGHT="armed_night",e.STATE_ALARM_ARMED_CUSTOM_BYPASS="armed_custom_bypass",e.STATE_ALARM_PENDING="pending",e.STATE_ALARM_ARMING="arming",e.STATE_ALARM_DISARMING="disarming",e.STATE_ALARM_TRIGGERED="triggered"}(Ca||(Ca={})),function(e){e.COMMAND_ALARM_DISARM="disarm",e.COMMAND_ALARM_ARM_HOME="arm_home",e.COMMAND_ALARM_ARM_AWAY="arm_away",e.COMMAND_ALARM_ARM_NIGHT="arm_night",e.COMMAND_ALARM_ARM_CUSTOM_BYPASS="arm_custom_bypass"}(Oa||(Oa={})),function(e){e.Door="door",e.Window="window",e.Motion="motion",e.Tamper="tamper",e.Environmental="environmental",e.Other="other"}(Ta||(Ta={})),function(e){e.Door="hass:door-closed",e.Window="hass:window-closed",e.Motion="hass:motion-sensor",e.Tamper="hass:vibrate",e.Environmental="hass:fire",e.Other="hass:contactless-payment-circle-outline"}(Ma||(Ma={})),function(e){e.Notification="notification",e.Action="action"}(qa||(qa={}));const La=(e,...a)=>{const t={};let i;for(i in e)a.includes(i)||(t[i]=e[i]);return t};function Ra(e){return null!=e}function Ua(e,a){if(null===e||null===a)return e===a;const t=Object.keys(e),i=Object.keys(a);if(t.length!==i.length)return!1;for(const i of t)if("object"==typeof e[i]&&"object"==typeof a[i]){if(!Ua(e[i],a[i]))return!1}else if(e[i]!==a[i])return!1;return!0}function Fa(e,a){const t=e.target;Te(t,"show-dialog",{dialogTag:"error-dialog",dialogImport:()=>Promise.resolve().then((function(){return mt})),dialogParams:{error:a}})}function Ia(e,a){Fa(a,L` + Something went wrong!
+ ${e.body.message?L` + ${e.body.message}

+ `:""} + ${e.error}

+ Please report the bug. + `)}const Va=(e,a)=>{if(!e)return!1;switch(e){case Ca.STATE_ALARM_ARMED_AWAY:return a[Le.ArmedAway].enabled;case Ca.STATE_ALARM_ARMED_HOME:return a[Le.ArmedHome].enabled;case Ca.STATE_ALARM_ARMED_NIGHT:return a[Le.ArmedNight].enabled;case Ca.STATE_ALARM_ARMED_CUSTOM_BYPASS:return a[Le.ArmedCustom].enabled;default:return!0}};function Ha(e,a){return Object.entries(a).forEach(([a,t])=>{e=a in e&&"object"==typeof e[a]&&null!==e[a]?Object.assign(Object.assign({},e),{[a]:Ha(e[a],t)}):Object.assign(Object.assign({},e),{[a]:t})}),e}const Ya=e=>{class t 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 a([Z({attribute:!1})],t.prototype,"hass",void 0),t};let Ba=class extends re{constructor(){super(...arguments),this.min=0,this.max=100,this.step=10,this.value=0,this.scaleFactor=1,this.unit="",this.disabled=!1}firstUpdated(){this.value>0&&this.value<60&&(this.unit="sec"),"min"==this.unit&&(this.scaleFactor=1/60),"min"==this.unit&&(this.step=1)}render(){return L`
@@ -345,7 +352,7 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${this.getValue()}
- `}getValue(){const e=Number(Math.round(this.value*this.scaleFactor));return!e&&this.zeroValue?this.zeroValue:`${e} ${this.getUnit()}`}getUnit(){switch(this.unit){case"sec":return la("components.time_slider.seconds",this.hass.language);case"min":return la("components.time_slider.minutes",this.hass.language);default:return""}}getSlider(){return L` + `}getValue(){const e=Number(Math.round(this.value*this.scaleFactor));return!e&&this.zeroValue?this.zeroValue:`${e} ${this.getUnit()}`}getUnit(){switch(this.unit){case"sec":return ga("components.time_slider.seconds",this.hass.language);case"min":return ga("components.time_slider.minutes",this.hass.language);default:return""}}getSlider(){return L` a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ?disabled=${this.disabled} @change=${this.updateValue} > - `}updateValue(e){const a=Number(e.target.value);this.value=Math.round(a/this.scaleFactor)}toggleUnit(){this.unit="min"==this.unit?"sec":"min",this.scaleFactor="min"==this.unit?1/60:1,this.step="min"==this.unit?1:10}};ca.styles=se` + `}updateValue(e){const a=Number(e.target.value);this.value=Math.round(a/this.scaleFactor)}toggleUnit(){this.unit="min"==this.unit?"sec":"min",this.scaleFactor="min"==this.unit?1/60:1,this.step="min"==this.unit?1:10}};Ba.styles=se` :host { display: flex; flex-direction: column; @@ -399,20 +406,14 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) .disabled { color: var(--disabled-text-color); } - `,a([Z({type:Number})],ca.prototype,"min",void 0),a([Z({type:Number})],ca.prototype,"max",void 0),a([Z({type:Number})],ca.prototype,"step",void 0),a([Z({type:Number})],ca.prototype,"value",void 0),a([Z()],ca.prototype,"scaleFactor",void 0),a([Z({type:String})],ca.prototype,"unit",void 0),a([Z({type:Boolean})],ca.prototype,"disabled",void 0),a([Z({type:String})],ca.prototype,"zeroValue",void 0),ca=a([G("time-slider")],ca);var ha,ua,ma,pa,ga,va,_a,fa;function ba(e){return function(e){if(!e)return je;if(e.attributes.icon)return e.attributes.icon;var a=Oe(e.entity_id);return a in De?De[a](e):Ee(a,e.state)}(e)}function wa(e){return(e=e.replace("_"," ")).charAt(0).toUpperCase()+e.slice(1)}function ya(e){return e?e.attributes&&e.attributes.friendly_name?e.attributes.friendly_name:String(e.entity_id.split(".").pop()):"(unrecognized entity)"}function $a(e){return e.filter((e,a,t)=>t.indexOf(e)===a)}function ka(e,a){return e?Object.entries(e).filter(([e])=>a.includes(e)).reduce((e,[a,t])=>Object.assign(e,{[a]:t}),{}):{}}function Aa(e,a){return e?Object.entries(e).filter(([e])=>!a.includes(e)).reduce((e,[a,t])=>Object.assign(e,{[a]:t}),{}):{}}function xa(e,a){const t=Object.keys(e),i=Object.keys(a);if(t.length!==i.length)return!1;for(const i of t)if("object"==typeof e[i]&&"object"==typeof a[i]){if(xa(e[i],a[i]))return!1}else if(e[i]!==a[i])return!1;return!0}function Sa(e,a){const t=e.target;Te(t,"show-dialog",{dialogTag:"error-dialog",dialogImport:()=>Promise.resolve().then((function(){return ot})),dialogParams:{error:a}})}function Oa(e,a){Sa(a,L` - Something went wrong!
- ${e.body.message?L` - ${e.body.message}

- `:""} - ${e.error}

- Please report the bug. - `)}!function(e){e.ArmedAway="hass:car-traction-control",e.ArmedHome="hass:home-outline",e.ArmedNight="hass:weather-night",e.ArmedCustom="hass:star-outline"}(ha||(ha={})),function(e){e.STATE_ALARM_DISARMED="disarmed",e.STATE_ALARM_ARMED_HOME="armed_home",e.STATE_ALARM_ARMED_AWAY="armed_away",e.STATE_ALARM_ARMED_NIGHT="armed_night",e.STATE_ALARM_ARMED_CUSTOM_BYPASS="armed_custom_bypass",e.STATE_ALARM_PENDING="pending",e.STATE_ALARM_ARMING="arming",e.STATE_ALARM_DISARMING="disarming",e.STATE_ALARM_TRIGGERED="triggered"}(ua||(ua={})),function(e){e.COMMAND_ALARM_DISARM="disarm",e.COMMAND_ALARM_ARM_HOME="arm_home",e.COMMAND_ALARM_ARM_AWAY="arm_away",e.COMMAND_ALARM_ARM_NIGHT="arm_night",e.COMMAND_ALARM_ARM_CUSTOM_BYPASS="arm_custom_bypass"}(ma||(ma={})),function(e){e.Door="door",e.Window="window",e.Motion="motion",e.Tamper="tamper",e.Environmental="environmental",e.Other="other"}(pa||(pa={})),function(e){e.Door="hass:door-closed",e.Window="hass:window-closed",e.Motion="hass:motion-sensor",e.Tamper="hass:vibrate",e.Environmental="hass:fire",e.Other="hass:contactless-payment-circle-outline"}(ga||(ga={})),function(e){e.ArmedAway="armed_away",e.ArmedHome="armed_home",e.ArmedNight="armed_night",e.ArmedCustom="armed_custom_bypass"}(va||(va={})),function(e){e.Disarmed="disarmed",e.Armed="armed",e.Triggered="triggered",e.Pending="pending",e.Arming="arming"}(_a||(_a={})),function(e){e.ArmFailure="arm_failure"}(fa||(fa={}));const Ca=(e,a)=>{if(!e)return!1;switch(e){case ua.STATE_ALARM_ARMED_AWAY:return a[va.ArmedAway].enabled;case ua.STATE_ALARM_ARMED_HOME:return a[va.ArmedHome].enabled;case ua.STATE_ALARM_ARMED_NIGHT:return a[va.ArmedNight].enabled;case ua.STATE_ALARM_ARMED_CUSTOM_BYPASS:return a[va.ArmedCustom].enabled;default:return!0}};function ja(e,a){return Object.entries(a).forEach(([a,t])=>{e=a in e&&"object"==typeof e[a]&&null!==e[a]?Object.assign(Object.assign({},e),{[a]:ja(e[a],t)}):Object.assign(Object.assign({},e),{[a]:t})}),e}let Ta=class extends re{constructor(){super(...arguments),this.label="",this.items=[],this.clearable=!1,this.icons=!1,this.rowRenderer=(e,a,t)=>{!e.firstElementChild&&this.icons?e.innerHTML='\n \n \n \n \n
\n
\n
\n
\n ':e.firstElementChild||(e.innerHTML='\n \n \n \n
\n
\n
\n
\n '),e.querySelector(".name").textContent=t.item.name,e.querySelector("[secondary]").textContent=t.item.description,this.icons&&(e.querySelector("ha-icon").icon=t.item.icon)}}open(){this.updateComplete.then(()=>{var e,a;null===(a=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("vaadin-combo-box-light"))||void 0===a||a.open()})}focus(){this.updateComplete.then(()=>{var e;(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("paper-input")).focus()})}shouldUpdate(e){if(e.get("items")){if(xa(this.items,e.get("items")))return!1;this.firstUpdated()}return!0}firstUpdated(){this._comboBox.items=this.items}render(){return L` + `,a([Z({type:Number})],Ba.prototype,"min",void 0),a([Z({type:Number})],Ba.prototype,"max",void 0),a([Z({type:Number})],Ba.prototype,"step",void 0),a([Z({type:Number})],Ba.prototype,"value",void 0),a([Z()],Ba.prototype,"scaleFactor",void 0),a([Z({type:String})],Ba.prototype,"unit",void 0),a([Z({type:Boolean})],Ba.prototype,"disabled",void 0),a([Z({type:String})],Ba.prototype,"zeroValue",void 0),Ba=a([G("time-slider")],Ba);let Wa=class extends re{constructor(){super(...arguments),this.label="",this.items=[],this.clearable=!1,this.icons=!1,this.disabled=!1,this.invalid=!1,this.rowRenderer=(e,a,t)=>{!e.firstElementChild&&this.icons?e.innerHTML='\n \n \n \n \n
\n
\n
\n
\n ':e.firstElementChild||(e.innerHTML='\n \n \n \n
\n
\n
\n
\n '),e.querySelector(".name").textContent=t.item.name,e.querySelector("[secondary]").textContent=t.item.description||"",this.icons&&(e.querySelector("ha-icon").icon=t.item.icon)}}open(){this.updateComplete.then(()=>{var e,a;null===(a=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("vaadin-combo-box-light"))||void 0===a||a.open()})}focus(){this.updateComplete.then(()=>{var e;(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("paper-input")).focus()})}shouldUpdate(e){if(e.get("items"))if(Ua(this.items,e.get("items"))){if(1==e.size)return!1}else this.firstUpdated();return!0}firstUpdated(){this._comboBox.items=this.items}render(){return L` @@ -423,8 +424,10 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) autocomplete="off" autocorrect="off" spellcheck="false" + ?disabled=${this.disabled} + ?invalid=${this.invalid} > - ${this._value&&this.items.find(e=>e.value==this._value)?L` + ${Ra(this._value)&&this.items.find(e=>e.value==this._value)?L` ${this.icons?L` `:""} @@ -441,7 +444,7 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) - `}_clearValue(e){e.stopPropagation(),this._setValue("")}get _value(){return this.value||""}_openedChanged(e){this._opened=e.detail.value}_valueChanged(e){const a=e.detail.value;a!==this._value&&this._setValue(a)}_setValue(e){this.value=e,setTimeout(()=>{Te(this,"value-changed",{value:e})},0)}static get styles(){return se` + `}_clearValue(e){e.stopPropagation(),this._setValue("")}get _value(){return Ra(this.value)?this.value:""}_openedChanged(e){this._opened=e.detail.value}_valueChanged(e){const a=e.detail.value;a!==this._value&&this._setValue(a)}_setValue(e){this.value=e,setTimeout(()=>{Te(this,"value-changed",{value:e})},0)}static get styles(){return se` :host { line-height: 1em; } @@ -461,11 +464,11 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) height: 26px; align-items: center; } - `}};var Ma,Ea;a([Z({attribute:!1})],Ta.prototype,"hass",void 0),a([Z()],Ta.prototype,"label",void 0),a([Z()],Ta.prototype,"value",void 0),a([Z()],Ta.prototype,"items",void 0),a([Z()],Ta.prototype,"clearable",void 0),a([Z()],Ta.prototype,"icons",void 0),a([J()],Ta.prototype,"_opened",void 0),a([(Ma="vaadin-combo-box-light",Ea=!0,(e,a)=>{const t={get(){return this.renderRoot.querySelector(Ma)},enumerable:!0,configurable:!0};if(Ea){const e="symbol"==typeof a?Symbol():"__"+a;t.get=function(){return void 0===this[e]&&(this[e]=this.renderRoot.querySelector(Ma)),this[e]}}return void 0!==a?X(t,e,a):ee(t,e)})],Ta.prototype,"_comboBox",void 0),Ta=a([G("alarmo-select")],Ta);const qa=e=>e.callWS({type:"alarmo/config"}),za=e=>e.callWS({type:"alarmo/sensors"}),Da=e=>e.callWS({type:"alarmo/users"}),Na=e=>e.callWS({type:"alarmo/automations"}),Pa=(e,a)=>e.callApi("POST","alarmo/config",a),La=(e,a)=>e.callApi("POST","alarmo/sensors",a),Ra=(e,a)=>e.callApi("POST","alarmo/users",a),Va=(e,a)=>e.callApi("POST","alarmo/automations",a),Ua=(e,a)=>e.callApi("POST","alarmo/automations",{automation_id:a,remove:!0}),Ia=e=>e.callWS({type:"alarmo/areas"}),Fa=(e,a)=>e.callApi("POST","alarmo/area",a),Ha=e=>{class t 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 a([Z({attribute:!1})],t.prototype,"hass",void 0),t};let Ya=class extends(Ha(re)){constructor(){super(...arguments),this.currentTab=0}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){this.hass&&(this.areas=await Ia(this.hass))}async firstUpdated(){this.areas=await Ia(this.hass),this.selectedArea=Object.keys(this.areas)[0],this.data=Object.assign({},this.areas[this.selectedArea].modes)}render(){if(!this.data)return L``;const e=Object.values(va)[this.currentTab];return L` + `}};var Qa,Ga;a([Z({attribute:!1})],Wa.prototype,"hass",void 0),a([Z()],Wa.prototype,"label",void 0),a([Z()],Wa.prototype,"value",void 0),a([Z()],Wa.prototype,"items",void 0),a([Z()],Wa.prototype,"clearable",void 0),a([Z()],Wa.prototype,"icons",void 0),a([Z({type:Boolean})],Wa.prototype,"disabled",void 0),a([J()],Wa.prototype,"_opened",void 0),a([Z({type:Boolean})],Wa.prototype,"invalid",void 0),a([(Qa="vaadin-combo-box-light",Ga=!0,(e,a)=>{const t={get(){return this.renderRoot.querySelector(Qa)},enumerable:!0,configurable:!0};if(Ga){const e="symbol"==typeof a?Symbol():"__"+a;t.get=function(){return void 0===this[e]&&(this[e]=this.renderRoot.querySelector(Qa)),this[e]}}return void 0!==a?X(t,e,a):ee(t,e)})],Wa.prototype,"_comboBox",void 0),Wa=a([G("alarmo-select")],Wa);let Ka=class extends(Ya(re)){constructor(){super(...arguments),this.currentTab=0}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){this.hass&&(this.areas=await xa(this.hass))}async firstUpdated(){this.areas=await xa(this.hass),this.selectedArea=Object.keys(this.areas)[0],this.data=Object.assign({},this.areas[this.selectedArea].modes)}render(){if(!this.data)return L``;const e=Object.values(Le)[this.currentTab];return L`
- ${la("panels.general.cards.modes.title",this.hass.language)} + ${ga("panels.general.cards.modes.title",this.hass.language)}
${Object.keys(this.areas).length>1?L` @@ -479,29 +482,29 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) `:""}
- ${la("panels.general.cards.modes.description",this.hass.language)} + ${ga("panels.general.cards.modes.description",this.hass.language)}
this.currentTab=Number(e.detail.index)} > - ${Object.entries(va).map(([e,a])=>L` + ${Object.entries(Le).map(([e,a])=>L` - + `)} - ${la("common.modes_long."+e,this.hass.language)} + ${ga("common.modes_long."+e,this.hass.language)} ${la("panels.general.cards.modes.fields.mode."+e,this.hass.language)}${ga("panels.general.cards.modes.fields.mode."+e,this.hass.language)}
@@ -509,13 +512,13 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) class="${this.data[e].enabled?"active":""}" @click=${()=>this.data={...this.data,[e]:{...this.data[e],enabled:!0}}} > - ${la("panels.general.cards.modes.fields.mode.enabled",this.hass.language)} + ${ga("panels.general.cards.modes.fields.mode.enabled",this.hass.language)} this.data={...this.data,[e]:{...this.data[e],enabled:!1}}} > - ${la("panels.general.cards.modes.fields.mode.disabled",this.hass.language)} + ${ga("panels.general.cards.modes.fields.mode.disabled",this.hass.language)}
@@ -523,16 +526,16 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${this.data[e].enabled?L` ${la("panels.general.cards.modes.fields.exit_delay.heading",this.hass.language)}${ga("panels.general.cards.modes.fields.exit_delay.heading",this.hass.language)} ${la("panels.general.cards.modes.fields.exit_delay.description",this.hass.language)}${ga("panels.general.cards.modes.fields.exit_delay.description",this.hass.language)} this.data={...this.data,[e]:{...this.data[e],exit_time:Number(a.target.value)}}} > @@ -541,16 +544,16 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${la("panels.general.cards.modes.fields.entry_delay.heading",this.hass.language)}${ga("panels.general.cards.modes.fields.entry_delay.heading",this.hass.language)} ${la("panels.general.cards.modes.fields.entry_delay.description",this.hass.language)}${ga("panels.general.cards.modes.fields.entry_delay.description",this.hass.language)} this.data={...this.data,[e]:{...this.data[e],entry_time:Number(a.target.value)}}} > @@ -559,16 +562,16 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${la("panels.general.cards.modes.fields.trigger_time.heading",this.hass.language)}${ga("panels.general.cards.modes.fields.trigger_time.heading",this.hass.language)} ${la("panels.general.cards.modes.fields.trigger_time.description",this.hass.language)}${ga("panels.general.cards.modes.fields.trigger_time.description",this.hass.language)} this.data={...this.data,[e]:{...this.data[e],trigger_time:Number(a.target.value)}}} > @@ -582,7 +585,7 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a)
- `}selectArea(e){e!=this.selectedArea&&(this.selectedArea=e,this.data=Object.assign({},this.areas[e].modes))}saveClick(e){Fa(this.hass,{area_id:this.selectedArea,modes:this.data}).catch(a=>Oa(a,e)).then()}};Ya.styles=Pe,a([Z()],Ya.prototype,"hass",void 0),a([Z()],Ya.prototype,"narrow",void 0),a([Z()],Ya.prototype,"currentTab",void 0),a([Z()],Ya.prototype,"config",void 0),a([Z()],Ya.prototype,"areas",void 0),a([Z()],Ya.prototype,"data",void 0),a([Z()],Ya.prototype,"selectedArea",void 0),Ya=a([G("alarm-mode-card")],Ya);let Ba=class extends re{constructor(){super(...arguments),this.threeLine=!1}render(){return L` + `}selectArea(e){e!=this.selectedArea&&(this.selectedArea=e,this.data=Object.assign({},this.areas[e].modes))}saveClick(e){Sa(this.hass,{area_id:this.selectedArea,modes:this.data}).catch(a=>Ia(a,e)).then()}};Ka.styles=Pe,a([Z()],Ka.prototype,"hass",void 0),a([Z()],Ka.prototype,"narrow",void 0),a([Z()],Ka.prototype,"currentTab",void 0),a([Z()],Ka.prototype,"config",void 0),a([Z()],Ka.prototype,"areas",void 0),a([Z()],Ka.prototype,"data",void 0),a([Z()],Ka.prototype,"selectedArea",void 0),Ka=a([G("alarm-mode-card")],Ka);let Za=class extends re{constructor(){super(...arguments),this.threeLine=!1}render(){return L`
@@ -610,6 +613,12 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) border-top: 1px solid var(--divider-color); padding: 16px 16px; } + :host([first]) { + border-top: none; + } + :host([last]) { + border-bottom: none; + } ::slotted(ha-switch) { padding: 16px 0; } @@ -623,7 +632,10 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) .secondary { color: var(--secondary-text-color); } - `}};a([Z({type:Boolean,reflect:!0})],Ba.prototype,"narrow",void 0),a([Z({type:Boolean,reflect:!0})],Ba.prototype,"large",void 0),a([Z({type:Boolean,attribute:"three-line"})],Ba.prototype,"threeLine",void 0),Ba=a([G("settings-row")],Ba);let Wa=class extends re{constructor(){super(...arguments),this.header="",this.open=!1}render(){return L` + :host(:not([large]):not([narrow])) ::slotted(*) { + max-width: 66%; + } + `}};a([Z({type:Boolean,reflect:!0})],Za.prototype,"narrow",void 0),a([Z({type:Boolean,reflect:!0})],Za.prototype,"large",void 0),a([Z({type:Boolean,attribute:"three-line"})],Za.prototype,"threeLine",void 0),Za=a([G("settings-row")],Za);let Ja=class extends re{constructor(){super(...arguments),this.header="",this.open=!1}render(){return L` ${this.open?L`
a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) height: 1px; background: var(--divider-color); } - `}};a([Z({type:Boolean,reflect:!0})],Wa.prototype,"narrow",void 0),a([Z()],Wa.prototype,"header",void 0),a([Z()],Wa.prototype,"open",void 0),Wa=a([G("collapsible-section")],Wa);let Qa=class extends(Ha(re)){constructor(){super(...arguments),this.areas={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){if(!this.hass)return;const e=await qa(this.hass);this.config=e,this.areas=await Ia(this.hass),this.selection=Aa(e.mqtt,["availability_topic"])}firstUpdated(){(async()=>{await Ne()})()}render(){return this.hass&&this.selection?L` + `}};a([Z({type:Boolean,reflect:!0})],Ja.prototype,"narrow",void 0),a([Z()],Ja.prototype,"header",void 0),a([Z()],Ja.prototype,"open",void 0),Ja=a([G("collapsible-section")],Ja);let Xa=class extends(Ya(re)){constructor(){super(...arguments),this.areas={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){if(!this.hass)return;const e=await va(this.hass);this.config=e,this.areas=await xa(this.hass),this.selection=e.mqtt}firstUpdated(){(async()=>{await De()})()}render(){return this.hass&&this.selection?L`
-
${la("panels.general.cards.mqtt.title",this.hass.language)}
+
${ga("panels.general.cards.mqtt.title",this.hass.language)}
-
${la("panels.general.cards.mqtt.description",this.hass.language)}
+
${ga("panels.general.cards.mqtt.description",this.hass.language)}
${la("panels.general.cards.mqtt.fields.state_topic.heading",this.hass.language)}${ga("panels.general.cards.mqtt.fields.state_topic.heading",this.hass.language)}
${la("panels.general.cards.mqtt.fields.state_topic.description",this.hass.language)}${ga("panels.general.cards.mqtt.fields.state_topic.description",this.hass.language)} {this.selection={...this.selection,state_topic:e.target.value}}} > @@ -719,19 +731,19 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) - ${Object.values(ua).filter(e=>Object.values(this.areas).some(a=>Ca(e,a.modes))).map(e=>L` + ${Object.values(Ca).filter(e=>Object.values(this.areas).some(a=>Va(e,a.modes))).map(e=>L` - ${wa(e)} + ${Na(e)} ${la("panels.general.cards.mqtt.fields.state_payload.item",this.hass.language,"{state}",wa(e))}${ga("panels.general.cards.mqtt.fields.state_payload.item",this.hass.language,"{state}",Na(e))} {this.selection=ja(this.selection,{state_payload:{[e]:a.target.value}})}} + @change=${a=>{this.selection=Ha(this.selection,{state_payload:{[e]:a.target.value}})}} > @@ -740,13 +752,13 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${la("panels.general.cards.mqtt.fields.event_topic.heading",this.hass.language)}${ga("panels.general.cards.mqtt.fields.event_topic.heading",this.hass.language)} ${la("panels.general.cards.mqtt.fields.event_topic.description",this.hass.language)}${ga("panels.general.cards.mqtt.fields.event_topic.description",this.hass.language)} {this.selection={...this.selection,event_topic:e.target.value}}} > @@ -754,13 +766,13 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${la("panels.general.cards.mqtt.fields.command_topic.heading",this.hass.language)}${ga("panels.general.cards.mqtt.fields.command_topic.heading",this.hass.language)} ${la("panels.general.cards.mqtt.fields.command_topic.description",this.hass.language)}${ga("panels.general.cards.mqtt.fields.command_topic.description",this.hass.language)} {this.selection={...this.selection,command_topic:e.target.value}}} > @@ -768,19 +780,19 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) - ${Object.values(ma).filter(e=>Object.values(this.areas).some(a=>Ca((e=>{switch(e){case ma.COMMAND_ALARM_DISARM:return ua.STATE_ALARM_DISARMED;case ma.COMMAND_ALARM_ARM_HOME:return ua.STATE_ALARM_ARMED_HOME;case ma.COMMAND_ALARM_ARM_AWAY:return ua.STATE_ALARM_ARMED_AWAY;case ma.COMMAND_ALARM_ARM_NIGHT:return ua.STATE_ALARM_ARMED_NIGHT;case ma.COMMAND_ALARM_ARM_CUSTOM_BYPASS:return ua.STATE_ALARM_ARMED_CUSTOM_BYPASS;default:return}})(e),a.modes))).map(e=>L` + ${Object.values(Oa).filter(e=>Object.values(this.areas).some(a=>Va((e=>{switch(e){case Oa.COMMAND_ALARM_DISARM:return Ca.STATE_ALARM_DISARMED;case Oa.COMMAND_ALARM_ARM_HOME:return Ca.STATE_ALARM_ARMED_HOME;case Oa.COMMAND_ALARM_ARM_AWAY:return Ca.STATE_ALARM_ARMED_AWAY;case Oa.COMMAND_ALARM_ARM_NIGHT:return Ca.STATE_ALARM_ARMED_NIGHT;case Oa.COMMAND_ALARM_ARM_CUSTOM_BYPASS:return Ca.STATE_ALARM_ARMED_CUSTOM_BYPASS;default:return}})(e),a.modes))).map(e=>L` - ${wa(e)} + ${Na(e)} ${la("panels.general.cards.mqtt.fields.command_payload.item",this.hass.language,"{command}",wa(e))}${ga("panels.general.cards.mqtt.fields.command_payload.item",this.hass.language,"{command}",Na(e))} {this.selection=ja(this.selection,{command_payload:{[e]:a.target.value}})}} + @change=${a=>{this.selection=Ha(this.selection,{command_payload:{[e]:a.target.value}})}} > @@ -789,10 +801,10 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) ${la("panels.general.cards.mqtt.fields.require_code.heading",this.hass.language)}${ga("panels.general.cards.mqtt.fields.require_code.heading",this.hass.language)} ${la("panels.general.cards.mqtt.fields.require_code.description",this.hass.language)}${ga("panels.general.cards.mqtt.fields.require_code.description",this.hass.language)} a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a)
- `:L``}saveClick(e){this.hass&&Pa(this.hass,{mqtt:Object.assign(Object.assign({},this.selection),{enabled:!0})}).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}cancelClick(){qe(0,"/alarmo/general",!0)}};Qa.styles=Pe,a([Z()],Qa.prototype,"narrow",void 0),a([Z()],Qa.prototype,"config",void 0),a([Z()],Qa.prototype,"areas",void 0),a([Z()],Qa.prototype,"selection",void 0),Qa=a([G("mqtt-config-card")],Qa); + `:L``}saveClick(e){this.hass&&wa(this.hass,{mqtt:Object.assign(Object.assign({},this.selection),{enabled:!0})}).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()})}cancelClick(){Ee(0,"/alarmo/general",!0)}};Xa.styles=Pe,a([Z()],Xa.prototype,"narrow",void 0),a([Z()],Xa.prototype,"config",void 0),a([Z()],Xa.prototype,"areas",void 0),a([Z()],Xa.prototype,"selection",void 0),Xa=a([G("mqtt-config-card")],Xa); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -822,7 +834,7 @@ const G=e=>a=>"function"==typeof a?((e,a)=>(window.customElements.define(e,a),a) * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a=>{if(!(a instanceof O))throw new Error("unsafeHTML can only be used in text bindings");const t=Ga.get(a);if(void 0!==t&&k(e)&&e===t.value&&a.value===t.fragment)return;const i=document.createElement("template");i.innerHTML=e;const s=document.importNode(i.content,!0);a.setValue(s),Ga.set(a,{value:e,fragment:s})});let Za=class extends re{render(){return this.columns&&this.data?L` +const et=new WeakMap,at=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a=>{if(!(a instanceof j))throw new Error("unsafeHTML can only be used in text bindings");const t=et.get(a);if(void 0!==t&&k(e)&&e===t.value&&a.value===t.fragment)return;const i=document.createElement("template");i.innerHTML=e;const s=document.importNode(i.content,!0);a.setValue(s),et.set(a,{value:e,fragment:s})});let tt=class extends re{render(){return this.columns&&this.data?L`
${this.renderHeaderRow()} ${this.data.length?this.data.map(e=>this.renderDataRow(e)):L` @@ -855,7 +867,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a
`)}
- `:L``}handleClick(e){if(!this.selectable)return;const a=new CustomEvent("row-click",{detail:{id:e}});this.dispatchEvent(a)}};Za.styles=se` + `:L``}handleClick(e){if(!this.selectable)return;const a=new CustomEvent("row-click",{detail:{id:e}});this.dispatchEvent(a)}};tt.styles=se` :host { width: 100%; } @@ -937,7 +949,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a a:visited { color: var(--primary-color); } - `,a([Z()],Za.prototype,"columns",void 0),a([Z()],Za.prototype,"data",void 0),a([Z({type:Boolean})],Za.prototype,"selectable",void 0),Za=a([G("alarmo-table")],Za);let Ja=class extends re{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params&&this._params.cancel(),this._params=void 0}render(){return this._params?L` + `,a([Z()],tt.prototype,"columns",void 0),a([Z()],tt.prototype,"data",void 0),a([Z({type:Boolean})],tt.prototype,"selectable",void 0),tt=a([G("alarmo-table")],tt);let it=class extends re{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params&&this._params.cancel(),this._params=void 0}render(){return this._params?L`
@@ -963,13 +975,13 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a div.wrapper { color: var(--primary-text-color); } - `}};a([Z({attribute:!1})],Ja.prototype,"hass",void 0),a([J()],Ja.prototype,"_params",void 0),Ja=a([G("confirm-delete-dialog")],Ja);var Xa=Object.freeze({__proto__:null,get ConfirmDeleteDialog(){return Ja}});let et=class extends(Ha(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.automations={},this.name=""}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){this.hass&&(this.areas=await Ia(this.hass),this.sensors=await za(this.hass),this.automations=await Na(this.hass))}async showDialog(e){await this._fetchData(),this._params=e,e.area_id&&(this.area_id=e.area_id,this.name=this.areas[this.area_id].name),await this.updateComplete}async closeDialog(){this._params=void 0,this.area_id=void 0,this.name=""}render(){return this._params?L` + `}};a([Z({attribute:!1})],it.prototype,"hass",void 0),a([J()],it.prototype,"_params",void 0),it=a([G("confirm-delete-dialog")],it);var st=Object.freeze({__proto__:null,get ConfirmDeleteDialog(){return it}});let nt=class extends(Ya(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.automations={},this.name=""}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_config_updated")]}async _fetchData(){this.hass&&(this.areas=await xa(this.hass),this.sensors=await _a(this.hass),this.automations=await ba(this.hass))}async showDialog(e){await this._fetchData(),this._params=e,e.area_id&&(this.area_id=e.area_id,this.name=this.areas[this.area_id].name),await this.updateComplete}async closeDialog(){this._params=void 0,this.area_id=void 0,this.name=""}render(){return this._params?L`
- ${this.area_id?la("panels.general.dialogs.edit_area.title",this.hass.language,"{area}",this.areas[this.area_id].name):la("panels.general.dialogs.create_area.title",this.hass.language)} + ${this.area_id?ga("panels.general.dialogs.edit_area.title",this.hass.language,"{area}",this.areas[this.area_id].name):ga("panels.general.dialogs.create_area.title",this.hass.language)}
@@ -982,14 +994,14 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${this.area_id?L` ${la("panels.general.dialogs.edit_area.name_warning",this.hass.language)}${ga("panels.general.dialogs.edit_area.name_warning",this.hass.language)} `:""} ${this.area_id?"":L` Object({value:e.area_id,name:e.name}))} value=${this.selectedArea} - label="${la("panels.general.dialogs.create_area.fields.copy_from",this.hass.language)}" + label="${ga("panels.general.dialogs.create_area.fields.copy_from",this.hass.language)}" clearable=${!0} @value-changed=${e=>this.selectedArea=e.target.value} > @@ -1010,7 +1022,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""}
- `:L``}saveClick(e){const a=this.name.trim();if(!a.length)return;let t={name:a};this.area_id?t=Object.assign(Object.assign({},t),{area_id:this.area_id}):this.selectedArea&&(t=Object.assign(Object.assign({},t),{modes:Object.assign({},this.areas[this.selectedArea].modes)})),Fa(this.hass,t).catch(a=>Oa(a,e)).then(()=>{this.closeDialog()})}async deleteClick(e){if(!this.area_id)return;const a=Object.values(this.sensors).filter(e=>e.area==this.area_id).length,t=Object.values(this.automations).filter(e=>e.area==this.area_id).length;let i=!1;var s,n;i=!a&&!t||await new Promise(i=>{Te(e.target,"show-dialog",{dialogTag:"confirm-delete-dialog",dialogImport:()=>Promise.resolve().then((function(){return Xa})),dialogParams:{title:la("panels.general.dialogs.remove_area.title",this.hass.language),description:la("panels.general.dialogs.remove_area.description",this.hass.language,["{sensors}","{automations}"],[String(a),String(t)]),cancel:()=>i(!1),confirm:()=>i(!0)}})}),i&&(s=this.hass,n=this.area_id,s.callApi("POST","alarmo/area",{area_id:n,remove:!0})).catch(a=>Oa(a,e)).then(()=>{this.closeDialog()})}static get styles(){return se` + `:L``}saveClick(e){const a=this.name.trim();if(!a.length)return;let t={name:a};this.area_id?t=Object.assign(Object.assign({},t),{area_id:this.area_id}):this.selectedArea&&(t=Object.assign(Object.assign({},t),{modes:Object.assign({},this.areas[this.selectedArea].modes)})),Sa(this.hass,t).catch(a=>Ia(a,e)).then(()=>{this.closeDialog()})}async deleteClick(e){if(!this.area_id)return;const a=Object.values(this.sensors).filter(e=>e.area==this.area_id).length,t=Object.values(this.automations).filter(e=>{var a;return null===(a=e.triggers)||void 0===a?void 0:a.map(e=>e.area).includes(this.area_id)}).length;let i=!1;var s,n;i=!a&&!t||await new Promise(i=>{Te(e.target,"show-dialog",{dialogTag:"confirm-delete-dialog",dialogImport:()=>Promise.resolve().then((function(){return st})),dialogParams:{title:ga("panels.general.dialogs.remove_area.title",this.hass.language),description:ga("panels.general.dialogs.remove_area.description",this.hass.language,["{sensors}","{automations}"],[String(a),String(t)]),cancel:()=>i(!1),confirm:()=>i(!0)}})}),i&&(s=this.hass,n=this.area_id,s.callApi("POST","alarmo/area",{area_id:n,remove:!0})).catch(a=>Ia(a,e)).then(()=>{this.closeDialog()})}static get styles(){return se` ${Pe} div.wrapper { color: var(--primary-text-color); @@ -1018,29 +1030,29 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a span.note { color: var(--secondary-text-color); } - `}};a([Z({attribute:!1})],et.prototype,"hass",void 0),a([J()],et.prototype,"_params",void 0),a([Z()],et.prototype,"areas",void 0),a([Z()],et.prototype,"sensors",void 0),a([Z()],et.prototype,"automations",void 0),a([Z()],et.prototype,"name",void 0),a([Z()],et.prototype,"area_id",void 0),a([Z()],et.prototype,"selectedArea",void 0),et=a([G("create-area-dialog")],et);var at=Object.freeze({__proto__:null,get CreateAreaDialog(){return et}});let tt=class extends(Ha(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.automations={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){this.hass&&(this.areas=await Ia(this.hass),this.sensors=await za(this.hass),this.automations=await Na(this.hass))}render(){if(!this.hass)return L``;const e=Object.values(this.areas);e.sort((e,a)=>e.name.toLowerCase(){const t=Object.values(this.sensors).filter(e=>e.area==a.area_id).length,i=1==Object.values(e).length?Object.values(this.automations).filter(e=>!e.area||e.area==a.area_id).length:Object.values(this.automations).filter(e=>e.area==a.area_id).length,s=`${la("panels.general.cards.areas.table.summary_sensors",this.hass.language,"{number}",String(t))}`,n=`${la("panels.general.cards.areas.table.summary_automations",this.hass.language,"{number}",String(i))}`;return{id:a.area_id,actions:L` + `}};a([Z({attribute:!1})],nt.prototype,"hass",void 0),a([J()],nt.prototype,"_params",void 0),a([Z()],nt.prototype,"areas",void 0),a([Z()],nt.prototype,"sensors",void 0),a([Z()],nt.prototype,"automations",void 0),a([Z()],nt.prototype,"name",void 0),a([Z()],nt.prototype,"area_id",void 0),a([Z()],nt.prototype,"selectedArea",void 0),nt=a([G("create-area-dialog")],nt);var rt=Object.freeze({__proto__:null,get CreateAreaDialog(){return nt}});let ot=class extends(Ya(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.automations={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){this.hass&&(this.areas=await xa(this.hass),this.sensors=await _a(this.hass),this.automations=await ba(this.hass))}render(){if(!this.hass)return L``;const e=Object.values(this.areas);e.sort((e,a)=>e.name.toLowerCase(){const t=Object.values(this.sensors).filter(e=>e.area==a.area_id).length,i=1==Object.values(e).length?Object.values(this.automations).filter(e=>{var t,i;return(null===(t=e.triggers)||void 0===t?void 0:t.map(e=>e.area).includes(a.area_id))||!(null===(i=e.triggers)||void 0===i?void 0:i.map(e=>e.area).length)}).length:Object.values(this.automations).filter(e=>{var t;return null===(t=e.triggers)||void 0===t?void 0:t.map(e=>e.area).includes(a.area_id)}).length,s=`${ga("panels.general.cards.areas.table.summary_sensors",this.hass.language,"{number}",String(t))}`,n=`${ga("panels.general.cards.areas.table.summary_automations",this.hass.language,"{number}",String(i))}`;return{id:a.area_id,actions:L` this.editClick(e,a.area_id)} icon="hass:pencil"> - `,name:wa(a.name),remarks:Ka(la("panels.general.cards.areas.table.summary",this.hass.language,["{summary_sensors}","{summary_automations}"],[s,n]))}});return L` - + `,name:Na(a.name),remarks:at(ga("panels.general.cards.areas.table.summary",this.hass.language,["{summary_sensors}","{summary_automations}"],[s,n]))}});return L` +
- ${la("panels.general.cards.areas.description",this.hass.language)} + ${ga("panels.general.cards.areas.description",this.hass.language)}
- ${la("panels.general.cards.areas.no_items",this.hass.language)} + ${ga("panels.general.cards.areas.no_items",this.hass.language)}
- ${la("panels.general.cards.areas.actions.add",this.hass.language)} + ${ga("panels.general.cards.areas.actions.add",this.hass.language)}
- `}addClick(e){const a=e.target;Te(a,"show-dialog",{dialogTag:"create-area-dialog",dialogImport:()=>Promise.resolve().then((function(){return at})),dialogParams:{}})}editClick(e,a){const t=e.target;Te(t,"show-dialog",{dialogTag:"create-area-dialog",dialogImport:()=>Promise.resolve().then((function(){return at})),dialogParams:{area_id:a}})}};tt.styles=Pe,a([Z()],tt.prototype,"narrow",void 0),a([Z()],tt.prototype,"path",void 0),a([Z()],tt.prototype,"config",void 0),a([Z()],tt.prototype,"areas",void 0),a([Z()],tt.prototype,"sensors",void 0),a([Z()],tt.prototype,"automations",void 0),tt=a([G("area-config-card")],tt);let it=class extends re{constructor(){super(...arguments),this.name=""}async showDialog(e){this._params=e;const a=await qa(this.hass);this.name=a.master.name||"",await this.updateComplete}async closeDialog(){this._params=void 0}render(){return this._params?L` + `}addClick(e){const a=e.target;Te(a,"show-dialog",{dialogTag:"create-area-dialog",dialogImport:()=>Promise.resolve().then((function(){return rt})),dialogParams:{}})}editClick(e,a){const t=e.target;Te(t,"show-dialog",{dialogTag:"create-area-dialog",dialogImport:()=>Promise.resolve().then((function(){return rt})),dialogParams:{area_id:a}})}};ot.styles=Pe,a([Z()],ot.prototype,"narrow",void 0),a([Z()],ot.prototype,"path",void 0),a([Z()],ot.prototype,"config",void 0),a([Z()],ot.prototype,"areas",void 0),a([Z()],ot.prototype,"sensors",void 0),a([Z()],ot.prototype,"automations",void 0),ot=a([G("area-config-card")],ot);let dt=class extends re{constructor(){super(...arguments),this.name=""}async showDialog(e){this._params=e;const a=await va(this.hass);this.name=a.master.name||"",await this.updateComplete}async closeDialog(){this._params=void 0}render(){return this._params?L`
- ${la("panels.general.dialogs.edit_master.title",this.hass.language)} + ${ga("panels.general.dialogs.edit_master.title",this.hass.language)}
@@ -1050,7 +1062,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a value="${this.name}" > - ${la("panels.general.dialogs.edit_area.name_warning",this.hass.language)} + ${ga("panels.general.dialogs.edit_area.name_warning",this.hass.language)}
${this.hass.localize("ui.common.save")} @@ -1059,29 +1071,29 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${this.hass.localize("ui.common.cancel")}
- `:L``}saveClick(){const e=this.name.trim();e.length&&Pa(this.hass,{master:{enabled:!0,name:e}}).catch().then(()=>{this.closeDialog()})}static get styles(){return se` + `:L``}saveClick(){const e=this.name.trim();e.length&&wa(this.hass,{master:{enabled:!0,name:e}}).catch().then(()=>{this.closeDialog()})}static get styles(){return se` div.wrapper { color: var(--primary-text-color); } span.note { color: var(--secondary-text-color); } - `}};a([Z({attribute:!1})],it.prototype,"hass",void 0),a([J()],it.prototype,"_params",void 0),a([Z()],it.prototype,"name",void 0),it=a([G("edit-master-dialog")],it);var st=Object.freeze({__proto__:null,get EditMasterDialog(){return it}});let nt=class extends(Ha(re)){constructor(){super(...arguments),this.areas={},this.automations={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){this.hass&&(this.config=await qa(this.hass),this.areas=await Ia(this.hass),this.automations=await Na(this.hass),this.data=ka(this.config,["trigger_time","disarm_after_trigger","mqtt","master"]))}firstUpdated(){(async()=>{await Ne()})()}render(){var e,a,t,i,s,n,r,o;return this.hass&&this.config&&this.data?this.path&&"mqtt_configuration"==this.path[0]?L` + `}};a([Z({attribute:!1})],dt.prototype,"hass",void 0),a([J()],dt.prototype,"_params",void 0),a([Z()],dt.prototype,"name",void 0),dt=a([G("edit-master-dialog")],dt);var lt=Object.freeze({__proto__:null,get EditMasterDialog(){return dt}});let ct=class extends(Ya(re)){constructor(){super(...arguments),this.areas={},this.automations={}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){this.hass&&(this.config=await va(this.hass),this.areas=await xa(this.hass),this.automations=await ba(this.hass),this.data=Pa(this.config,["trigger_time","disarm_after_trigger","mqtt","master"]))}firstUpdated(){(async()=>{await De()})()}render(){var e,a,t,i,s,n,r,o;return this.hass&&this.config&&this.data?this.path&&"mqtt_configuration"==this.path[0]?L` `:this.path&&"edit_area"==this.path[0]&&2==this.path.length?L` `:L` - +
- ${la("panels.general.cards.general.description",this.hass.language)} + ${ga("panels.general.cards.general.description",this.hass.language)}
${la("panels.general.cards.general.fields.disarm_after_trigger.heading",this.hass.language)}${ga("panels.general.cards.general.fields.disarm_after_trigger.heading",this.hass.language)} ${la("panels.general.cards.general.fields.disarm_after_trigger.description",this.hass.language)}${ga("panels.general.cards.general.fields.disarm_after_trigger.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.general.cards.general.fields.enable_mqtt.heading",this.hass.language)}${ga("panels.general.cards.general.fields.enable_mqtt.heading",this.hass.language)} ${la("panels.general.cards.general.fields.enable_mqtt.description",this.hass.language)}${ga("panels.general.cards.general.fields.enable_mqtt.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${(null===(i=null===(t=this.data)||void 0===t?void 0:t.mqtt)||void 0===i?void 0:i.enabled)?L`
- qe(0,"/alarmo/general/mqtt_configuration",!0)}> - ${la("panels.general.cards.general.actions.setup_mqtt",this.hass.language)} + Ee(0,"/alarmo/general/mqtt_configuration",!0)}> + ${ga("panels.general.cards.general.actions.setup_mqtt",this.hass.language)}
`:""} ${Object.keys(this.areas).length>=2?L` ${la("panels.general.cards.general.fields.enable_master.heading",this.hass.language)}${ga("panels.general.cards.general.fields.enable_master.heading",this.hass.language)} ${la("panels.general.cards.general.fields.enable_master.description",this.hass.language)}${ga("panels.general.cards.general.fields.enable_master.description",this.hass.language)} =2} @@ -1131,7 +1143,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${(null===(o=null===(r=this.data)||void 0===r?void 0:r.master)||void 0===o?void 0:o.enabled)&&Object.keys(this.areas).length>=2?L`
- ${la("panels.general.cards.general.actions.setup_master",this.hass.language)} + ${ga("panels.general.cards.general.actions.setup_master",this.hass.language)}
`:""} @@ -1146,7 +1158,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a - `:L``}setupMasterClick(e){const a=e.target;Te(a,"show-dialog",{dialogTag:"edit-master-dialog",dialogImport:()=>Promise.resolve().then((function(){return st})),dialogParams:{}})}async toggleEnableMaster(e){const a=e.target;let t=a.checked;if(!t){const e=Object.values(this.automations).filter(e=>!e.area).length;if(e){await new Promise(t=>{Te(a,"show-dialog",{dialogTag:"confirm-delete-dialog",dialogImport:()=>Promise.resolve().then((function(){return Xa})),dialogParams:{title:la("panels.general.dialogs.disable_master.title",this.hass.language),description:la("panels.general.dialogs.disable_master.description",this.hass.language,["{automations}"],[String(e)]),cancel:()=>t(!1),confirm:()=>t(!0)}})})||(t=!0,a.checked=!0)}}this.data=Object.assign(Object.assign({},this.data),{master:Object.assign(Object.assign({},this.data.master),{enabled:t})})}saveClick(e){this.hass&&this.data&&Pa(this.hass,this.data).catch(a=>Oa(a,e)).then()}};nt.styles=Pe,a([Z()],nt.prototype,"narrow",void 0),a([Z()],nt.prototype,"path",void 0),a([Z()],nt.prototype,"data",void 0),a([Z()],nt.prototype,"config",void 0),a([Z()],nt.prototype,"areas",void 0),a([Z()],nt.prototype,"automations",void 0),nt=a([G("alarm-view-general")],nt);let rt=class extends re{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params=void 0}render(){return this._params?L` + `:L``}setupMasterClick(e){const a=e.target;Te(a,"show-dialog",{dialogTag:"edit-master-dialog",dialogImport:()=>Promise.resolve().then((function(){return lt})),dialogParams:{}})}async toggleEnableMaster(e){const a=e.target;let t=a.checked;if(!t){const e=Object.values(this.automations).filter(e=>{var a;return!(null===(a=e.triggers)||void 0===a?void 0:a.map(e=>e.area).length)}).length;if(e){await new Promise(t=>{Te(a,"show-dialog",{dialogTag:"confirm-delete-dialog",dialogImport:()=>Promise.resolve().then((function(){return st})),dialogParams:{title:ga("panels.general.dialogs.disable_master.title",this.hass.language),description:ga("panels.general.dialogs.disable_master.description",this.hass.language,["{automations}"],[String(e)]),cancel:()=>t(!1),confirm:()=>t(!0)}})})||(t=!0,a.checked=!0)}}this.data=Object.assign(Object.assign({},this.data),{master:Object.assign(Object.assign({},this.data.master),{enabled:t})})}saveClick(e){this.hass&&this.data&&wa(this.hass,this.data).catch(a=>Ia(a,e)).then()}};ct.styles=Pe,a([Z()],ct.prototype,"narrow",void 0),a([Z()],ct.prototype,"path",void 0),a([Z()],ct.prototype,"data",void 0),a([Z()],ct.prototype,"config",void 0),a([Z()],ct.prototype,"areas",void 0),a([Z()],ct.prototype,"automations",void 0),ct=a([G("alarm-view-general")],ct);let ht=class extends re{async showDialog(e){this._params=e,await this.updateComplete}async closeDialog(){this._params=void 0}render(){return this._params?L`
@@ -1168,26 +1180,26 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a div.wrapper { color: var(--primary-text-color); } - `}};a([Z({attribute:!1})],rt.prototype,"hass",void 0),a([J()],rt.prototype,"_params",void 0),rt=a([G("error-dialog")],rt);var ot=Object.freeze({__proto__:null,get ErrorDialog(){return rt}});const dt=(e,a)=>{if("binary_sensor"==function(e){const a="string"==typeof e?e:e.entity_id;return String(a.split(".").shift())}(e.entity_id)){if(a)return!0;const t=e.attributes.device_class;return!!t&&!!["door","garage_door","gas","heat","lock","moisture","motion","moving","occupancy","opening","presence","safety","smoke","sound","vibration","window"].includes(t)}return!1},lt=e=>{const a=a=>a.filter(a=>e.includes(a));return{[pa.Door]:{modes:a([va.ArmedAway,va.ArmedHome,va.ArmedNight]),always_on:!1,allow_open:!1,arm_on_close:!0,immediate:!1},[pa.Window]:{modes:a([va.ArmedAway,va.ArmedHome,va.ArmedNight]),always_on:!1,allow_open:!1,arm_on_close:!1,immediate:!0},[pa.Motion]:{modes:a([va.ArmedAway]),always_on:!1,allow_open:!0,arm_on_close:!1,immediate:!1},[pa.Tamper]:{modes:a([va.ArmedAway,va.ArmedHome,va.ArmedNight,va.ArmedCustom]),always_on:!1,allow_open:!1,arm_on_close:!1,immediate:!0},[pa.Environmental]:{modes:a([va.ArmedAway,va.ArmedHome,va.ArmedNight,va.ArmedCustom]),always_on:!0,allow_open:!1,arm_on_close:!1,immediate:!1}}};function ct(e,a){if(!e)return null;const t=Oe(e.entity_id);let i={entity_id:e.entity_id,name:e.attributes.friendly_name||e.entity_id,modes:[],immediate:!1,arm_on_close:!1,allow_open:!1,always_on:!1,auto_bypass:!1,trigger_unavailable:!1,type:pa.Other,enabled:!0};if("binary_sensor"==t){const t=(e=>{switch(e.attributes.device_class){case"door":case"garage_door":case"lock":case"opening":return pa.Door;case"window":return pa.Window;case"gas":case"heat":case"moisture":case"smoke":case"safety":return pa.Environmental;case"motion":case"moving":case"occupancy":case"presence":return pa.Motion;case"sound":case"opening":case"vibration":return pa.Tamper;default:return}})(e);t&&(i=Object.assign(Object.assign(Object.assign({},i),{type:t}),lt(a)[t]))}return i}let ht=class extends re{async firstUpdated(){const e=await Ia(this.hass);this.areas=e;const a=await za(this.hass);this.data=a[this.item],this.data.area||1!=Object.keys(e).length||(this.data=Object.assign(Object.assign({},this.data),{area:Object.keys(this.areas)[0]}))}render(){if(!this.data)return L``;const e=this.hass.states[this.data.entity_id];return L` + `}};a([Z({attribute:!1})],ht.prototype,"hass",void 0),a([J()],ht.prototype,"_params",void 0),ht=a([G("error-dialog")],ht);var mt=Object.freeze({__proto__:null,get ErrorDialog(){return ht}});const ut=(e,a)=>{if("binary_sensor"==function(e){const a="string"==typeof e?e:e.entity_id;return String(a.split(".").shift())}(e.entity_id)){if(a)return!0;const t=e.attributes.device_class;return!!t&&!!["door","garage_door","gas","heat","lock","moisture","motion","moving","occupancy","opening","presence","safety","smoke","sound","vibration","window"].includes(t)}return!1},pt=e=>{const a=a=>a.filter(a=>e.includes(a));return{[Ta.Door]:{modes:a([Le.ArmedAway,Le.ArmedHome,Le.ArmedNight]),always_on:!1,allow_open:!1,arm_on_close:!0,immediate:!1},[Ta.Window]:{modes:a([Le.ArmedAway,Le.ArmedHome,Le.ArmedNight]),always_on:!1,allow_open:!1,arm_on_close:!1,immediate:!0},[Ta.Motion]:{modes:a([Le.ArmedAway]),always_on:!1,allow_open:!0,arm_on_close:!1,immediate:!1},[Ta.Tamper]:{modes:a([Le.ArmedAway,Le.ArmedHome,Le.ArmedNight,Le.ArmedCustom]),always_on:!1,allow_open:!1,arm_on_close:!1,immediate:!0},[Ta.Environmental]:{modes:a([Le.ArmedAway,Le.ArmedHome,Le.ArmedNight,Le.ArmedCustom]),always_on:!0,allow_open:!1,arm_on_close:!1,immediate:!1}}};function gt(e,a){if(!e)return null;const t=je(e.entity_id);let i={entity_id:e.entity_id,name:e.attributes.friendly_name||e.entity_id,modes:[],immediate:!1,arm_on_close:!1,allow_open:!1,always_on:!1,auto_bypass:!1,trigger_unavailable:!1,type:Ta.Other,enabled:!0};if("binary_sensor"==t){const t=(e=>{switch(e.attributes.device_class){case"door":case"garage_door":case"lock":case"opening":return Ta.Door;case"window":return Ta.Window;case"gas":case"heat":case"moisture":case"smoke":case"safety":return Ta.Environmental;case"motion":case"moving":case"occupancy":case"presence":return Ta.Motion;case"sound":case"opening":case"vibration":return Ta.Tamper;default:return}})(e);t&&(i=Object.assign(Object.assign(Object.assign({},i),{type:t}),pt(a)[t]))}return i}let vt=class extends re{async firstUpdated(){const e=await xa(this.hass);this.areas=e;const a=await _a(this.hass);this.data=a[this.item],this.data.area||1!=Object.keys(e).length||(this.data=Object.assign(Object.assign({},this.data),{area:Object.keys(this.areas)[0]}))}render(){if(!this.data)return L``;const e=this.hass.states[this.data.entity_id];return L`
- ${la("panels.sensors.cards.editor.title",this.hass.language)} + ${ga("panels.sensors.cards.editor.title",this.hass.language)}
- ${la("panels.sensors.cards.editor.description",this.hass.language,"{entity}",this.item)} + ${ga("panels.sensors.cards.editor.description",this.hass.language,"{entity}",this.item)}
- ${la("panels.sensors.cards.editor.fields.name.heading",this.hass.language)} + ${ga("panels.sensors.cards.editor.fields.name.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.name.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.name.description",this.hass.language)} this.data={...this.data,name:e.target.value}} @@ -1197,53 +1209,53 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${Object.keys(this.areas).length>1?L` - ${la("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} - ${la("panels.sensors.cards.editor.fields.area.description",this.hass.language)} + ${ga("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} + ${ga("panels.sensors.cards.editor.fields.area.description",this.hass.language)} Object({value:e.area_id,name:e.name}))} value=${this.data.area} - label=${la("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} + label=${ga("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} @value-changed=${e=>this.data={...this.data,area:e.target.value}} `:""} ${la("panels.sensors.cards.editor.fields.device_type.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.device_type.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.device_type.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.device_type.description",this.hass.language)} e!=pa.Other).map(([e,a])=>Object({value:a,name:la(`panels.sensors.cards.editor.fields.device_type.choose.${a}.name`,this.hass.language),description:la(`panels.sensors.cards.editor.fields.device_type.choose.${a}.description`,this.hass.language),icon:ga[e]}))} - label=${la("panels.sensors.cards.editor.fields.device_type.heading",this.hass.language)} + .items=${Object.entries(Ta).filter(([,e])=>e!=Ta.Other).map(([e,a])=>Object({value:a,name:ga(`panels.sensors.cards.editor.fields.device_type.choose.${a}.name`,this.hass.language),description:ga(`panels.sensors.cards.editor.fields.device_type.choose.${a}.description`,this.hass.language),icon:Ma[e]}))} + label=${ga("panels.sensors.cards.editor.fields.device_type.heading",this.hass.language)} clearable=${!0} icons=${!0} value=${this.data.type} - @value-changed=${e=>this.setType(e.target.value||pa.Other)} + @value-changed=${e=>this.setType(e.target.value||Ta.Other)} > ${la("panels.sensors.cards.editor.fields.modes.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.modes.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.modes.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.modes.description",this.hass.language)}
${this.modesByArea(this.data.area).map(e=>L` {var a,t;this.data={...this.data,modes:this.data.modes.includes(e)?(a=this.data.modes,t=e,a.filter(e=>e!==t)):$a(this.data.modes.concat([e]))}}} + @click=${()=>{var a,t;this.data={...this.data,modes:this.data.modes.includes(e)?(a=this.data.modes,t=e,a.filter(e=>e!==t)):Da(this.data.modes.concat([e]))}}} > - - ${la("common.modes_short."+e,this.hass.language)} + + ${ga("common.modes_short."+e,this.hass.language)} `)}
@@ -1251,15 +1263,15 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a - ${!this.data.type||[pa.Environmental,pa.Other].includes(this.data.type)?L` + ${!this.data.type||[Ta.Environmental,Ta.Other].includes(this.data.type)?L` ${la("panels.sensors.cards.editor.fields.always_on.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.always_on.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.always_on.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.always_on.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""} - ${!this.data.type||[pa.Door,pa.Other].includes(this.data.type)?L` + ${!this.data.type||[Ta.Door,Ta.Other].includes(this.data.type)?L` ${la("panels.sensors.cards.editor.fields.arm_on_close.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.arm_on_close.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.arm_on_close.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.arm_on_close.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""} - ${!this.data.type||[pa.Window,pa.Door,pa.Motion,pa.Tamper,pa.Other].includes(this.data.type)?L` + ${!this.data.type||[Ta.Window,Ta.Door,Ta.Motion,Ta.Tamper,Ta.Other].includes(this.data.type)?L` ${la("panels.sensors.cards.editor.fields.immediate.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.immediate.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.immediate.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.immediate.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""} - ${!this.data.type||[pa.Motion,pa.Other].includes(this.data.type)?L` + ${!this.data.type||[Ta.Motion,Ta.Other].includes(this.data.type)?L` ${la("panels.sensors.cards.editor.fields.allow_open.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.allow_open.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.allow_open.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.allow_open.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""} - ${!this.data.type||[pa.Window,pa.Other].includes(this.data.type)?L` + ${!this.data.type||[Ta.Window,Ta.Other].includes(this.data.type)?L` ${la("panels.sensors.cards.editor.fields.auto_bypass.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.auto_bypass.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.auto_bypass.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.auto_bypass.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.sensors.cards.editor.fields.trigger_unavailable.heading",this.hass.language)}${ga("panels.sensors.cards.editor.fields.trigger_unavailable.heading",this.hass.language)} ${la("panels.sensors.cards.editor.fields.trigger_unavailable.description",this.hass.language)}${ga("panels.sensors.cards.editor.fields.trigger_unavailable.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a - ${la("panels.sensors.cards.editor.actions.remove",this.hass.language)} + ${ga("panels.sensors.cards.editor.actions.remove",this.hass.language)}
- `}modesByArea(e){const a=Object.keys(this.areas).reduce((e,a)=>Object.assign(e,{[a]:Object.entries(this.areas[a].modes).filter(([,e])=>e.enabled).map(([e])=>e)}),{});return e?a[e]:Object.values(a).reduce((e,a)=>e.filter(e=>a.includes(e)))}setType(e){const a=e!=pa.Other?lt(this.modesByArea(this.data.area))[e]:{};this.data=Object.assign(Object.assign(Object.assign({},this.data),{type:e}),a)}deleteClick(e){var a,t;(a=this.hass,t=this.item,a.callApi("POST","alarmo/sensors",{entity_id:t,remove:!0})).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}saveClick(e){const a=[];this.data.area||a.push(la("panels.sensors.cards.editor.errors.no_area",this.hass.language)),this.data.modes.length||this.data.always_on||a.push(la("panels.sensors.cards.editor.errors.no_modes",this.hass.language)),a.length?Sa(e,L` - ${la("panels.sensors.cards.editor.errors.description",this.hass.language)} + `}modesByArea(e){const a=Object.keys(this.areas).reduce((e,a)=>Object.assign(e,{[a]:Object.entries(this.areas[a].modes).filter(([,e])=>e.enabled).map(([e])=>e)}),{});return e?a[e]:Object.values(a).reduce((e,a)=>e.filter(e=>a.includes(e)))}setType(e){const a=e!=Ta.Other?pt(this.modesByArea(this.data.area))[e]:{};this.data=Object.assign(Object.assign(Object.assign({},this.data),{type:e}),a)}deleteClick(e){var a,t;(a=this.hass,t=this.item,a.callApi("POST","alarmo/sensors",{entity_id:t,remove:!0})).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()})}saveClick(e){const a=[];this.data.area||a.push(ga("panels.sensors.cards.editor.errors.no_area",this.hass.language)),this.data.modes.length||this.data.always_on||a.push(ga("panels.sensors.cards.editor.errors.no_modes",this.hass.language)),a.length?Fa(e,L` + ${ga("panels.sensors.cards.editor.errors.description",this.hass.language)}
    ${a.map(e=>L`
  • ${e}
  • `)}
- `):La(this.hass,Object.assign({},this.data)).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}cancelClick(){qe(0,"/alarmo/sensors",!0)}};ht.styles=Pe,a([Z()],ht.prototype,"hass",void 0),a([Z()],ht.prototype,"narrow",void 0),a([Z()],ht.prototype,"item",void 0),a([Z()],ht.prototype,"data",void 0),ht=a([G("sensor-editor-card")],ht);let ut=class extends re{constructor(){super(...arguments),this.items=[],this.value=null}render(){return L` + `):ya(this.hass,Object.assign({},this.data)).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()})}cancelClick(){Ee(0,"/alarmo/sensors",!0)}};vt.styles=Pe,a([Z()],vt.prototype,"hass",void 0),a([Z()],vt.prototype,"narrow",void 0),a([Z()],vt.prototype,"item",void 0),a([Z()],vt.prototype,"data",void 0),vt=a([G("sensor-editor-card")],vt);let _t=class extends re{constructor(){super(...arguments),this.items=[],this.value=null,this.selectable=!1}render(){return L` ${this.items.map(e=>L` -
this.selectItem(e.value)}> - ${void 0!==e.count?L` - ${e.count>99?99:e.count} - `:""} - ${e.name} +
this.selectItem(e.value)} + > + ${this.renderBadge(e)} + + ${e.name} +
`)} - `}selectItem(e){this.value=this.value==e?null:e,Te(this,"value-changed")}static get styles(){return se` + `}renderBadge(e){return L` + ${void 0!==e.count?L`${e.count>99?99:e.count}`:""} + `}renderIcon(e){return L` + `}selectItem(e){this.selectable&&(this.value=this.value==e?null:e),Te(this,"value-changed",{value:e})}static get styles(){return se` :host { } .chip { @@ -1396,6 +1414,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a height: 32px; min-width: 35px; font-weight: 500; + font-size: 0.9rem; cursor: pointer; user-select: none; } @@ -1411,7 +1430,7 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a width: 20px; justify-content: center; align-items: flex-start; - font-size: 12px; + font-size: 0.8rem; line-height: 20px; } .chip:hover { @@ -1430,20 +1449,20 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a .chip.selected:active { background: rgba(var(--rgb-primary-color), 0.74); } - `}};a([Z({attribute:!1})],ut.prototype,"hass",void 0),a([Z()],ut.prototype,"items",void 0),a([Z()],ut.prototype,"value",void 0),ut=a([G("alarmo-chips")],ut);let mt=class extends(Ha(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.addSelection=[],this.showAllSensorEntities=!1,this.areaFilterOptions=[]}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){this.hass&&(this.areas=await Ia(this.hass),this.sensors=await za(this.hass),this.areaFilterOptions=[{value:"no_area",name:la("panels.sensors.cards.sensors.filter.no_area",this.hass.language),count:Object.values(this.sensors).filter(e=>!e.area).length}].concat(Object.values(this.areas).map(e=>Object({value:e.area_id,name:e.name,count:Object.values(this.sensors).filter(a=>a.area==e.area_id).length})).sort((e,a)=>e.name.toLowerCase(){await Ne()})(),this.path&&2==this.path.length&&"filter"==this.path[0]&&(this.selectedArea=this.path[1])}render(){return this.hass?this.path&&2==this.path.length&&"edit"==this.path[0]?L` + `}};a([Z()],_t.prototype,"items",void 0),a([Z()],_t.prototype,"value",void 0),a([Z({type:Boolean})],_t.prototype,"selectable",void 0),_t=a([G("alarmo-chips")],_t);let ft=class extends(Ya(re)){constructor(){super(...arguments),this.areas={},this.sensors={},this.addSelection=[],this.showAllSensorEntities=!1,this.areaFilterOptions=[]}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){this.hass&&(this.areas=await xa(this.hass),this.sensors=await _a(this.hass),this.areaFilterOptions=Object.values(this.areas).map(e=>Object({value:e.area_id,name:e.name,count:Object.values(this.sensors).filter(a=>a.area==e.area_id).length})).sort((e,a)=>e.name.toLowerCase()!e.area).length&&(this.areaFilterOptions=[{value:"no_area",name:ga("panels.sensors.cards.sensors.filter.no_area",this.hass.language),count:Object.values(this.sensors).filter(e=>!e.area).length},...this.areaFilterOptions]))}firstUpdated(){(async()=>{await De()})(),this.path&&2==this.path.length&&"filter"==this.path[0]&&(this.selectedArea=this.path[1])}render(){return this.hass?this.path&&2==this.path.length&&"edit"==this.path[0]?L` `:L` ${this.sensorsPanel()} ${this.addSensorsPanel()} - `:L``}sensorsPanel(){if(!this.hass)return L``;const e=Object.keys(this.sensors).map(e=>{const a=this.hass.states[e];return{id:e,name:ya(a),icon:ba(a)}});e.sort((e,a)=>e.name.toLowerCase()!this.selectedArea||!this.areaFilterOptions.find(e=>e.value==this.selectedArea)||this.sensors[e.id].area==this.selectedArea||"no_area"===this.selectedArea&&!this.sensors[e.id].area).map(e=>{const a=Object.entries(pa).find(([,a])=>a==this.sensors[e.id].type)[0];return{icon:L` + `:L``}sensorsPanel(){if(!this.hass)return L``;const e=Object.keys(this.sensors).map(e=>{const a=this.hass.states[e];return{id:e,name:za(a),icon:Ea(a)}});e.sort((e,a)=>e.name.toLowerCase()!this.selectedArea||!this.areaFilterOptions.find(e=>e.value==this.selectedArea)||this.sensors[e.id].area==this.selectedArea||"no_area"===this.selectedArea&&!this.sensors[e.id].area).map(e=>{const a=Object.entries(Ta).find(([,a])=>a==this.sensors[e.id].type)[0];return{icon:L` - ${la(`panels.sensors.cards.editor.fields.device_type.choose.${pa[a]}.name`,this.hass.language)} + ${ga(`panels.sensors.cards.editor.fields.device_type.choose.${Ta[a]}.name`,this.hass.language)} - + `,name:L` - ${this.sensors[e.id].name||wa(e.name)} + ${this.sensors[e.id].name||Na(e.name)} ${e.id} `,id:e.id,modes:L` - ${this.sensors[e.id].always_on?la("panels.sensors.cards.sensors.table.always_on",this.hass.language):Object.values(va).filter(a=>this.sensors[e.id].modes.includes(a)).map(e=>la("common.modes_short."+e,this.hass.language)).join(", ")} + ${this.sensors[e.id].always_on?ga("panels.sensors.cards.sensors.table.always_on",this.hass.language):Object.values(Le).filter(a=>this.sensors[e.id].modes.includes(a)).map(e=>ga("common.modes_short."+e,this.hass.language)).join(", ")} `,enabled:L` {e.stopPropagation()}} @@ -1452,19 +1471,20 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a > `}});return L` - +
- ${la("panels.sensors.cards.sensors.description",this.hass.language)} + ${ga("panels.sensors.cards.sensors.description",this.hass.language)}
${this.areaFilterOptions.length>1?L`
${la("panels.sensors.cards.sensors.filter.label",this.hass.language)}:${ga("panels.sensors.cards.sensors.filter.label",this.hass.language)}: this.selectedArea=e.target.value} > @@ -1474,12 +1494,12 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ?selectable=${!0} .columns=${a} .data=${t} - @row-click=${e=>{const a=String(e.detail.id);qe(0,"/alarmo/sensors/edit/"+a,!0)}} + @row-click=${e=>{const a=String(e.detail.id);Ee(0,"/alarmo/sensors/edit/"+a,!0)}} > - ${la("panels.sensors.cards.sensors.no_items",this.hass.language)} + ${ga("panels.sensors.cards.sensors.no_items",this.hass.language)} - `}addSensorsPanel(){if(!this.hass)return L``;const e=Object.values(this.hass.states).filter(e=>dt(e,this.showAllSensorEntities)).filter(e=>!Object.keys(this.sensors).includes(e.entity_id)).map(e=>Object({id:e.entity_id,name:ya(e),icon:ba(e)}));e.sort((e,a)=>e.name.toLowerCase()({checkbox:L` + `}addSensorsPanel(){if(!this.hass)return L``;const e=Object.values(this.hass.states).filter(e=>ut(e,this.showAllSensorEntities)).filter(e=>!Object.keys(this.sensors).includes(e.entity_id)).map(e=>Object({id:e.entity_id,name:za(e),icon:Ea(e)}));e.sort((e,a)=>e.name.toLowerCase()({checkbox:L` this.toggleSelect(a,e.id)} ?checked=${this.addSelection.includes(e.id)} @@ -1487,10 +1507,10 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `,icon:L` - `,name:wa(e.name),id:e.id}));return L` - + `,name:Na(e.name),id:e.id}));return L` +
- ${la("panels.sensors.cards.add_sensors.description",this.hass.language)} + ${ga("panels.sensors.cards.add_sensors.description",this.hass.language)}
@@ -1499,39 +1519,39 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a style="padding: 0px 8px" > - ${la("panels.sensors.cards.add_sensors.actions.show_all",this.hass.language)} + ${ga("panels.sensors.cards.add_sensors.actions.show_all",this.hass.language)}
- ${la("panels.sensors.cards.add_sensors.no_items",this.hass.language)} + ${ga("panels.sensors.cards.add_sensors.no_items",this.hass.language)}
- ${la("panels.sensors.cards.add_sensors.actions.add_to_alarm",this.hass.language)} + ${ga("panels.sensors.cards.add_sensors.actions.add_to_alarm",this.hass.language)}
- `}toggleSelect(e,a){const t=e.target.checked;this.addSelection=t&&!this.addSelection.includes(a)?[...this.addSelection,a]:t?this.addSelection:this.addSelection.filter(e=>e!=a)}toggleEnabled(e,a){const t=e.target.checked;La(this.hass,{entity_id:a,enabled:t}).catch(a=>Oa(a,e)).then()}addSelected(e){if(!this.hass)return;const a=Object.values(this.areas).map(e=>Object.entries(e.modes).filter(([,e])=>e.enabled).map(([e])=>e)).reduce((e,a)=>e.filter(e=>a.includes(e)));this.addSelection.map(e=>ct(this.hass.states[e],a)).map(e=>1==Object.keys(this.areas).length?Object.assign(e,{area:Object.keys(this.areas)[0]}):e).filter(e=>e).forEach(a=>{La(this.hass,a).catch(a=>Oa(a,e)).then()}),this.addSelection=[]}};mt.styles=Pe,a([Z()],mt.prototype,"narrow",void 0),a([Z()],mt.prototype,"path",void 0),a([Z()],mt.prototype,"areas",void 0),a([Z()],mt.prototype,"sensors",void 0),a([Z()],mt.prototype,"addSelection",void 0),a([Z()],mt.prototype,"showAllSensorEntities",void 0),a([Z()],mt.prototype,"selectedArea",void 0),a([Z()],mt.prototype,"areaFilterOptions",void 0),mt=a([G("alarm-view-sensors")],mt);let pt=class extends re{async firstUpdated(){if(this.users=await Da(this.hass),this.data={name:"",code:"",old_code:"",confirm_code:"",is_admin:!1,can_arm:!0,can_disarm:!0,is_override_code:!1},this.item){const e=this.users[this.item];this.data=Object.assign(Object.assign({},this.data),ka(e,["name","is_admin","can_arm","can_disarm","is_override_code"]))}}render(){return this.data?L` + `}toggleSelect(e,a){const t=e.target.checked;this.addSelection=t&&!this.addSelection.includes(a)?[...this.addSelection,a]:t?this.addSelection:this.addSelection.filter(e=>e!=a)}toggleEnabled(e,a){const t=e.target.checked;ya(this.hass,{entity_id:a,enabled:t}).catch(a=>Ia(a,e)).then()}addSelected(e){if(!this.hass)return;const a=Object.values(this.areas).map(e=>Object.entries(e.modes).filter(([,e])=>e.enabled).map(([e])=>e)).reduce((e,a)=>e.filter(e=>a.includes(e)));this.addSelection.map(e=>gt(this.hass.states[e],a)).map(e=>1==Object.keys(this.areas).length?Object.assign(e,{area:Object.keys(this.areas)[0]}):e).filter(e=>e).forEach(a=>{ya(this.hass,a).catch(a=>Ia(a,e)).then()}),this.addSelection=[]}};ft.styles=Pe,a([Z()],ft.prototype,"narrow",void 0),a([Z()],ft.prototype,"path",void 0),a([Z()],ft.prototype,"areas",void 0),a([Z()],ft.prototype,"sensors",void 0),a([Z()],ft.prototype,"addSelection",void 0),a([Z()],ft.prototype,"showAllSensorEntities",void 0),a([Z()],ft.prototype,"selectedArea",void 0),a([Z()],ft.prototype,"areaFilterOptions",void 0),ft=a([G("alarm-view-sensors")],ft);let bt=class extends re{async firstUpdated(){if(this.users=await fa(this.hass),this.data={name:"",code:"",old_code:"",confirm_code:"",is_admin:!1,can_arm:!0,can_disarm:!0,is_override_code:!1},this.item){const e=this.users[this.item];this.data=Object.assign(Object.assign({},this.data),Pa(e,["name","is_admin","can_arm","can_disarm","is_override_code"]))}}render(){return this.data?L`
- ${this.item?la("panels.codes.cards.edit_user.title",this.hass.language):la("panels.codes.cards.new_user.title",this.hass.language)} + ${this.item?ga("panels.codes.cards.edit_user.title",this.hass.language):ga("panels.codes.cards.new_user.title",this.hass.language)}
- ${this.item?la("panels.codes.cards.edit_user.description",this.hass.language,"{name}",this.users[this.item].name):la("panels.codes.cards.new_user.description",this.hass.language)} + ${this.item?ga("panels.codes.cards.edit_user.description",this.hass.language,"{name}",this.users[this.item].name):ga("panels.codes.cards.new_user.description",this.hass.language)}
- ${la("panels.codes.cards.new_user.fields.name.heading",this.hass.language)} + ${ga("panels.codes.cards.new_user.fields.name.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.name.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.name.description",this.hass.language)} this.data={...this.data,name:e.target.value}} @@ -1542,14 +1562,14 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${this.item?L` ${la("panels.codes.cards.edit_user.fields.old_code.heading",this.hass.language)}${ga("panels.codes.cards.edit_user.fields.old_code.heading",this.hass.language)} ${la("panels.codes.cards.edit_user.fields.old_code.description",this.hass.language)}${ga("panels.codes.cards.edit_user.fields.old_code.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${this.item&&!this.data.old_code.length?"":L` ${la("panels.codes.cards.new_user.fields.code.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.code.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.code.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.code.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.new_user.fields.confirm_code.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.confirm_code.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.confirm_code.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.confirm_code.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.new_user.fields.is_admin.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.is_admin.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.is_admin.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.is_admin.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.new_user.fields.can_arm.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.can_arm.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.can_arm.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.can_arm.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.new_user.fields.can_disarm.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.can_disarm.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.can_disarm.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.can_disarm.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.new_user.fields.is_override_code.heading",this.hass.language)}${ga("panels.codes.cards.new_user.fields.is_override_code.heading",this.hass.language)} ${la("panels.codes.cards.new_user.fields.is_override_code.description",this.hass.language)}${ga("panels.codes.cards.new_user.fields.is_override_code.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `:""}
- `:L``}deleteClick(e){var a,t;this.item&&(a=this.hass,t=this.item,a.callApi("POST","alarmo/users",{user_id:t,remove:!0})).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}saveClick(e){if(this.data)if(this.data.name.length)if(this.data.code.length<4&&(!this.item||this.data.old_code.length))Sa(e,la("panels.codes.cards.new_user.errors.no_code",this.hass.language));else if(this.data.code!==this.data.confirm_code)Sa(e,la("panels.codes.cards.new_user.errors.code_mismatch",this.hass.language));else if(this.data.is_admin&&(this.data=Object.assign(Object.assign({},this.data),{can_arm:!0,can_disarm:!0})),this.item){let a=Object.assign(Object.assign({},ka(this.data,["name","is_admin","can_arm","can_disarm"])),{user_id:this.item});this.data.old_code.length&&(a=Object.assign(Object.assign({},a),{old_code:this.data.old_code,code:this.data.code})),Ra(this.hass,a).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}else Ra(this.hass,Aa(this.data,["confirm_code","old_code"])).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()});else Sa(e,la("panels.codes.cards.new_user.errors.no_name",this.hass.language))}cancelClick(){qe(0,"/alarmo/codes",!0)}};pt.styles=Pe,a([Z()],pt.prototype,"hass",void 0),a([Z()],pt.prototype,"narrow",void 0),a([Z()],pt.prototype,"item",void 0),a([Z()],pt.prototype,"data",void 0),pt=a([G("user-editor-card")],pt);let gt=class extends(Ha(re)){constructor(){super(...arguments),this.users={},this.code_arm_required=!1,this.code_disarm_required=!1,this.code_format="number"}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){if(!this.hass)return;const e=await qa(this.hass);this.config=e,this.code_arm_required=e.code_arm_required,this.code_disarm_required=e.code_disarm_required,this.code_format=e.code_format;const a=await Da(this.hass);this.users=a}render(){return this.hass?this.path&&"new_user"==this.path[0]?L` + `:L``}deleteClick(e){var a,t;this.item&&(a=this.hass,t=this.item,a.callApi("POST","alarmo/users",{user_id:t,remove:!0})).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()})}saveClick(e){if(this.data)if(this.data.name.length)if(this.data.code.length<4&&(!this.item||this.data.old_code.length))Fa(e,ga("panels.codes.cards.new_user.errors.no_code",this.hass.language));else if(this.data.code!==this.data.confirm_code)Fa(e,ga("panels.codes.cards.new_user.errors.code_mismatch",this.hass.language));else if(this.data.is_admin&&(this.data=Object.assign(Object.assign({},this.data),{can_arm:!0,can_disarm:!0})),this.item){let a=Object.assign(Object.assign({},Pa(this.data,["name","is_admin","can_arm","can_disarm"])),{user_id:this.item});this.data.old_code.length&&(a=Object.assign(Object.assign({},a),{old_code:this.data.old_code,code:this.data.code})),$a(this.hass,a).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()})}else $a(this.hass,La(this.data,"confirm_code","old_code")).catch(a=>Ia(a,e)).then(()=>{this.cancelClick()});else Fa(e,ga("panels.codes.cards.new_user.errors.no_name",this.hass.language))}cancelClick(){Ee(0,"/alarmo/codes",!0)}};bt.styles=Pe,a([Z()],bt.prototype,"hass",void 0),a([Z()],bt.prototype,"narrow",void 0),a([Z()],bt.prototype,"item",void 0),a([Z()],bt.prototype,"data",void 0),bt=a([G("user-editor-card")],bt);let wt=class extends(Ya(re)){constructor(){super(...arguments),this.users={},this.code_arm_required=!1,this.code_disarm_required=!1,this.code_format="number"}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){if(!this.hass)return;const e=await va(this.hass);this.config=e,this.code_arm_required=e.code_arm_required,this.code_disarm_required=e.code_disarm_required,this.code_format=e.code_format;const a=await fa(this.hass);this.users=a}render(){return this.hass?this.path&&"new_user"==this.path[0]?L` `:this.path&&2==this.path.length&&"edit_user"==this.path[0]?L` `:L` - +
- ${la("panels.codes.cards.codes.description",this.hass.language)} + ${ga("panels.codes.cards.codes.description",this.hass.language)}
${la("panels.codes.cards.codes.fields.code_arm_required.heading",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_arm_required.heading",this.hass.language)} ${la("panels.codes.cards.codes.fields.code_arm_required.description",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_arm_required.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.codes.fields.code_disarm_required.heading",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_disarm_required.heading",this.hass.language)} ${la("panels.codes.cards.codes.fields.code_disarm_required.description",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_disarm_required.description",this.hass.language)} (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ${la("panels.codes.cards.codes.fields.code_format.heading",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_format.heading",this.hass.language)} ${la("panels.codes.cards.codes.fields.code_format.description",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_format.description",this.hass.language)} {this.code_format="number"}} ?disabled=${!this.code_arm_required&&!this.code_disarm_required} - >${la("panels.codes.cards.codes.fields.code_format.code_format_number",this.hass.language)}${ga("panels.codes.cards.codes.fields.code_format.code_format_number",this.hass.language)} {this.code_format="text"}} ?disabled=${!this.code_arm_required&&!this.code_disarm_required} > - ${la("panels.codes.cards.codes.fields.code_format.code_format_text",this.hass.language)} @@ -1738,429 +1758,686 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a
${this.usersPanel()} - `:L``}usersPanel(){if(!this.hass)return L``;const e=Object.values(this.users);e.sort((e,a)=>e.name.toLowerCase()({id:e.user_id,icon:L` + `:L``}usersPanel(){if(!this.hass)return L``;const e=Object.values(this.users);e.sort((e,a)=>e.name.toLowerCase()({id:e.user_id,icon:L` - `,name:wa(e.name),remarks:e.is_admin?la("panels.codes.cards.user_management.table.administrator",this.hass.language):""}));return L` - + `,name:Na(e.name),remarks:e.is_admin?ga("panels.codes.cards.user_management.table.administrator",this.hass.language):""}));return L` +
- ${la("panels.codes.cards.user_management.description",this.hass.language)} + ${ga("panels.codes.cards.user_management.description",this.hass.language)}
{const a=String(e.detail.id);qe(0,"/alarmo/codes/edit_user/"+a,!0)}} + @row-click=${e=>{const a=String(e.detail.id);Ee(0,"/alarmo/codes/edit_user/"+a,!0)}} > - ${la("panels.codes.cards.user_management.no_items",this.hass.language)} + ${ga("panels.codes.cards.user_management.no_items",this.hass.language)}
- ${la("panels.codes.cards.user_management.actions.new_user",this.hass.language)} + ${ga("panels.codes.cards.user_management.actions.new_user",this.hass.language)}
- `}addUserClick(){qe(0,"/alarmo/codes/new_user",!0)}saveClick(e){this.hass&&Pa(this.hass,{code_arm_required:this.code_arm_required,code_disarm_required:this.code_disarm_required,code_format:this.code_format}).catch(a=>Oa(a,e)).then()}};gt.styles=Pe,a([Z()],gt.prototype,"narrow",void 0),a([Z()],gt.prototype,"path",void 0),a([Z()],gt.prototype,"config",void 0),a([Z()],gt.prototype,"users",void 0),a([Z()],gt.prototype,"code_arm_required",void 0),a([Z()],gt.prototype,"code_disarm_required",void 0),a([Z()],gt.prototype,"code_format",void 0),gt=a([G("alarm-view-codes")],gt);let vt=class extends re{constructor(){super(...arguments),this.label="",this.options=[],this.value=[],this.numOptions=1}firstUpdated(){this.value||(this.value=[]),this.value.length>1&&(this.numOptions=this.value.length)}render(){return L` -
- ${[...Array(this.numOptions).keys()].map(e=>this.renderSelect(e))} -
- `}renderSelect(e){return L` -
- - this.selectedChange(a,e)} + `}addUserClick(){Ee(0,"/alarmo/codes/new_user",!0)}saveClick(e){this.hass&&wa(this.hass,{code_arm_required:this.code_arm_required,code_disarm_required:this.code_disarm_required,code_format:this.code_format}).catch(a=>Ia(a,e)).then()}};wt.styles=Pe,a([Z()],wt.prototype,"narrow",void 0),a([Z()],wt.prototype,"path",void 0),a([Z()],wt.prototype,"config",void 0),a([Z()],wt.prototype,"users",void 0),a([Z()],wt.prototype,"code_arm_required",void 0),a([Z()],wt.prototype,"code_disarm_required",void 0),a([Z()],wt.prototype,"code_format",void 0),wt=a([G("alarm-view-codes")],wt);const yt=(e,a)=>{switch(e){case Le.ArmedAway:return{value:Le.ArmedAway,name:ga("common.modes_long.armed_away",a.language),icon:ja.ArmedAway};case Le.ArmedHome:return{value:Le.ArmedHome,name:ga("common.modes_long.armed_home",a.language),icon:ja.ArmedHome};case Le.ArmedNight:return{value:Le.ArmedNight,name:ga("common.modes_long.armed_night",a.language),icon:ja.ArmedNight};case Le.ArmedCustom:return{value:Le.ArmedCustom,name:ga("common.modes_long.armed_custom_bypass",a.language),icon:ja.ArmedCustom}}},$t=(e,a)=>{switch(e){case Re.Armed:return{value:Re.Armed,name:ga("panels.actions.cards.new_notification.fields.event.choose.armed.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.armed.description",a.language),icon:"hass:shield-check-outline"};case Re.Disarmed:return{value:Re.Disarmed,name:ga("panels.actions.cards.new_notification.fields.event.choose.disarmed.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.disarmed.description",a.language),icon:"hass:shield-off-outline"};case Re.Triggered:return{value:Re.Triggered,name:ga("panels.actions.cards.new_notification.fields.event.choose.triggered.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.triggered.description",a.language),icon:"hass:bell-alert-outline"};case Re.ArmFailure:return{value:Re.ArmFailure,name:ga("panels.actions.cards.new_notification.fields.event.choose.arm_failure.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.arm_failure.description",a.language),icon:"hass:alert-outline"};case Re.Arming:return{value:Re.Arming,name:ga("panels.actions.cards.new_notification.fields.event.choose.arming.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.arming.description",a.language),icon:"hass:home-export-outline"};case Re.Pending:return{value:Re.Pending,name:ga("panels.actions.cards.new_notification.fields.event.choose.pending.name",a.language),description:ga("panels.actions.cards.new_notification.fields.event.choose.pending.description",a.language),icon:"hass:home-import-outline"}}},kt=(e,a,t)=>0==e?{name:t.master.name,value:0}:Object.keys(a).includes(String(e))?{name:a[e].name,value:e}:{name:String(e),value:e},At=(e,...a)=>{let t=a.map(a=>{if(!a)return null;const t=je(a),i=Ce(a);let s={value:a,name:i.replace(/_/g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+e.substring(1)).join(" "),icon:"hass:home",description:a};switch(t){case"notify":const a=e.states["device_tracker."+i.replace("mobile_app_","")];s=a?Object.assign(Object.assign({},s),{name:a.attributes.friendly_name||Ce(a.entity_id),icon:a.attributes.icon||"hass:cellphone-text"}):Object.assign(Object.assign({},s),{icon:"hass:comment-alert"});break;case"tts":s=Object.assign(Object.assign({},s),{icon:"hass:microphone"})}return s}).filter(Ra);return t.sort((e,a)=>e.name.toLowerCase(){let t=[];const i=Object.keys(e).filter(a=>Object.values(e[a].modes).some(e=>e.enabled));return a.master.enabled&&i.length>1&&(t=[...t,0]),t=[...t,...i],t},St=(e,a)=>{const t=e=>Object.keys(e.modes).filter(a=>e.modes[a].enabled);if(Ra(e)&&Object.keys(a).includes(String(e)))return t(a[e]);{const e=Object.keys(a).map(e=>t(a[e]));return e[0].filter(a=>e.every(e=>e.includes(a)))}},jt=(e,a)=>{let t=e.map(e=>({value:e,name:e in a.states?a.states[e].attributes.friendly_name||Ce(e):e,icon:e in a.states?a.states[e].attributes.icon||qe(je(e)):void 0,description:e}));return t.sort((e,a)=>e.name.toLowerCase()[...Object.keys(e.services.notify).map(e=>"notify."+e)],Ot=e=>[...Object.keys(e.states).filter(e=>["light","switch","input_boolean","script"].includes(je(e)))],Tt=e=>"string"==typeof e&&e.trim().length,Mt=(e,a)=>Tt(e)&&a.services[je(e)]&&a.services[je(e)][Ce(e)],qt=(e,a)=>Tt(e)&&a.states[e],Et=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Nt=e=>"string"==typeof e;let zt=class extends re{constructor(){super(...arguments),this.items=[],this.value=[],this.label="",this.invalid=!1}shouldUpdate(e){return e.get("items")&&(Ua(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)),Te(this,"value-changed",{value:this.value}))}render(){return L` +
+ ${this.value.length?this.value.map(e=>this.items.find(a=>a.value==e)).filter(Ra).map(e=>L` +
+ + + + ${e.name} + + this._removeClick(e.value)}> + + +
+ `):""} + !this.value.includes(e.value))} + ?disabled=${this.value.length==this.items.length} + label=${this.label} + icons=${!0} + @value-changed=${this._addClick} + ?invalid=${this.invalid&&this.value.length!=this.items.length} > - ${this.renderOptions(e)} - - - ${this.renderButton(e)} + +
+ `}_removeClick(e){this.value=this.value.filter(a=>a!==e),Te(this,"value-changed",{value:this.value})}_addClick(e){e.stopPropagation();const a=e.target,t=a.value;this.value.includes(t)||(this.value=[...this.value,t]),a.value="",Te(this,"value-changed",{value:[...this.value]})}static get styles(){return se` + div.chip { + height: 32px; + border-radius: 16px; + border: 2px solid rgb(168, 232, 251); + 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; + } + `}};var Dt;a([Z()],zt.prototype,"hass",void 0),a([Z()],zt.prototype,"items",void 0),a([Z({type:Array})],zt.prototype,"value",void 0),a([Z()],zt.prototype,"label",void 0),a([Z({type:Boolean})],zt.prototype,"invalid",void 0),zt=a([G("alarmo-selector")],zt),function(e){e[e.Yaml=0]="Yaml",e[e.UI=1]="UI"}(Dt||(Dt={}));let Pt=class extends re{constructor(){super(...arguments),this.config={type:qa.Notification,triggers:[{}],actions:[{}]},this.viewMode=Dt.UI,this.errors={}}async firstUpdated(){var e;if(this.areas=await xa(this.hass),this.alarmoConfig=await va(this.hass),this.item&&(this.config=Object.assign({},this.item),this.config.triggers.length>1&&(this.config=Object.assign(Object.assign({},this.config),{triggers:[this.config.triggers[0]]})),(null===(e=this.config.triggers[0].modes)||void 0===e?void 0:e.length)||this._setModes(new CustomEvent("value-changed",{detail:{value:St(this.config.triggers[0].area,this.areas)}})),null===this.config.triggers[0].area&&this._setArea(new CustomEvent("value-changed",{detail:{value:0}}))),!Ra(this.config.triggers[0].area)){const e=xt(this.areas,this.alarmoConfig);1==e.length?this._setArea(new CustomEvent("value-changed",{detail:{value:e[0]}})):e.includes(0)&&this._setArea(new CustomEvent("value-changed",{detail:{value:0}}))}}render(){var e,a,t;return this.hass&&this.areas?L` +
+ +
${ga("panels.actions.cards.new_notification.title",this.hass.language)}
+
${ga("panels.actions.cards.new_notification.description",this.hass.language)}
- `}renderButton(e){return e!=this.numOptions-1||e==this.options.length-1?L` - this.removeOption(e)}> - `:this.value&&this.value.length>e?L` - - `:L` - - `}renderOptions(e){const a=this.value.slice(0,e).concat(this.value.slice(e+1));return this.options.filter(e=>e.value).map(e=>L` - - ${e.name||e.value} - - `)}getSelected(e){return this.options.filter(e=>e.value).findIndex(a=>a.value==this.value[e])}selectedChange(e,a){if(!e.target.selectedItem)return;const t=e.target.selectedItem.getAttribute("value"),i=this.value.length==a?[...this.value,t]:this.value.slice(0,a).concat(t,this.value.slice(a+1));if(xa(i,this.value))return;this.value=i;const s=new CustomEvent("change");this.dispatchEvent(s)}addOption(){this.numOptions=this.numOptions+1}removeOption(e){this.numOptions=this.numOptions-1,e==this.value.length-1?this.value=this.value.slice(0,e):this.value=this.value.slice(0,e).concat(this.value.slice(e+1))}};vt.styles=se` - ha-icon { - padding: 4px; - display: inline-block; - vertical-align: bottom; - cursor: pointer; - } +
${ga("panels.actions.cards.new_notification.trigger",this.hass.language)}
+ +
+ + + ${ga("panels.actions.cards.new_notification.fields.event.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.event.description",this.hass.language)} + - ha-icon.disabled { - color: var(--disabled-text-color); - } + $t(e,this.hass))} + label=${ga("panels.actions.cards.new_action.fields.event.heading",this.hass.language)} + icons=${!0} + .value=${this.config.triggers[0].event} + @value-changed=${this._setEvent} + ?invalid=${this.errors.event} + > + - div.container { - display: flex; - flex-direction: column; - } - `,a([Z()],vt.prototype,"label",void 0),a([Z()],vt.prototype,"options",void 0),a([Z()],vt.prototype,"value",void 0),a([Z({type:Boolean})],vt.prototype,"disabled",void 0),a([Z()],vt.prototype,"numOptions",void 0),vt=a([G("alarmo-multi-select")],vt);const _t=e=>[{value:_a.Armed,name:la("panels.actions.cards.new_notification.fields.event.choose.armed.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.armed.description",e.language),icon:"hass:shield-check-outline",trigger:{state:_a.Armed}},{value:_a.Disarmed,name:la("panels.actions.cards.new_notification.fields.event.choose.disarmed.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.disarmed.description",e.language),icon:"hass:shield-off-outline",trigger:{state:_a.Disarmed}},{value:_a.Triggered,name:la("panels.actions.cards.new_notification.fields.event.choose.triggered.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.triggered.description",e.language),icon:"hass:bell-alert-outline",trigger:{state:_a.Triggered}},{value:fa.ArmFailure,name:la("panels.actions.cards.new_notification.fields.event.choose.arm_failure.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.arm_failure.description",e.language),icon:"hass:alert-outline",trigger:{event:fa.ArmFailure}},{value:_a.Arming,name:la("panels.actions.cards.new_notification.fields.event.choose.arming.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.arming.description",e.language),icon:"hass:home-export-outline",trigger:{state:_a.Arming}},{value:_a.Pending,name:la("panels.actions.cards.new_notification.fields.event.choose.pending.name",e.language),description:la("panels.actions.cards.new_notification.fields.event.choose.pending.description",e.language),icon:"hass:home-import-outline",trigger:{state:_a.Pending}}];function ft(e){const a=Object.keys(e.services.notify).map(a=>{let t={value:"notify."+a,name:a};const i=e.states["device_tracker."+a.replace("mobile_app_","")];return i&&(t=Object.assign(Object.assign({},t),{name:i.attributes.friendly_name||Ce(i.entity_id)})),t});return a.sort((e,a)=>e.name.toLowerCase()JSON.stringify(e.trigger)===JSON.stringify(i)))return la("panels.actions.validation_errors.invalid_trigger",a.language,"{trigger}",JSON.stringify(i))}if(void 0!==e.modes&&e.modes.length)for(let t=0;te.name==a)){let e=2;for(;Object.values(t).find(t=>t.name==`${a} ${e}`);)e++;a=`${a} ${e}`}this.namePlaceholder=a,this.data.area||1!=Object.keys(e).length||(this.data=Object.assign(Object.assign({},this.data),{area:Object.keys(this.areas)[0]}))}}render(){return this.data?L` - -
-
- ${la("panels.actions.cards.new_notification.title",this.hass.language)} -
- + ${Object.keys(this.areas).length>1?L` + + + ${ga("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_action.fields.area.description",this.hass.language)} + + + kt(e,this.areas,this.alarmoConfig))} + clearable=${!0} + label=${ga("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} + .value=${this.config.triggers[0].area} + @value-changed=${this._setArea} + ?invalid=${this.errors.area} + > + + `:""} + + + + ${ga("panels.actions.cards.new_notification.fields.mode.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.mode.description",this.hass.language)} + + + yt(e,this.hass))} + label=${ga("panels.actions.cards.new_action.fields.mode.heading",this.hass.language)} + .value=${this.config.triggers[0].modes||[]} + @value-changed=${this._setModes} + ?invalid=${this.errors.modes} + > +
+
+ +
${ga("panels.actions.cards.new_notification.action",this.hass.language)}
+
- ${la("panels.actions.cards.new_notification.description",this.hass.language)} + ${this.viewMode==Dt.UI?L` + + + ${ga("panels.actions.cards.new_notification.fields.target.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.target.description",this.hass.language)} + + + + + + + + ${ga("panels.actions.cards.new_notification.fields.title.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.title.description",this.hass.language)} + + + + + + + + ${ga("panels.actions.cards.new_notification.fields.message.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.message.description",this.hass.language)} + + + + + ${this.config.triggers[0].event?L` +
+ + ${ga("panels.actions.cards.new_notification.fields.message.insert_wildcard",this.hass.language)}: + + {let a=[];return a=[],e&&![Re.Pending,Re.Triggered,Re.ArmFailure].includes(e)||(a=[...a,{name:"Open Sensors",value:"{{open_sensors}}"}]),e&&![Re.Armed].includes(e)||(a=[...a,{name:"Bypassed Sensors",value:"{{bypassed_sensors}}"}]),e&&![Re.Armed,Re.Arming,Re.Disarmed].includes(e)||(a=[...a,{name:"Changed By",value:"{{changed_by}}"}]),e&&![Re.Armed,Re.Arming,Re.Pending,Re.Triggered,Re.ArmFailure].includes(e)||(a=[...a,{name:"Arm Mode",value:"{{arm_mode}}"}]),a})(this.config.triggers[0].event)} + @value-changed=${e=>this._insertWildCard(e.detail.value)} + > +
`:""} + +
`:L` +

${ga("components.editor.edit_in_yaml",this.hass.language)}

+ + + + ${this.errors.service||this.errors.title||this.errors.message?L` + + ${this.hass.localize("ui.errors.config.key_missing","key",Object.entries(this.errors).find(([e,a])=>a&&["service","title","message"].includes(e))[0])} + + `:""} + `}
-
- - ${this.yamlMode?la("components.editor.ui_mode",this.hass.language):la("components.editor.yaml_mode",this.hass.language)} +
+ + + ${this.viewMode==Dt.Yaml?ga("components.editor.ui_mode",this.hass.language):ga("components.editor.yaml_mode",this.hass.language)}
- ${this.yamlMode?L` - {this.yamlCode=e.detail.value}} - > - - `:L` - - - ${la("panels.actions.cards.new_notification.fields.event.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.event.description",this.hass.language)} - - _t(this.hass).find(a=>JSON.stringify(a.trigger)==JSON.stringify(e)).value)[0]} - @value-changed=${e=>this.updateTriggers(e.target.value)} - > - - - - - ${this.areas&&Object.keys(this.areas).length>1?L` - - ${la("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.area.description",this.hass.language)} - - Object({value:e.area_id,name:e.name}))} - value=${this.data.area||""} - clearable=${!0} - label=${la("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} - @value-changed=${e=>this.data={...this.data,area:e.target.value}} - - `:""} - -
- - - ${la("panels.actions.cards.new_notification.fields.mode.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.mode.description",this.hass.language)} - - e.state&&e.state==_a.Disarmed)} - .options=${this.getModeList()} - .value=${this.data.modes||[]} - @change=${e=>this.updateModes(e.target.value)} - - - - - - ${la("panels.actions.cards.new_notification.fields.title.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.title.description",this.hass.language)} - - this.updateTitle(e.target.value)} - > - - - - - ${la("panels.actions.cards.new_notification.fields.message.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.message.description",this.hass.language)} - - {this.updateMessage(e.target.value)}} - > - - - - - ${la("panels.actions.cards.new_notification.fields.target.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.target.description",this.hass.language)} - - e.service)} - @change=${e=>this.updateTargets(e.target.value)} - - - - - ${la("panels.actions.cards.new_notification.fields.name.heading",this.hass.language)} - ${la("panels.actions.cards.new_notification.fields.name.description",this.hass.language)} - - this.data={...this.data,name:e.target.value}} - > - - - `} -
- - - ${this.hass.localize("ui.common.save")} + + ${ga("panels.actions.cards.new_notification.actions.test",this.hass.language)} + +
+ - ${this.item?L` - - - ${this.hass.localize("ui.common.delete")} - - `:""} +
${ga("panels.actions.cards.new_notification.options",this.hass.language)}
+ +
+ + + ${ga("panels.actions.cards.new_notification.fields.name.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.name.description",this.hass.language)} + - - ${la("panels.actions.cards.new_notification.actions.test",this.hass.language)} - - + + + + ${(null===(t=this.item)||void 0===t?void 0:t.automation_id)?L` + + + ${ga("panels.actions.cards.new_notification.fields.delete.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.delete.description",this.hass.language)} + +
+ + + ${this.hass.localize("ui.common.delete")} + +
+
+ `:""}
- `:L``}getTargetList(){return[...Object.values(ft(this.hass)),,...this.data.actions.filter(e=>!ft(this.hass).find(a=>a.value==e.service)).map(e=>Object({value:e.service}))]}getModeList(){var e;return((null===(e=this.data)||void 0===e?void 0:e.area)?this.areas[this.data.area]?Object.entries(this.areas[this.data.area].modes).filter(([,e])=>e.enabled).map(([e])=>e):[]:Object.values(this.areas).map(e=>Object.entries(e.modes).filter(([,e])=>e.enabled).map(([e])=>e)).reduce((e,a)=>e.filter(e=>a.includes(e)))).map(e=>Object({name:la("common.modes_long."+e,this.hass.language),value:e}))}updateTriggers(e){this.data=Object.assign(Object.assign({},this.data),{triggers:[_t(this.hass).find(a=>a.value==e).trigger]})}updateModes(e){this.data=Object.assign(Object.assign({},this.data),{modes:e})}updateTitle(e){this.data=Object.assign(Object.assign({},this.data),{actions:this.data.actions.map(a=>Object(Object.assign(Object.assign({},a),{service_data:Object.assign(Object.assign({},a.service_data),{title:e})})))})}updateMessage(e){this.data=Object.assign(Object.assign({},this.data),{actions:this.data.actions.map(a=>Object(Object.assign(Object.assign({},a),{service_data:Object.assign(Object.assign({},a.service_data),{message:e})})))})}updateTargets(e){this.data=Object.assign(Object.assign({},this.data),{actions:e.map(e=>Object({service:e,service_data:Object.assign({},this.data.actions[0].service_data)}))})}deleteClick(e){this.item&&Ua(this.hass,this.item).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}loadFormData(){let e=this.yamlMode?Object.assign({},this.yamlCode):this.data;return e=Object.assign(Object.assign({},e),{is_notification:!0,actions:e.actions.map(a=>!a.service_data||a.service_data.message&&a.service_data.message.length?a:Object.assign(Object.assign({},a),{service_data:Object.assign(Object.assign({},a.service_data),{message:yt(e)})})),name:e.name||this.namePlaceholder,area:e.area||""}),e}async saveClick(e){let a=this.loadFormData();const t=kt(a,this.hass);t?Sa(e,t):(this.item&&(a=Object.assign(Object.assign({},a),{automation_id:this.item})),Va(this.hass,a).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()}))}toggleYaml(){this.data&&(this.yamlMode=!this.yamlMode,!this.yamlMode&&this.yamlCode?this.data=Object.assign({},this.yamlCode):this.yamlCode=Object.assign({},this.data))}cancelClick(){qe(0,"/alarmo/actions",!0)}testClick(e){const a=this.loadFormData(),t=kt(a,this.hass);t?Sa(e,t):a.actions.forEach(a=>{const[t,i]=a.service.split(".");let s=a.service_data.message;s=s.replace("{{open_sensors}}","Some Example Sensor is open"),s=s.replace("{{bypassed_sensors}}","Some Bypassed Sensor"),s=s.replace("{{arm_mode}}","armed_away"),s=s.replace("{{changed_by}}","Some Example User"),a=Object.assign(Object.assign({},a),{service_data:Object.assign(Object.assign({},a.service_data),{message:s})}),this.hass.callService(t,i,a.service_data).then().catch(a=>{Sa(e,a.message)})})}};At.styles=Pe,a([Z()],At.prototype,"narrow",void 0),a([Z()],At.prototype,"item",void 0),a([Z()],At.prototype,"data",void 0),a([Z()],At.prototype,"yamlMode",void 0),a([Z()],At.prototype,"namePlaceholder",void 0),a([Z()],At.prototype,"areas",void 0),At=a([G("notification-editor-card")],At);let xt=class extends re{constructor(){super(...arguments),this.includeDomains=[],this.options=[],this.value=[],this.numOptions=1}firstUpdated(){this.value.length>1&&(this.numOptions=this.value.length)}render(){return this.hass?L` -
- ${[...Array(this.numOptions).keys()].map(e=>this.renderSelect(e))} + +
+ + + ${this.hass.localize("ui.common.save")} +
- `:L``}renderSelect(e){return L` -
- -
- ${this.renderButton(e)} -
+ + `:L``}_setEvent(e){e.stopPropagation();const a=e.detail.value;let t=this.config.triggers;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{event:a})}),this.config=Object.assign(Object.assign({},this.config),{triggers:t}),Object.keys(this.errors).includes("event")&&this._validateConfig()}_setArea(e){var a;e.stopPropagation();const t=e.detail.value;let i=this.config.triggers;Object.assign(i,{0:Object.assign(Object.assign({},i[0]),{area:t})});const s=St(t,this.areas);(null===(a=i[0].modes)||void 0===a?void 0:a.length)?this._setModes(new CustomEvent("value-changed",{detail:{value:i[0].modes.filter(e=>s.includes(e))}})):this._setModes(new CustomEvent("value-changed",{detail:{value:s}})),this.config=Object.assign(Object.assign({},this.config),{triggers:i}),Object.keys(this.errors).includes("area")&&this._validateConfig()}_setModes(e){e.stopPropagation();const a=e.detail.value;let t=this.config.triggers;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{modes:a})}),this.config=Object.assign(Object.assign({},this.config),{triggers:t}),Object.keys(this.errors).includes("modes")&&this._validateConfig()}_setService(e){e.stopPropagation();const a=String(e.detail.value);let t=this.config.actions;Object.assign(t,{0:Object.assign(Object.assign(Object.assign({},t[0]),{service:a}),La(t[0],"service"))}),this.config=Object.assign(Object.assign({},this.config),{actions:t}),Object.keys(this.errors).includes("service")&&this._validateConfig()}_setTitle(e){e.stopPropagation();const a=String(e.detail.value);let t=this.config.actions;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{service_data:Object.assign(Object.assign({},t[0].service_data||{}),{title:a})})}),this.config=Object.assign(Object.assign({},this.config),{actions:t}),Object.keys(this.errors).includes("title")&&this._validateConfig()}_setMessage(e){e.stopPropagation();const a=String(e.detail.value);let t=this.config.actions;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{service_data:Object.assign(Object.assign({},t[0].service_data||{}),{message:a})})}),this.config=Object.assign(Object.assign({},this.config),{actions:t}),Object.keys(this.errors).includes("message")&&this._validateConfig()}_setName(e){e.stopPropagation();const a=String(e.detail.value);this.config=Object.assign(Object.assign({},this.config),{name:a})}_setYaml(e){const a=e.detail.value;let t={};Nt(null==a?void 0:a.service)&&(t=Object.assign(Object.assign({},t),{service:String(a.service)})),Et(null==a?void 0:a.service_data)&&(t=Object.assign(Object.assign({},t),{service_data:a.service_data})),Object.keys(t).length&&(this.config=Object.assign(Object.assign({},this.config),{actions:Object.assign(this.config.actions,{0:Object.assign(Object.assign({},this.config.actions[0]),t)})})),Object.keys(this.errors).some(e=>["service","message","title"].includes(e))&&this._validateConfig()}_validateConfig(){var e,a;this.errors={};const t=this._parseAutomation(),i=t.triggers[0];i.event&&Object.values(Re).includes(i.event)||(this.errors=Object.assign(Object.assign({},this.errors),{event:!0})),Ra(i.area)&&xt(this.areas,this.alarmoConfig).includes(i.area)||(this.errors=Object.assign(Object.assign({},this.errors),{area:!0})),(null===(e=i.modes)||void 0===e?void 0:e.every(e=>St(i.area,this.areas).includes(e)))||(this.errors=Object.assign(Object.assign({},this.errors),{modes:!0}));const s=t.actions[0];return s.service&&Ct(this.hass).includes(s.service)||(this.errors=Object.assign(Object.assign({},this.errors),{service:!0})),Tt(null===(a=s.service_data)||void 0===a?void 0:a.message)||(this.errors=Object.assign(Object.assign({},this.errors),{message:!0})),Tt(t.name)||(this.errors=Object.assign(Object.assign({},this.errors),{name:!0})),!Object.values(this.errors).length}_validAction(){var e,a;const t=this._parseAutomation().actions[0];return t.service&&Ct(this.hass).includes(t.service)&&Tt(null===(e=t.service_data)||void 0===e?void 0:e.message)&&Tt(null===(a=t.service_data)||void 0===a?void 0:a.title)}_insertWildCard(e){var a;const t=this.shadowRoot.querySelector("#message");t&&t.focus();let i=(null===(a=this.config.actions[0].service_data)||void 0===a?void 0:a.message)||"";i=t&&null!==t.selectionStart&&null!==t.selectionEnd?i.substring(0,t.selectionStart)+e+i.substring(t.selectionEnd,i.length):i+e,this._setMessage(new CustomEvent("value-changed",{detail:{value:i}}))}_toggleYamlMode(){this.viewMode=this.viewMode==Dt.UI?Dt.Yaml:Dt.UI}_namePlaceholder(){const e=this.config.triggers[0].event,a=At(this.hass,this.config.actions[0].service);return e&&a.length?ga("panels.actions.cards.new_notification.fields.name.placeholders."+e,this.hass.language,"{target}",a[0].name):""}_messagePlaceholder(){const e=this.config.triggers[0].event;return e?ga("panels.actions.cards.new_notification.fields.message.placeholders."+e,this.hass.language):""}_parseAutomation(){var e;let a=Object.assign({},this.config),t=a.actions[0];return!Tt(null===(e=t.service_data)||void 0===e?void 0:e.message)&&this.viewMode==Dt.UI&&this._messagePlaceholder()&&(t=Object.assign(Object.assign({},t),{service_data:Object.assign(Object.assign({},t.service_data),{message:this._messagePlaceholder()})}),Object.assign(a,{actions:Object.assign(a.actions,{0:t})})),!Tt(a.name)&&this.viewMode==Dt.UI&&this._namePlaceholder()&&(a=Object.assign(Object.assign({},a),{name:this._namePlaceholder()})),a}_saveClick(e){if(!this._validateConfig())return;let a=this._parseAutomation();St(a.triggers[0].area,this.areas).every(e=>{var t;return null===(t=a.triggers[0].modes)||void 0===t?void 0:t.includes(e)})&&(a=Object.assign(Object.assign({},a),{triggers:Object.assign(a.triggers,{0:Object.assign(Object.assign({},a.triggers[0]),{modes:[]})})})),this.item&&(a=Object.assign(Object.assign({},a),{automation_id:this.item.automation_id})),ka(this.hass,a).catch(a=>Ia(a,e)).then(()=>this._cancelClick())}_deleteClick(e){var a;(null===(a=this.item)||void 0===a?void 0:a.automation_id)&&Aa(this.hass,this.item.automation_id).catch(a=>Ia(a,e)).then(()=>this._cancelClick())}_testClick(e){const a=this._parseAutomation().actions[0],[t,i]=a.service.split(".");let s=a.service_data.message;s=s.replace("{{open_sensors}}","Some Example Sensor is open"),s=s.replace("{{bypassed_sensors}}","Some Bypassed Sensor"),s=s.replace("{{arm_mode}}","Armed away"),s=s.replace("{{changed_by}}","Some Example User"),this.hass.callService(t,i,Object.assign(Object.assign({},a.service_data),{message:s})).then().catch(a=>{Fa(e,a.message)})}_cancelClick(){Ee(0,"/alarmo/actions",!0)}static get styles(){return se` + div.content { + padding: 28px 20px 0; + max-width: 1040px; + margin: 0 auto; + display: flex; + flex-direction: column; + } + div.header { + font-family: var(--paper-font-headline_-_font-family); + -webkit-font-smoothing: var( + --paper-font-headline_-_-webkit-font-smoothing + ); + font-size: var(--paper-font-headline_-_font-size); + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + line-height: var(--paper-font-headline_-_line-height); + opacity: var(--dark-primary-opacity); + } + div.section-header { + font-family: var(--paper-font-headline_-_font-family); + -webkit-font-smoothing: var( + --paper-font-headline_-_-webkit-font-smoothing + ); + font-size: 18px; + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + line-height: var(--paper-font-headline_-_line-height); + opacity: var(--dark-primary-opacity); + margin: 20px 0px 5px 10px; + } + div.actions { + padding: 20px 0px 30px 0px; + } + mwc-button ha-icon { + margin-right: 6px; + --mdc-icon-size: 20px; + } + .toggle-button { + position: absolute; + right: 20px; + top: 20px; + } + h2 { + margin-top: 10px; + font-size: var(--paper-font-headline_-_font-size); + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + } + span.error-message { + color: var(--error-color); + } + mwc-button.warning { + --mdc-theme-primary: var(--error-color); + } + mwc-button.save-button { + --mdc-theme-primary: rgba(var(--rgb-primary-color), 0.8); + } + div.heading { + display: grid; + grid-template-areas: 'header icon' + 'description icon'; + grid-template-rows: 1fr 1fr; + grid-template-columns: 1fr 48px; + margin: 20px 0px 10px 10px; + } + div.heading .icon { + grid-area: icon; + } + div.heading .header { + grid-area: header; + } + div.heading .description { + grid-area: description; + } + `}};var Lt;a([Z({attribute:!1})],Pt.prototype,"hass",void 0),a([Z()],Pt.prototype,"narrow",void 0),a([Z()],Pt.prototype,"config",void 0),a([Z()],Pt.prototype,"item",void 0),a([Z()],Pt.prototype,"areas",void 0),a([Z()],Pt.prototype,"alarmoConfig",void 0),a([Z()],Pt.prototype,"viewMode",void 0),a([Z()],Pt.prototype,"errors",void 0),Pt=a([G("notification-editor-card")],Pt),function(e){e[e.Yaml=0]="Yaml",e[e.UI=1]="UI"}(Lt||(Lt={}));let Rt=class extends re{constructor(){super(...arguments),this.config={type:qa.Action,triggers:[{}],actions:[{}]},this.viewMode=Lt.UI,this.errors={}}async firstUpdated(){var e;if(this.areas=await xa(this.hass),this.alarmoConfig=await va(this.hass),this.item&&(this.config=Object.assign({},this.item),this.config.triggers.length>1&&(this.config=Object.assign(Object.assign({},this.config),{triggers:[this.config.triggers[0]]})),(null===(e=this.config.triggers[0].modes)||void 0===e?void 0:e.length)||this._setModes(new CustomEvent("value-changed",{detail:{value:St(this.config.triggers[0].area,this.areas)}})),null===this.config.triggers[0].area&&this._setArea(new CustomEvent("value-changed",{detail:{value:0}}))),!Ra(this.config.triggers[0].area)){const e=xt(this.areas,this.alarmoConfig);1==e.length?this._setArea(new CustomEvent("value-changed",{detail:{value:e[0]}})):e.includes(0)&&this._setArea(new CustomEvent("value-changed",{detail:{value:0}}))}}render(){var e;return this.hass&&this.areas?L` +
+ +
${ga("panels.actions.cards.new_action.title",this.hass.language)}
+
${ga("panels.actions.cards.new_action.description",this.hass.language)}
- `}renderButton(e){return e!=this.numOptions-1||e==this.options.length-1?L` - this.removeOption(e)}> - `:this.value&&this.value.length>e?L` - - `:L` - - `}getValue(e){return e>this.value.length-1?"":this.value[e]}entityFilter(e,a){return!this.value.slice(0,a).concat(this.value.slice(a+1)).includes(e)}selectedChange(e,a){const t=e.target.value;if(!this.entityFilter(t,a))return void this.removeOption(a);const i=this.value.length==a?[...this.value,t]:this.value.slice(0,a).concat(t,this.value.slice(a+1));this.value=i.filter(e=>e);const s=new CustomEvent("change");this.dispatchEvent(s)}addOption(){this.numOptions=this.numOptions+1}removeOption(e){this.numOptions=this.numOptions-1,e==this.value.length-1?this.value=this.value.slice(0,e):this.value=this.value.slice(0,e).concat(this.value.slice(e+1))}};xt.styles=se` - ha-icon { - padding: 4px; - display: inline-block; - vertical-align: bottom; - cursor: pointer; - } +
${ga("panels.actions.cards.new_notification.trigger",this.hass.language)}
+ +
+ + + ${ga("panels.actions.cards.new_notification.fields.event.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.event.description",this.hass.language)} + - ha-icon.disabled { - color: var(--disabled-text-color); - } + $t(e,this.hass))} + label=${ga("panels.actions.cards.new_action.fields.event.heading",this.hass.language)} + icons=${!0} + .value=${this.config.triggers[0].event} + @value-changed=${this._setEvent} + ?invalid=${this.errors.event} + > + - div.container { - display: flex; - flex-direction: column; - } + ${Object.keys(this.areas).length>1?L` + + + ${ga("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_action.fields.area.description",this.hass.language)} + + + kt(e,this.areas,this.alarmoConfig))} + clearable=${!0} + label=${ga("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} + .value=${this.config.triggers[0].area} + @value-changed=${this._setArea} + ?invalid=${this.errors.area} + > + + `:""} - div.container-item { - display: grid; - grid-template-columns: 1fr max-content; - grid-template-rows: min-content; - grid-template-areas: 'dropdown icon'; - align-items: flex-end; - } + + + ${ga("panels.actions.cards.new_notification.fields.mode.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.mode.description",this.hass.language)} + - div.dropdown-holder { - grid-area: dropdown; - } - div.icon-holder { - grid-area: icon; - } - `,a([Z()],xt.prototype,"includeDomains",void 0),a([Z()],xt.prototype,"options",void 0),a([Z()],xt.prototype,"value",void 0),a([Z()],xt.prototype,"numOptions",void 0),xt=a([G("alarmo-multi-entity-select")],xt);let St=class extends re{constructor(){super(...arguments),this.yamlMode=!1,this.namePlaceholder="",this.areas={}}async firstUpdated(){const e=await Ia(this.hass);this.areas=e;const a=await Na(this.hass);if(this.item)a[this.item]&&!a[this.item].is_notification?this.data=Aa(a[this.item],["automation_id","is_notification","enabled"]):this.data=Object.assign({},wt);else{this.data=Object.assign({},wt);let a="My notification";const t=await Na(this.hass);if(Object.values(t).find(e=>e.name==a)){let e=2;for(;Object.values(t).find(t=>t.name==`${a} ${e}`);)e++;a=`${a} ${e}`}this.namePlaceholder=a,this.data.area||1!=Object.keys(e).length||(this.data=Object.assign(Object.assign({},this.data),{area:Object.keys(this.areas)[0]}))}}render(){return this.data?L` - -
-
- ${la("panels.actions.cards.new_action.title",this.hass.language)} -
- + yt(e,this.hass))} + label=${ga("panels.actions.cards.new_action.fields.mode.heading",this.hass.language)} + .value=${this.config.triggers[0].modes||[]} + @value-changed=${this._setModes} + ?invalid=${this.errors.modes} + > +
+
+ +
${ga("panels.actions.cards.new_notification.action",this.hass.language)}
+
- ${la("panels.actions.cards.new_action.description",this.hass.language)} + ${this.viewMode==Lt.UI?L` + + + ${ga("panels.actions.cards.new_action.fields.entity.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_action.fields.entity.description",this.hass.language)} + + + e.entity_id).filter(Ra))||[]} + @value-changed=${this._setEntity} + ?invalid=${this.errors.entity_id} + > + + + + + ${ga("panels.actions.cards.new_action.fields.action.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_action.fields.action.description",this.hass.language)} + + +
+ this._setAction("turn_on")} + ?invalid=${this.errors.service} + > + ${ga("panels.actions.cards.new_action.fields.action.turn_on",this.hass.language)} + + this._setAction("turn_off")} + ?invalid=${this.errors.service} + > + ${ga("panels.actions.cards.new_action.fields.action.turn_off",this.hass.language)} + +
+ +
+ `:L` +

${ga("components.editor.edit_in_yaml",this.hass.language)}

+ + + + ${this.errors.service||this.errors.entity_id?L` + + ${this.hass.localize("ui.errors.config.key_missing","key",Object.entries(this.errors).find(([e,a])=>a&&["service","entity_id"].includes(e))[0])} + + `:""} + `}
-
- - ${this.yamlMode?la("components.editor.ui_mode",this.hass.language):la("components.editor.yaml_mode",this.hass.language)} +
+ + + ${this.viewMode==Lt.Yaml?ga("components.editor.ui_mode",this.hass.language):ga("components.editor.yaml_mode",this.hass.language)}
- ${this.yamlMode?L` - {this.yamlCode=e.detail.value}} - > - - `:L` - - - ${la("panels.actions.cards.new_action.fields.event.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.event.description",this.hass.language)} - - _t(this.hass).find(a=>JSON.stringify(a.trigger)==JSON.stringify(e)).value)[0]} - @value-changed=${e=>this.updateTriggers(e.target.value)} - > - - - - - ${this.areas&&Object.keys(this.areas).length>1?L` - - ${la("panels.actions.cards.new_action.fields.area.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.area.description",this.hass.language)} - - Object({value:e.area_id,name:e.name}))} - value=${this.data.area||""} - clearable=${!0} - label=${la("panels.sensors.cards.editor.fields.area.heading",this.hass.language)} - @value-changed=${e=>this.data={...this.data,area:e.target.value}} - - `:""} - -
- - - ${la("panels.actions.cards.new_action.fields.mode.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.mode.description",this.hass.language)} - - e.state&&e.state==_a.Disarmed)} - .options=${this.getModeList()} - .value=${this.data.modes||[]} - @change=${e=>this.updateModes(e.target.value)} - - - - - - ${la("panels.actions.cards.new_action.fields.entity.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.entity.description",this.hass.language)} - - this.updateEntities(e.target.value)} - > - - - - ${la("panels.actions.cards.new_action.fields.action.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.action.description",this.hass.language)} -
- {this.updateAction("turn_on")}} - > - ${la("panels.actions.cards.new_action.fields.action.turn_on",this.hass.language)} - - {this.updateAction("turn_off")}} - > - ${la("panels.actions.cards.new_action.fields.action.turn_off",this.hass.language)} - -
-
- - - ${la("panels.actions.cards.new_action.fields.name.heading",this.hass.language)} - ${la("panels.actions.cards.new_action.fields.name.description",this.hass.language)} - - this.data={...this.data,name:e.target.value}} - > - - - - `} -
- - - ${this.hass.localize("ui.common.save")} + + ${ga("panels.actions.cards.new_notification.actions.test",this.hass.language)} + +
+ - ${this.item?L` - - - ${this.hass.localize("ui.common.delete")} - - `:""} +
${ga("panels.actions.cards.new_notification.options",this.hass.language)}
+ +
+ + + ${ga("panels.actions.cards.new_action.fields.name.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_action.fields.name.description",this.hass.language)} + - - ${la("panels.actions.cards.new_notification.actions.test",this.hass.language)} - - + + + + ${(null===(e=this.item)||void 0===e?void 0:e.automation_id)?L` + + + ${ga("panels.actions.cards.new_notification.fields.delete.heading",this.hass.language)} + + + ${ga("panels.actions.cards.new_notification.fields.delete.description",this.hass.language)} + +
+ + + ${this.hass.localize("ui.common.delete")} + +
+
+ `:""}
- `:L``}getEntityValues(){var e;return null===(e=this.data)||void 0===e?void 0:e.actions.map(e=>{var a;return null===(a=e.service_data)||void 0===a?void 0:a.entity_id}).filter(e=>e)}getModeList(){var e;return((null===(e=this.data)||void 0===e?void 0:e.area)?this.areas[this.data.area]?Object.entries(this.areas[this.data.area].modes).filter(([,e])=>e.enabled).map(([e])=>e):[]:Object.values(this.areas).map(e=>Object.entries(e.modes).filter(([,e])=>e.enabled).map(([e])=>e)).reduce((e,a)=>e.filter(e=>a.includes(e)))).map(e=>Object({name:la("common.modes_long."+e,this.hass.language),value:e}))}updateTriggers(e){this.data=Object.assign(Object.assign({},this.data),{triggers:[_t(this.hass).find(a=>a.value==e).trigger]})}updateModes(e){this.data=Object.assign(Object.assign({},this.data),{modes:e})}updateEntities(e){var a;const t=this.getAction(),i=[...(null===(a=this.data)||void 0===a?void 0:a.actions)||[]];e.forEach((e,a)=>{var s;aCe(e.service)).filter(e=>e))||[];return 1==$a(a).length?a[0]:""}updateAction(e){this.data=Object.assign(Object.assign({},this.data),{actions:this.data.actions.map(a=>{var t;return Object(Object.assign(Object.assign({},a),{service:(Oe((null===(t=a.service_data)||void 0===t?void 0:t.entity_id)||"")||"homeassistant")+"."+e}))})})}deleteClick(e){this.item&&Ua(this.hass,this.item).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()})}loadFormData(){let e=this.yamlMode?Object.assign({},this.yamlCode):this.data;return e=Object.assign(Object.assign({},e),{name:e.name||this.namePlaceholder,area:e.area||""}),e}saveClick(e){let a=this.loadFormData();const t=kt(a,this.hass);t?Sa(e,t):(this.item&&(a=Object.assign(Object.assign({},a),{automation_id:this.item})),Va(this.hass,a).catch(a=>Oa(a,e)).then(()=>{this.cancelClick()}))}toggleYaml(){this.data&&(this.yamlMode=!this.yamlMode,!this.yamlMode&&this.yamlCode?this.data=Object.assign({},this.yamlCode):this.yamlCode=Object.assign({},this.data))}cancelClick(){qe(0,"/alarmo/actions",!0)}testClick(e){const a=this.loadFormData(),t=kt(a,this.hass);t?Sa(e,t):a.actions.forEach(a=>{const[t,i]=a.service.split(".");this.hass.callService(t,i,a.service_data).then().catch(a=>{Sa(e,a.message)})})}};St.styles=Pe,a([Z()],St.prototype,"narrow",void 0),a([Z()],St.prototype,"item",void 0),a([Z()],St.prototype,"data",void 0),a([Z()],St.prototype,"yamlMode",void 0),a([Z()],St.prototype,"namePlaceholder",void 0),a([Z()],St.prototype,"areas",void 0),St=a([G("automation-editor-card")],St);let Ot=class extends(Ha(re)){constructor(){super(...arguments),this.automations=[],this.areas={},this.notificationFilterOptions=[],this.automationFilterOptions=[]}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeEvents(()=>this._fetchData(),"alarmo_updated")]}async _fetchData(){if(!this.hass)return;const e=await Na(this.hass);this.automations=Object.values(e),this.areas=await Ia(this.hass),this.notificationFilterOptions=[{value:"no_area",name:la("panels.actions.cards.notifications.filter.no_area",this.hass.language),count:Object.values(this.automations).filter(e=>e.is_notification&&!e.area).length}].concat(Object.values(this.areas).map(e=>Object({value:e.area_id,name:e.name,count:Object.values(this.automations).filter(a=>a.is_notification&&a.area==e.area_id).length})).sort((e,a)=>e.name.toLowerCase()!e.is_notification&&!e.area).length}].concat(Object.values(this.areas).map(e=>Object({value:e.area_id,name:e.name,count:Object.values(this.automations).filter(a=>!a.is_notification&&a.area==e.area_id).length})).sort((e,a)=>e.name.toLowerCase(){await Ne()})()}render(){if(!this.hass)return L``;if(this.path&&this.path.length&&"new_notification"==this.path[0])return L` - - `;if(this.path&&2==this.path.length&&"edit_notification"==this.path[0])return L` - - - `;if(this.path&&this.path.length&&"new_action"==this.path[0])return L` - - `;if(this.path&&2==this.path.length&&"edit_action"==this.path[0])return L` - + +
+ + + ${this.hass.localize("ui.common.save")} + +
+ `:L``}_setEvent(e){e.stopPropagation();const a=e.detail.value;let t=this.config.triggers;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{event:a})}),this.config=Object.assign(Object.assign({},this.config),{triggers:t}),Object.keys(this.errors).includes("event")&&this._validateConfig()}_setArea(e){var a;e.stopPropagation();const t=e.detail.value;let i=this.config.triggers;Object.assign(i,{0:Object.assign(Object.assign({},i[0]),{area:t})}),this.config=Object.assign(Object.assign({},this.config),{triggers:i}),(null===(a=this.config.triggers[0].modes)||void 0===a?void 0:a.length)||this._setModes(new CustomEvent("value-changed",{detail:{value:St(t,this.areas)}})),Object.keys(this.errors).includes("area")&&this._validateConfig()}_setModes(e){e.stopPropagation();const a=e.detail.value,t=this.config.triggers;Object.assign(t,{0:Object.assign(Object.assign({},t[0]),{modes:a})}),this.config=Object.assign(Object.assign({},this.config),{triggers:t}),Object.keys(this.errors).includes("service")&&this._validateConfig()}_setEntity(e){e.stopPropagation();const a=e.detail.value;let t=this.config.actions,i=null;a.length>t.length&&t.map(e=>e.service).every(e=>null==e?void 0:e.includes("turn_on"))&&(i="turn_on"),a.length>t.length&&t.map(e=>e.service).every(e=>null==e?void 0:e.includes("turn_off"))&&(i="turn_off"),t.length>a.length&&(t=[t[0],...t.slice(1,a.length)]),a.length||Object.assign(t,{0:La(t[0],"entity_id")}),a.forEach((e,a)=>{let i=t.length>a?Object.assign({},t[a]):{};i=Object.assign(Object.assign({},i),{entity_id:e}),Object.assign(t,{[a]:i})}),this.config=Object.assign(Object.assign({},this.config),{actions:t}),i&&this._setAction(i),Object.keys(this.errors).includes("entity_id")&&this._validateConfig()}_setAction(e){let a=this.config.actions;a.forEach((t,i)=>{const s=t.entity_id?je(t.entity_id):"homeassistant";Object.assign(a,{[i]:Object.assign({service:`${s}.${e}`},La(t,"service"))})}),this.config=Object.assign(Object.assign({},this.config),{actions:a})}_setName(e){e.stopPropagation();const a=String(e.detail.value);this.config=Object.assign(Object.assign({},this.config),{name:a})}_setYaml(e){let a=e.detail.value,t=[{}];var i;Et(a)&&(a=[a]),"object"==typeof(i=a)&&null!==i&&Array.isArray(i)&&(a.forEach((e,a)=>{let i={};Et(e)&&Nt(e.service)&&(i=Object.assign(Object.assign({},i),{service:e.service})),Et(e)&&Et(e.service_data)&&(i=Object.assign(Object.assign({},i),{service_data:e.service_data})),Object.assign(t,{[a]:i})}),this.config=Object.assign(Object.assign({},this.config),{actions:t}))}_validateConfig(){var e;this.errors={};const a=this._parseAutomation(),t=a.triggers[0];t.event&&Object.values(Re).includes(t.event)||(this.errors=Object.assign(Object.assign({},this.errors),{event:!0})),Ra(t.area)&&xt(this.areas,this.alarmoConfig).includes(t.area)||(this.errors=Object.assign(Object.assign({},this.errors),{area:!0})),(null===(e=t.modes)||void 0===e?void 0:e.length)||(this.errors=Object.assign(Object.assign({},this.errors),{modes:!0}));const i=a.actions.map(e=>e.service);i.length&&i.every(e=>Mt(e,this.hass))||(this.errors=Object.assign(Object.assign({},this.errors),{service:!0}));let s=a.actions.map(e=>e.entity_id);return this.viewMode==Lt.Yaml&&(s=s.filter(Ra)),a.actions.length&&s.every(e=>qt(e,this.hass))||(this.errors=Object.assign(Object.assign({},this.errors),{entity_id:!0})),Tt(a.name)||(this.errors=Object.assign(Object.assign({},this.errors),{name:!0})),!Object.values(this.errors).length}_validAction(){const e=this._parseAutomation(),a=e.actions.map(e=>e.service);let t=e.actions.map(e=>e.entity_id);return this.viewMode==Lt.Yaml&&(t=t.filter(Ra)),a.length&&a.every(e=>Mt(e,this.hass))&&t.every(e=>qt(e,this.hass))}_toggleYamlMode(){this.viewMode=this.viewMode==Lt.UI?Lt.Yaml:Lt.UI}_namePlaceholder(){var e,a;if(!this._validAction)return"";const t=this.config.triggers[0].event,i=this.config.actions.map(e=>e.entity_id).filter(Ra),s=jt(i,this.hass).map(e=>e.name).join(", "),n=Da(this.config.actions.map(e=>e.service).filter(Ra).map(e=>Ce(e)));let r=void 0;return 1==n.length&&(null===(e=n[0])||void 0===e?void 0:e.includes("turn_on"))&&(r=this.hass.localize("state.default.on")),1==n.length&&(null===(a=n[0])||void 0===a?void 0:a.includes("turn_off"))&&(r=this.hass.localize("state.default.off")),t&&s&&r?ga("panels.actions.cards.new_action.fields.name.placeholders."+t,this.hass.language,["{entity}","{state}"],[s,r]):""}_parseAutomation(){let e=Object.assign({},this.config);return!Tt(e.name)&&this.viewMode==Lt.UI&&this._namePlaceholder()&&(e=Object.assign(Object.assign({},e),{name:this._namePlaceholder()})),e}_saveClick(e){if(!this._validateConfig())return;let a=this._parseAutomation();St(a.triggers[0].area,this.areas).every(e=>{var t;return null===(t=a.triggers[0].modes)||void 0===t?void 0:t.includes(e)})&&(a=Object.assign(Object.assign({},a),{triggers:Object.assign(a.triggers,{0:Object.assign(Object.assign({},a.triggers[0]),{modes:[]})})})),ka(this.hass,a).catch(a=>Ia(a,e)).then(()=>this._cancelClick())}_deleteClick(e){var a;(null===(a=this.item)||void 0===a?void 0:a.automation_id)&&Aa(this.hass,this.item.automation_id).catch(a=>Ia(a,e)).then(()=>this._cancelClick())}_testClick(e){this._parseAutomation().actions.forEach(a=>{const[t,i]=a.service.split(".");this.hass.callService(t,i,a.service_data).then().catch(a=>{Fa(e,a.message)})})}_cancelClick(){Ee(0,"/alarmo/actions",!0)}static get styles(){return se` + div.content { + padding: 28px 20px 0; + max-width: 1040px; + margin: 0 auto; + display: flex; + flex-direction: column; + } + div.header { + font-family: var(--paper-font-headline_-_font-family); + -webkit-font-smoothing: var( + --paper-font-headline_-_-webkit-font-smoothing + ); + font-size: var(--paper-font-headline_-_font-size); + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + line-height: var(--paper-font-headline_-_line-height); + opacity: var(--dark-primary-opacity); + } + div.section-header { + font-family: var(--paper-font-headline_-_font-family); + -webkit-font-smoothing: var( + --paper-font-headline_-_-webkit-font-smoothing + ); + font-size: 18px; + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + line-height: var(--paper-font-headline_-_line-height); + opacity: var(--dark-primary-opacity); + margin: 20px 0px 5px 10px; + } + div.actions { + padding: 20px 0px 30px 0px; + } + mwc-button ha-icon { + margin-right: 6px; + --mdc-icon-size: 20px; + } + .toggle-button { + position: absolute; + right: 20px; + top: 20px; + } + h2 { + margin-top: 10px; + font-size: var(--paper-font-headline_-_font-size); + font-weight: var(--paper-font-headline_-_font-weight); + letter-spacing: var(--paper-font-headline_-_letter-spacing); + } + span.error-message { + color: var(--error-color); + } + mwc-button.warning { + --mdc-theme-primary: var(--error-color); + } + mwc-button.save-button { + --mdc-theme-primary: rgba(var(--rgb-primary-color), 0.8); + } + mwc-button.active { + background: var(--primary-color); + --mdc-theme-primary: var(--text-primary-color); + border-radius: 4px; + } + div.heading { + display: grid; + grid-template-areas: 'header icon' + 'description icon'; + grid-template-rows: 1fr 1fr; + grid-template-columns: 1fr 48px; + margin: 20px 0px 10px 10px; + } + div.heading .icon { + grid-area: icon; + } + div.heading .header { + grid-area: header; + } + div.heading .description { + grid-area: description; + } + `}};a([Z({attribute:!1})],Rt.prototype,"hass",void 0),a([Z()],Rt.prototype,"narrow",void 0),a([Z()],Rt.prototype,"config",void 0),a([Z()],Rt.prototype,"item",void 0),a([Z()],Rt.prototype,"areas",void 0),a([Z()],Rt.prototype,"alarmoConfig",void 0),a([Z()],Rt.prototype,"viewMode",void 0),a([Z()],Rt.prototype,"errors",void 0),Rt=a([G("automation-editor-card")],Rt);let Ut=class extends(Ya(re)){constructor(){super(...arguments),this.areas={},this.notificationFilterOptions=[],this.automationFilterOptions=[],this.getAreaForAutomation=e=>{const a=xt(this.areas,this.config);let t=e.triggers[0].area;return Ra(t)&&a.includes(t)?t:void 0}}hassSubscribe(){return this._fetchData(),[this.hass.connection.subscribeMessage(()=>this._fetchData(),{type:"alarmo_config_updated"})]}async _fetchData(){if(!this.hass)return;const e=await ba(this.hass);this.automations=Object.values(e),this.areas=await xa(this.hass),this.config=await va(this.hass),this.notificationFilterOptions=[...xt(this.areas,this.config).map(a=>Object(Object.assign(Object.assign({},kt(a,this.areas,this.config)),{count:Object.values(e).filter(e=>e.type==qa.Notification).map(this.getAreaForAutomation).filter(e=>e==a).length})))].sort((e,a)=>e.name.toLowerCase()Object(Object.assign(Object.assign({},kt(a,this.areas,this.config)),{count:Object.values(e).filter(e=>e.type==qa.Action).map(this.getAreaForAutomation).filter(e=>e==a).length})))].sort((e,a)=>e.name.toLowerCase()e.type==qa.Notification).map(this.getAreaForAutomation).filter(e=>!Ra(e)).length&&(this.notificationFilterOptions=[{value:"no_area",name:ga("panels.actions.cards.notifications.filter.no_area",this.hass.language),count:Object.values(e).filter(e=>e.type==qa.Notification).map(this.getAreaForAutomation).filter(e=>!Ra(e)).length},...this.notificationFilterOptions]),Object.values(e).filter(e=>e.type==qa.Action).map(this.getAreaForAutomation).filter(e=>!Ra(e)).length&&(this.automationFilterOptions=[{value:"no_area",name:ga("panels.actions.cards.notifications.filter.no_area",this.hass.language),count:Object.values(e).filter(e=>e.type==qa.Action).map(this.getAreaForAutomation).filter(e=>!Ra(e)).length},...this.automationFilterOptions])}firstUpdated(){this.path&&2==this.path.length&&"filter"==this.path[0]&&(this.notificationFilter=this.path[1],this.automationFilter=this.path[1]),(async()=>{await De()})()}render(){var e;if(!this.hass||!this.automations)return L``;if((null===(e=this.path)||void 0===e?void 0:e.length)&&["new_notification","edit_notification"].includes(this.path[0])){const e=this.automations.find(e=>this.path.length>1&&e.automation_id==this.path[1]&&e.type==qa.Notification);return L` + + `}if(this.path&&this.path.length&&"new_action"==this.path[0])return L` + + ? + `;if(this.path&&2==this.path.length&&"edit_action"==this.path[0]){const e=this.automations.find(e=>this.path.length>1&&e.automation_id==this.path[1]&&e.type==qa.Action);return L` + - `;{const e={type:{width:"40px"},name:{title:this.hass.localize("ui.components.area-picker.add_dialog.name"),width:"40%",grow:!0,text:!0},enabled:{title:la("panels.actions.cards.notifications.table.enabled",this.hass.language),width:"68px",align:"center"}},a=this.automations.filter(e=>e.is_notification).filter(e=>!this.notificationFilter||!this.notificationFilterOptions.find(e=>e.value==this.notificationFilter)||e.area==this.notificationFilter||"no_area"===this.notificationFilter&&!e.area).map(e=>Object({id:e.automation_id,type:L` + `}{const e={type:{width:"40px"},name:{title:this.hass.localize("ui.components.area-picker.add_dialog.name"),width:"40%",grow:!0,text:!0},enabled:{title:ga("panels.actions.cards.notifications.table.enabled",this.hass.language),width:"68px",align:"center"}},a=this.automations.filter(e=>e.type==qa.Notification).filter(e=>!Ra(this.notificationFilter)||!this.notificationFilterOptions.find(e=>e.value==this.notificationFilter)||this.getAreaForAutomation(e)==this.notificationFilter||"no_area"===this.notificationFilter&&!Ra(this.getAreaForAutomation(e))).map(e=>Object({id:e.automation_id,type:L` `,name:e.name,enabled:L` {a.stopPropagation(),this.toggleEnable(a,e.automation_id)}} > - `})),t=this.automations.filter(e=>!e.is_notification).filter(e=>!this.automationFilter||!this.automationFilterOptions.find(e=>e.value==this.automationFilter)||e.area==this.automationFilter||"no_area"===this.automationFilter&&!e.area).map(e=>Object({id:e.automation_id,type:L` + `})),t=this.automations.filter(e=>e.type==qa.Action).filter(e=>!Ra(this.notificationFilter)||!this.automationFilterOptions.find(e=>e.value==this.automationFilter)||this.getAreaForAutomation(e)==this.notificationFilter||"no_area"===this.notificationFilter&&!Ra(this.getAreaForAutomation(e))).map(e=>Object({id:e.automation_id,type:L` `,name:e.name,enabled:L` (...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a @click=${a=>{a.stopPropagation(),this.toggleEnable(a,e.automation_id)}} > `}));return L` - +
- ${la("panels.actions.cards.notifications.description",this.hass.language)} + ${ga("panels.actions.cards.notifications.description",this.hass.language)}
${this.notificationFilterOptions.length>1?L`
${la("panels.actions.cards.notifications.filter.label",this.hass.language)}:${ga("panels.actions.cards.notifications.filter.label",this.hass.language)}: this.notificationFilter=e.target.value} > @@ -2190,29 +2468,30 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ?selectable=${!0} .columns=${e} .data=${a} - @row-click=${e=>{const a=String(e.detail.id);qe(0,"/alarmo/actions/edit_notification/"+a,!0)}} + @row-click=${e=>{const a=String(e.detail.id);Ee(0,"/alarmo/actions/edit_notification/"+a,!0)}} > - ${la("panels.actions.cards.notifications.table.no_items",this.hass.language)} + ${ga("panels.actions.cards.notifications.table.no_items",this.hass.language)}
- ${la("panels.actions.cards.notifications.actions.new_notification",this.hass.language)} + ${ga("panels.actions.cards.notifications.actions.new_notification",this.hass.language)}
- -
${la("panels.actions.cards.actions.description",this.hass.language)}
+ +
${ga("panels.actions.cards.actions.description",this.hass.language)}
${this.automationFilterOptions.length>1?L`
${la("panels.actions.cards.notifications.filter.label",this.hass.language)}:${ga("panels.actions.cards.notifications.filter.label",this.hass.language)}: this.automationFilter=e.target.value} > @@ -2222,18 +2501,18 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a ?selectable=${!0} .columns=${e} .data=${t} - @row-click=${e=>{const a=String(e.detail.id);qe(0,"/alarmo/actions/edit_action/"+a,!0)}} + @row-click=${e=>{const a=String(e.detail.id);Ee(0,"/alarmo/actions/edit_action/"+a,!0)}} > - ${la("panels.actions.cards.actions.table.no_items",this.hass.language)} + ${ga("panels.actions.cards.actions.table.no_items",this.hass.language)}
- ${la("panels.actions.cards.actions.actions.new_action",this.hass.language)} + ${ga("panels.actions.cards.actions.actions.new_action",this.hass.language)}
- `}}toggleEnable(e,a){Va(this.hass,{automation_id:a,enabled:!e.target.checked}).catch(a=>Oa(a,e)).then()}addNotificationClick(){qe(0,"/alarmo/actions/new_notification",!0)}addActionClick(){qe(0,"/alarmo/actions/new_action",!0)}};Ot.styles=Pe,a([Z()],Ot.prototype,"hass",void 0),a([Z()],Ot.prototype,"narrow",void 0),a([Z()],Ot.prototype,"path",void 0),a([Z()],Ot.prototype,"alarmEntity",void 0),a([Z()],Ot.prototype,"automations",void 0),a([Z()],Ot.prototype,"areas",void 0),a([Z()],Ot.prototype,"notificationFilter",void 0),a([Z()],Ot.prototype,"automationFilter",void 0),a([Z()],Ot.prototype,"notificationFilterOptions",void 0),a([Z()],Ot.prototype,"automationFilterOptions",void 0),Ot=a([G("alarm-view-actions")],Ot),e.MyAlarmPanel=class extends re{async firstUpdated(){window.addEventListener("location-changed",()=>{this.requestUpdate()}),await Ne(),this.userConfig=await Da(this.hass),this.requestUpdate()}render(){if(!customElements.get("ha-app-layout")||!this.userConfig)return L` + `}}toggleEnable(e,a){ka(this.hass,{automation_id:a,enabled:!e.target.checked}).catch(a=>Ia(a,e)).then()}addNotificationClick(){Ee(0,"/alarmo/actions/new_notification",!0)}addActionClick(){Ee(0,"/alarmo/actions/new_action",!0)}};Ut.styles=Pe,a([Z()],Ut.prototype,"hass",void 0),a([Z()],Ut.prototype,"narrow",void 0),a([Z()],Ut.prototype,"path",void 0),a([Z()],Ut.prototype,"alarmEntity",void 0),a([Z()],Ut.prototype,"automations",void 0),a([Z()],Ut.prototype,"areas",void 0),a([Z()],Ut.prototype,"config",void 0),a([Z()],Ut.prototype,"notificationFilter",void 0),a([Z()],Ut.prototype,"automationFilter",void 0),a([Z()],Ut.prototype,"notificationFilterOptions",void 0),a([Z()],Ut.prototype,"automationFilterOptions",void 0),Ut=a([G("alarm-view-actions")],Ut),e.MyAlarmPanel=class extends re{async firstUpdated(){window.addEventListener("location-changed",()=>{this.requestUpdate()}),await De(),this.userConfig=await fa(this.hass),this.requestUpdate()}render(){if(!customElements.get("ha-app-layout")||!this.userConfig)return L` loading... `;const e=Object.values(this.userConfig).find(e=>e.name.toLowerCase()==this.hass.user.name.toLowerCase());return this.hass.user.is_admin||e&&e.is_admin?L` @@ -2241,10 +2520,10 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a
- ${la("title",this.hass.language)} + ${ga("title",this.hass.language)}
- v${"1.5.7"} + v${"1.6.0"}
(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a @iron-activate=${this.handlePageSelected} > - ${la("panels.general.title",this.hass.language)} + ${ga("panels.general.title",this.hass.language)} - ${la("panels.sensors.title",this.hass.language)} + ${ga("panels.sensors.title",this.hass.language)} - ${la("panels.codes.title",this.hass.language)} + ${ga("panels.codes.title",this.hass.language)} - ${la("panels.actions.title",this.hass.language)} + ${ga("panels.actions.title",this.hass.language)} @@ -2289,15 +2568,15 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a You have no access to view this page. Please check the following:
  • - You are logged in using HA user account ${this.hass.user.name}. This account + You are logged in using HA user account '${this.hass.user.name}'. This account ${this.hass.user.is_admin?"does":"does NOT"} have administrator permission.
  • - There is ${e?"a":"NO"} user configured in Alarmo with name - ${this.hass.user.name}. - ${e?`This user ${e.is_admin?"does":"does NOT"} have administrator permission. `:""} + There is ${e?"a":"no"} user configured in Alarmo with name + '${this.hass.user.name}'. + ${e?L`This user ${e.is_admin?"does":"does NOT"} have administrator permission. `:""}
@@ -2320,8 +2599,13 @@ const Ga=new WeakMap,Ka=(e=>(...a)=>{const t=e(...a);return g.set(t,!0),t})(e=>a `;default:return L` - no view - `}}handlePageSelected(e){const a=e.detail.item.getAttribute("page-name");a!==this.getPath()?(qe(0,"/alarmo/"+a),this.requestUpdate()):scrollTo(0,0)}static get styles(){return se` + +
+ The page you are trying to reach cannot be found. + Please select a page from the menu above to continue. +
+
+ `}}handlePageSelected(e){const a=e.detail.item.getAttribute("page-name");a!==this.getPath()?(Ee(0,"/alarmo/"+a),this.requestUpdate()):scrollTo(0,0)}static get styles(){return se` ${Pe} :host { diff --git a/custom_components/alarmo/frontend/src/const.ts b/custom_components/alarmo/frontend/src/const.ts index 1ad0bd5..0c5611d 100755 --- a/custom_components/alarmo/frontend/src/const.ts +++ b/custom_components/alarmo/frontend/src/const.ts @@ -1,4 +1,4 @@ -export const VERSION = '1.5.7'; +export const VERSION = '1.6.0'; export const platform = 'alarmo'; export const editConfigService = 'edit_config';