2 lines
No EOL
51 KiB
JavaScript
2 lines
No EOL
51 KiB
JavaScript
export const id=2552;export const ids=[2552];export const modules={18007:(i,t,e)=>{e.a(i,(async(i,o)=>{try{e.d(t,{Bt:()=>c});var n=e(22075),a=e(50345),s=e(23216),d=i([s]);s=(d.then?(await d)():d)[0];const l=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],c=i=>i.first_weekday===a.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(i.language).weekInfo.firstDay%7:(0,n.L)(i.language)%7:l.includes(i.first_weekday)?l.indexOf(i.first_weekday):1;o()}catch(i){o(i)}}))},41090:(i,t,e)=>{e.d(t,{L:()=>o,p:()=>n});const o={device:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",and:"M4.4,16.5C4.4,15.6 4.7,14.7 5.2,13.9C5.7,13.1 6.7,12.2 8.2,11.2C7.3,10.1 6.8,9.3 6.5,8.7C6.1,8 6,7.4 6,6.7C6,5.2 6.4,4.1 7.3,3.2C8.2,2.3 9.4,2 10.9,2C12.2,2 13.3,2.4 14.2,3.2C15.1,4 15.5,5 15.5,6.1C15.5,6.9 15.3,7.6 14.9,8.3C14.5,9 13.8,9.7 12.8,10.4L11.4,11.5L15.7,16.7C16.3,15.5 16.6,14.3 16.6,12.8H18.8C18.8,15.1 18.3,17 17.2,18.5L20,21.8H17L15.7,20.3C15,20.9 14.3,21.3 13.4,21.6C12.5,21.9 11.6,22.1 10.7,22.1C8.8,22.1 7.3,21.6 6.1,20.6C5,19.5 4.4,18.2 4.4,16.5M10.7,20C12,20 13.2,19.5 14.3,18.5L9.6,12.8L9.2,13.1C7.7,14.2 7,15.3 7,16.5C7,17.6 7.3,18.4 8,19C8.7,19.6 9.5,20 10.7,20M8.5,6.7C8.5,7.6 9,8.6 10.1,9.9L11.7,8.8C12.3,8.4 12.7,8 12.9,7.6C13.1,7.2 13.2,6.7 13.2,6.2C13.2,5.6 13,5.1 12.5,4.7C12.1,4.3 11.5,4.1 10.8,4.1C10.1,4.1 9.5,4.3 9.1,4.8C8.7,5.3 8.5,5.9 8.5,6.7Z",or:"M2,4C5,10 5,14 2,20H8C13,20 19,16 22,12C19,8 13,4 8,4H2M5,6H8C11.5,6 16.3,9 19.3,12C16.3,15 11.5,18 8,18H5C6.4,13.9 6.4,10.1 5,6Z",not:"M14.08,4.61L15.92,5.4L14.8,8H19V10H13.95L12.23,14H19V16H11.38L9.92,19.4L8.08,18.61L9.2,16H5V14H10.06L11.77,10H5V8H12.63L14.08,4.61Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",numeric_state:"M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",sun:"M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",template:"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",time:"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",trigger:"M10 7V9H9V15H10V17H6V15H7V9H6V7H10M16 7C17.11 7 18 7.9 18 9V15C18 16.11 17.11 17 16 17H12V7M16 9H14V15H16V9Z",zone:"M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z"},n={device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},building_blocks:{icon:"M18.5 18.5C19.04 18.5 19.5 18.96 19.5 19.5S19.04 20.5 18.5 20.5H6.5C5.96 20.5 5.5 20.04 5.5 19.5S5.96 18.5 6.5 18.5H18.5M18.5 17H6.5C5.13 17 4 18.13 4 19.5S5.13 22 6.5 22H18.5C19.88 22 21 20.88 21 19.5S19.88 17 18.5 17M21 11H18V7H13L10 11V16H22L21 11M11.54 11L13.5 8.5H16V11H11.54M9.76 3.41L4.76 2L2 11.83C1.66 13.11 2.41 14.44 3.7 14.8L4.86 15.12L8.15 12.29L4.27 11.21L6.15 4.46L8.94 5.24C9.5 5.53 10.71 6.34 11.47 7.37L12.5 6H12.94C11.68 4.41 9.85 3.46 9.76 3.41Z",members:{and:{},or:{},not:{}}},other:{icon:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",members:{template:{},trigger:{}}}}},38514:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(5095),a=e(95260),s=e(14516),d=e(17267),l=e(18394),c=(e(80392),e(19418)),r=e(29950),u=e(57433),h=(e(85027),e(32825)),m=(e(76898),e(97326)),v=(e(67905),e(50002),e(37127)),p=e(8471),y=(e(53685),e(6689),i([u,h,m,v,p]));[u,h,m,v,p]=y.then?(await y)():y;(0,o.Z)([(0,a.Mo)("ha-automation-condition-editor")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"yamlMode",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)()],key:"path",value:void 0},{kind:"field",key:"_processedCondition",value:()=>(0,s.Z)((i=>(0,c.Gd)(i)))},{kind:"method",key:"render",value:function(){const i=this._processedCondition(this.condition),t=void 0!==customElements.get(`ha-automation-condition-${i.condition}`),e=this.yamlMode||!t;return n.dy` ${e?n.dy` ${t?"":n.dy` ${this.hass.localize("ui.panel.config.automation.editor.conditions.unsupported_condition",{condition:i.condition})} `} <ha-yaml-editor .hass="${this.hass}" .defaultValue="${this.condition}" @value-changed="${this._onYamlChange}" .readOnly="${this.disabled}"></ha-yaml-editor> `:n.dy` <div @value-changed="${this._onUiChanged}"> ${(0,d.h)(`ha-automation-condition-${i.condition}`,{hass:this.hass,condition:i,disabled:this.disabled,path:this.path})} </div> `} `}},{kind:"method",key:"_onYamlChange",value:function(i){i.stopPropagation(),i.detail.isValid&&(0,l.B)(this,"value-changed",{value:i.detail.value,yaml:!0})}},{kind:"method",key:"_onUiChanged",value:function(i){i.stopPropagation();const t={...this.condition.alias?{alias:this.condition.alias}:{},...i.detail.value};(0,l.B)(this,"value-changed",{value:t})}},{kind:"field",static:!0,key:"styles",value:()=>r.Qx}]}}),n.oi);t()}catch(i){t(i)}}))},96925:(i,t,e)=>{e.a(i,(async(i,o)=>{try{e.d(t,{a:()=>N});var n=e(309),a=e(22264),s=(e(44577),e(3239)),d=e(5095),l=e(95260),c=e(53180),r=e(3747),u=e(18394),h=e(930),m=e(92482),v=(e(85878),e(68336),e(31360),e(54371),e(19418)),p=e(44553),y=e(41090),_=e(59449),g=e(38149),f=e(11285),b=e(29950),k=e(38514),C=e(77251),M=i([p,k]);[p,k]=M.then?(await M)():M;const $="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",H="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",A="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",L="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",V="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",w="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",x="M6,22A3,3 0 0,1 3,19C3,18.4 3.18,17.84 3.5,17.37L9,7.81V6A1,1 0 0,1 8,5V4A2,2 0 0,1 10,2H14A2,2 0 0,1 16,4V5A1,1 0 0,1 15,6V7.81L20.5,17.37C20.82,17.84 21,18.4 21,19A3,3 0 0,1 18,22H6M5,19A1,1 0 0,0 6,20H18A1,1 0 0,0 19,19C19,18.79 18.93,18.59 18.82,18.43L16.53,14.47L14,17L8.93,11.93L5.18,18.43C5.07,18.59 5,18.79 5,19M13,10A1,1 0 0,0 12,11A1,1 0 0,0 13,12A1,1 0 0,0 14,11A1,1 0 0,0 13,10Z",B="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z",Z="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",I="M18 21L14 17H17V7H14L18 3L22 7H19V17H22M2 19V17H12V19M2 13V11H9V13M2 7V5H6V7H2Z",z="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9",P=i=>i.preventDefault(),N=(i,t)=>{var e,o,n;t.stopPropagation();const a=null===(e=t.currentTarget)||void 0===e?void 0:e.name;if(!a)return;const s=(null===(o=t.detail)||void 0===o?void 0:o.value)||(null===(n=t.currentTarget)||void 0===n?void 0:n.value);if((i.condition[a]||"")===s)return;let d;s?d={...i.condition,[a]:s}:(d={...i.condition},delete d[a]),(0,u.B)(i,"value-changed",{value:d})};(0,n.Z)([(0,l.Mo)("ha-automation-condition-row")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"condition",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"hideMenu",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,r.t)({key:"automationClipboard",state:!1,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_yamlMode",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_testing",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_testingResult",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,a.F)({context:g.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,a.F)({context:C.T,subscribe:!0})],key:"_reorderMode",value:void 0},{kind:"method",key:"render",value:function(){if(!this.condition)return d.Ld;const i=void 0===this._reorderMode;return d.dy` <ha-card outlined> ${!1===this.condition.enabled?d.dy`<div class="disabled-bar"> ${this.hass.localize("ui.panel.config.automation.editor.actions.disabled")} </div>`:""} <ha-expansion-panel leftChevron> <h3 slot="header"> <ha-svg-icon class="condition-icon" .path="${y.L[this.condition.condition]}"></ha-svg-icon> ${(0,h.f)((0,p.m)(this.condition,this.hass,this._entityReg))} </h3> <slot name="icons" slot="icons"></slot> ${this.hideMenu?"":d.dy` <ha-button-menu slot="icons" @action="${this._handleAction}" @click="${P}" fixed> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${w}"> </ha-icon-button> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.panel.config.automation.editor.conditions.test")} <ha-svg-icon slot="graphic" .path="${x}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.conditions.rename")} <ha-svg-icon slot="graphic" .path="${Z}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}" class="${(0,c.$)({hidden:i})}"> ${this.hass.localize("ui.panel.config.automation.editor.conditions.re_order")} <ha-svg-icon slot="graphic" .path="${I}"></ha-svg-icon> </mwc-list-item> <li divider role="separator"></li> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.actions.duplicate")} <ha-svg-icon slot="graphic" .path="${L}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.copy")} <ha-svg-icon slot="graphic" .path="${H}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.cut")} <ha-svg-icon slot="graphic" .path="${A}"></ha-svg-icon> </mwc-list-item> <li divider role="separator"></li> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.panel.config.automation.editor.edit_ui")} ${this._yamlMode?"":d.dy`<ha-svg-icon class="selected_menu_item" slot="graphic" .path="${$}"></ha-svg-icon>`} </mwc-list-item> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.panel.config.automation.editor.edit_yaml")} ${this._yamlMode?d.dy`<ha-svg-icon class="selected_menu_item" slot="graphic" .path="${$}"></ha-svg-icon>`:""} </mwc-list-item> <li divider role="separator"></li> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${!1===this.condition.enabled?this.hass.localize("ui.panel.config.automation.editor.actions.enable"):this.hass.localize("ui.panel.config.automation.editor.actions.disable")} <ha-svg-icon slot="graphic" .path="${!1===this.condition.enabled?B:z}"></ha-svg-icon> </mwc-list-item> <mwc-list-item class="warning" graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.actions.delete")} <ha-svg-icon class="warning" slot="graphic" .path="${V}"></ha-svg-icon> </mwc-list-item> </ha-button-menu> `} <div class="${(0,c.$)({"card-content":!0,disabled:!1===this.condition.enabled})}"> ${this._warnings?d.dy`<ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.editor_not_supported")}"> ${this._warnings.length>0&&void 0!==this._warnings[0]?d.dy` <ul> ${this._warnings.map((i=>d.dy`<li>${i}</li>`))} </ul>`:""} ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert>`:""} <ha-automation-condition-editor @ui-mode-not-available="${this._handleUiModeNotAvailable}" @value-changed="${this._handleChangeEvent}" .yamlMode="${this._yamlMode}" .disabled="${this.disabled}" .hass="${this.hass}" .condition="${this.condition}" .path="${this.path}"></ha-automation-condition-editor> </div> </ha-expansion-panel> <div class="testing ${(0,c.$)({active:this._testing,pass:!0===this._testingResult,error:!1===this._testingResult})}"> ${this._testingResult?this.hass.localize("ui.panel.config.automation.editor.conditions.testing_pass"):this.hass.localize("ui.panel.config.automation.editor.conditions.testing_error")} </div> </ha-card> `}},{kind:"method",key:"_handleUiModeNotAvailable",value:function(i){i.stopPropagation(),this._warnings=(0,m.p)(this.hass,i.detail).warnings,this._yamlMode||(this._yamlMode=!0)}},{kind:"method",key:"_handleChangeEvent",value:function(i){i.detail.yaml&&(this._warnings=void 0)}},{kind:"method",key:"_handleAction",value:async function(i){var t;switch(i.detail.index){case 0:await this._testCondition();break;case 1:await this._renameCondition();break;case 2:null===(t=this._reorderMode)||void 0===t||t.enter();break;case 3:(0,u.B)(this,"duplicate");break;case 4:this._setClipboard();break;case 5:this._setClipboard(),(0,u.B)(this,"value-changed",{value:null});break;case 6:this._switchUiMode(),this.expand();break;case 7:this._switchYamlMode(),this.expand();break;case 8:this._onDisable();break;case 9:this._onDelete()}}},{kind:"method",key:"_setClipboard",value:function(){this._clipboard={...this._clipboard,condition:(0,s.Z)(this.condition)}}},{kind:"method",key:"_onDisable",value:function(){var i;const t=!(null===(i=this.condition.enabled)||void 0===i||i),e={...this.condition,enabled:t};(0,u.B)(this,"value-changed",{value:e})}},{kind:"method",key:"_onDelete",value:function(){(0,f.g7)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.delete_confirm_title"),text:this.hass.localize("ui.panel.config.automation.editor.conditions.delete_confirm_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:()=>{(0,u.B)(this,"value-changed",{value:null})}})}},{kind:"method",key:"_switchUiMode",value:function(){this._warnings=void 0,this._yamlMode=!1}},{kind:"method",key:"_switchYamlMode",value:function(){this._warnings=void 0,this._yamlMode=!0}},{kind:"method",key:"_testCondition",value:async function(){if(this._testing)return;this._testingResult=void 0,this._testing=!0;const i=this.condition;try{const t=await(0,_.w)(this.hass,{condition:i});if(this.condition!==i)return void(this._testing=!1);if(!t.condition.valid)return(0,f.Ys)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.invalid_condition"),text:t.condition.error}),void(this._testing=!1);let e;try{e=await(0,v.J8)(this.hass,i)}catch(t){return this.condition!==i||(0,f.Ys)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.test_failed"),text:t.message}),void(this._testing=!1)}this._testingResult=e.result}finally{setTimeout((()=>{this._testing=!1}),2500)}}},{kind:"method",key:"_renameCondition",value:async function(){const i=await(0,f.D9)(this,{title:this.hass.localize("ui.panel.config.automation.editor.conditions.change_alias"),inputLabel:this.hass.localize("ui.panel.config.automation.editor.conditions.alias"),inputType:"string",placeholder:(0,h.f)((0,p.m)(this.condition,this.hass,this._entityReg,!0)),defaultValue:this.condition.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==i){const t={...this.condition};""===i?delete t.alias:t.alias=i,(0,u.B)(this,"value-changed",{value:t})}}},{kind:"method",key:"expand",value:function(){this.updateComplete.then((()=>{this.shadowRoot.querySelector("ha-expansion-panel").expanded=!0}))}},{kind:"get",static:!0,key:"styles",value:function(){return[b.Qx,d.iv`ha-button-menu{--mdc-theme-text-primary-on-background:var(--primary-text-color)}.disabled{opacity:.5;pointer-events:none}ha-expansion-panel{--expansion-panel-summary-padding:0 0 0 8px;--expansion-panel-content-padding:0}h3{margin:0;font-size:inherit;font-weight:inherit}.condition-icon{display:none}@media (min-width:870px){.condition-icon{display:inline-block;color:var(--secondary-text-color);opacity:.9;margin-right:8px}}.card-content{padding:16px}.disabled-bar{background:var(--divider-color,#e0e0e0);text-align:center;border-top-right-radius:var(--ha-card-border-radius);border-top-left-radius:var(--ha-card-border-radius)}mwc-list-item[disabled]{--mdc-theme-text-primary-on-background:var(--disabled-text-color)}mwc-list-item.hidden{display:none}.testing{position:absolute;top:0px;right:0px;left:0px;text-transform:uppercase;font-weight:700;font-size:14px;background-color:var(--divider-color,#e0e0e0);color:var(--text-primary-color);max-height:0px;overflow:hidden;transition:max-height .3s;text-align:center;border-top-right-radius:var(--ha-card-border-radius,12px);border-top-left-radius:var(--ha-card-border-radius,12px)}.testing.active{max-height:100px}.testing.error{background-color:var(--accent-color)}.testing.pass{background-color:var(--success-color)}.selected_menu_item{color:var(--primary-color)}li[role=separator]{border-bottom-color:var(--divider-color)}`]}}]}}),d.oi);o()}catch(i){o(i)}}))},61563:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(22264),a=e(3239),s=e(5095),d=e(95260),l=e(99266),c=e(3747),r=e(18394),u=e(32723),h=(e(92295),e(85878),e(42308),e(37662),e(77251)),m=e(64082),v=e(96925),p=i([v]);v=(p.then?(await p)():p)[0];const y="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",_="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",g="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",f="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";(0,o.Z)([(0,d.Mo)("ha-automation-condition")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"conditions",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,d.SB)(),(0,n.F)({context:h.T,subscribe:!0})],key:"_reorderMode",value:void 0},{kind:"field",decorators:[(0,c.t)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",key:"_focusLastConditionOnChange",value:()=>!1},{kind:"field",key:"_conditionKeys",value:()=>new WeakMap},{kind:"method",key:"updated",value:function(i){if(!i.has("conditions"))return;let t;if(Array.isArray(this.conditions)||(t=[this.conditions]),(t||this.conditions).forEach(((i,e)=>{"string"==typeof i&&(t=t||[...this.conditions],t[e]={condition:"template",value_template:i})})),t)(0,r.B)(this,"value-changed",{value:t});else if(this._focusLastConditionOnChange){this._focusLastConditionOnChange=!1;const i=this.shadowRoot.querySelector("ha-automation-condition-row:last-of-type");i.updateComplete.then((()=>{i.expand(),i.scrollIntoView(),i.focus()}))}}},{kind:"get",key:"nested",value:function(){return void 0!==this.path}},{kind:"method",key:"render",value:function(){var i;return Array.isArray(this.conditions)?s.dy` <ha-sortable handle-selector=".handle" .disabled="${!(null!==(i=this._reorderMode)&&void 0!==i&&i.active)}" @item-moved="${this._conditionMoved}" group="conditions" .path="${this.path}"> <div class="conditions"> ${(0,l.r)(this.conditions.filter((i=>"object"==typeof i)),(i=>this._getKey(i)),((i,t)=>{var e,o,n;return s.dy` <ha-automation-condition-row .path="${[...null!==(e=this.path)&&void 0!==e?e:[],t]}" .index="${t}" .totalConditions="${this.conditions.length}" .condition="${i}" .hideMenu="${Boolean(null===(o=this._reorderMode)||void 0===o?void 0:o.active)}" .disabled="${this.disabled}" @duplicate="${this._duplicateCondition}" @move-condition="${this._move}" @value-changed="${this._conditionChanged}" .hass="${this.hass}"> ${null!==(n=this._reorderMode)&&void 0!==n&&n.active?s.dy` <ha-icon-button .index="${t}" slot="icons" .label="${this.hass.localize("ui.panel.config.automation.editor.move_up")}" .path="${_}" @click="${this._moveUp}" .disabled="${0===t}"></ha-icon-button> <ha-icon-button .index="${t}" slot="icons" .label="${this.hass.localize("ui.panel.config.automation.editor.move_down")}" .path="${y}" @click="${this._moveDown}" .disabled="${t===this.conditions.length-1}"></ha-icon-button> <div class="handle" slot="icons"> <ha-svg-icon .path="${g}"></ha-svg-icon> </div> `:""} </ha-automation-condition-row> `}))} </div> </ha-sortable> <div class="buttons"> <ha-button outlined .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.add")}" @click="${this._addConditionDialog}"> <ha-svg-icon .path="${f}" slot="icon"></ha-svg-icon> </ha-button> <ha-button .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.add_building_block")}" @click="${this._addConditionBuildingBlockDialog}"> <ha-svg-icon .path="${f}" slot="icon"></ha-svg-icon> </ha-button> </div> `:s.Ld}},{kind:"method",key:"_addConditionDialog",value:function(){var i;(0,m._)(this,{type:"condition",add:this._addCondition,clipboardItem:null===(i=this._clipboard)||void 0===i||null===(i=i.condition)||void 0===i?void 0:i.condition})}},{kind:"method",key:"_addConditionBuildingBlockDialog",value:function(){var i;(0,m._)(this,{type:"condition",add:this._addCondition,clipboardItem:null===(i=this._clipboard)||void 0===i||null===(i=i.condition)||void 0===i?void 0:i.condition,group:"building_blocks"})}},{kind:"field",key:"_addCondition",value(){return i=>{let t;if(i===m.I)t=this.conditions.concat((0,a.Z)(this._clipboard.condition));else{const e=i,o=customElements.get(`ha-automation-condition-${e}`);t=this.conditions.concat({condition:e,...o.defaultConfig})}this._focusLastConditionOnChange=!0,(0,r.B)(this,"value-changed",{value:t})}}},{kind:"method",key:"_getKey",value:function(i){return this._conditionKeys.has(i)||this._conditionKeys.set(i,Math.random().toString()),this._conditionKeys.get(i)}},{kind:"method",key:"_moveUp",value:function(i){const t=i.target.index,e=t-1;this._move(t,e)}},{kind:"method",key:"_moveDown",value:function(i){const t=i.target.index,e=t+1;this._move(t,e)}},{kind:"method",key:"_move",value:function(i,t,e,o){const n=(0,u.b)(this.conditions,i,t,e,o);(0,r.B)(this,"value-changed",{value:n})}},{kind:"method",key:"_conditionMoved",value:function(i){if(this.nested)return;i.stopPropagation();const{oldIndex:t,newIndex:e,oldPath:o,newPath:n}=i.detail;this._move(t,e,o,n)}},{kind:"method",key:"_conditionChanged",value:function(i){i.stopPropagation();const t=[...this.conditions],e=i.detail.value,o=i.target.index;if(null===e)t.splice(o,1);else{const i=this._getKey(t[o]);this._conditionKeys.set(e,i),t[o]=e}this.conditions=t,(0,r.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_duplicateCondition",value:function(i){i.stopPropagation();const t=i.target.index;(0,r.B)(this,"value-changed",{value:this.conditions.concat((0,a.Z)(this.conditions[t]))})}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`ha-automation-condition-row{display:block;margin-bottom:16px;scroll-margin-top:48px}ha-svg-icon{height:20px}ha-alert{display:block;margin-bottom:16px;border-radius:var(--ha-card-border-radius,12px);overflow:hidden}.handle{padding:12px;cursor:move;cursor:grab}.handle ha-svg-icon{pointer-events:none;height:24px}.buttons{display:flex;flex-wrap:wrap;gap:8px}`}}]}}),s.oi);t()}catch(i){t(i)}}))},57433:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(95260),a=e(42552),s=i([a]);a=(s.then?(await s)():s)[0];(0,o.Z)([(0,n.Mo)("ha-automation-condition-and")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[]}}),a.w);t()}catch(i){t(i)}}))},85027:(i,t,e)=>{var o=e(309),n=e(22264),a=e(5095),s=e(95260),d=e(14516),l=e(18394),c=e(25917),r=e(7748);(0,o.Z)([(0,s.Mo)("ha-device-condition-picker")],(function(i,t){return{F:class extends t{constructor(){super(c.b2,c.Gg,(i=>({device_id:i||"",condition:"device",domain:"",entity_id:""}))),i(this)}},d:[{kind:"get",key:"NO_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.conditions.no_conditions")}},{kind:"get",key:"UNKNOWN_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.conditions.unknown_condition")}}]}}),r.g);e(27056),e(39663);var u=e(38149);(0,o.Z)([(0,s.Mo)("ha-automation-condition-device")],(function(i,t){class e extends t{constructor(...t){super(...t),i(this)}}return{F:e,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Object})],key:"condition",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_deviceId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_capabilities",value:void 0},{kind:"field",decorators:[(0,s.SB)(),(0,n.F)({context:u.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",key:"_origCondition",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{device_id:"",domain:"",entity_id:""}}},{kind:"field",key:"_extraFieldsData",value:()=>(0,d.Z)(((i,t)=>{const e={};return t.extra_fields.forEach((t=>{void 0!==i[t.name]&&(e[t.name]=i[t.name])})),e}))},{kind:"method",key:"render",value:function(){var i;const t=this._deviceId||this.condition.device_id;return a.dy` <ha-device-picker .value="${t}" @value-changed="${this._devicePicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.label")}"></ha-device-picker> <ha-device-condition-picker .value="${this.condition}" .deviceId="${t}" @value-changed="${this._deviceConditionPicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.condition")}"></ha-device-condition-picker> ${null!==(i=this._capabilities)&&void 0!==i&&i.extra_fields?a.dy` <ha-form .hass="${this.hass}" .data="${this._extraFieldsData(this.condition,this._capabilities)}" .schema="${this._capabilities.extra_fields}" .disabled="${this.disabled}" .computeLabel="${this._extraFieldsComputeLabelCallback(this.hass.localize)}" @value-changed="${this._extraFieldsChanged}"></ha-form> `:""} `}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.condition&&(this._origCondition=this.condition)}},{kind:"method",key:"updated",value:function(i){const t=i.get("condition");t&&!(0,c.hH)(this._entityReg,t,this.condition)&&this._getCapabilities()}},{kind:"method",key:"_getCapabilities",value:async function(){const i=this.condition;this._capabilities=i.domain?await(0,c.dA)(this.hass,i):void 0}},{kind:"method",key:"_devicePicked",value:function(i){i.stopPropagation(),this._deviceId=i.target.value,void 0===this._deviceId&&(0,l.B)(this,"value-changed",{value:{...e.defaultConfig,condition:"device"}})}},{kind:"method",key:"_deviceConditionPicked",value:function(i){i.stopPropagation();let t=i.detail.value;this._origCondition&&(0,c.hH)(this._entityReg,this._origCondition,t)&&(t=this._origCondition),(0,l.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(i){i.stopPropagation(),(0,l.B)(this,"value-changed",{value:{...this.condition,...i.detail.value}})}},{kind:"method",key:"_extraFieldsComputeLabelCallback",value:function(i){return t=>i(`ui.panel.config.automation.editor.conditions.type.device.extra_fields.${t.name}`)||t.name}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`ha-device-picker{display:block;margin-bottom:24px}ha-form{display:block;margin-top:24px}`}]}}),a.oi)},42552:(i,t,e)=>{e.a(i,(async(i,o)=>{try{e.d(t,{w:()=>r});var n=e(309),a=e(5095),s=e(95260),d=e(18394),l=e(61563),c=i([l]);l=(c.then?(await c)():c)[0];let r=(0,n.Z)([(0,s.Mo)("ha-automation-condition-logical")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"path",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{conditions:[]}}},{kind:"method",key:"render",value:function(){var i;return a.dy` <ha-automation-condition .path="${[...null!==(i=this.path)&&void 0!==i?i:[],"conditions"]}" .conditions="${this.condition.conditions||[]}" @value-changed="${this._valueChanged}" .hass="${this.hass}" .disabled="${this.disabled}"></ha-automation-condition> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation(),(0,d.B)(this,"value-changed",{value:{...this.condition,conditions:i.detail.value}})}}]}}),a.oi);o()}catch(i){o(i)}}))},32825:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(95260),a=e(42552),s=i([a]);a=(s.then?(await s)():s)[0];(0,o.Z)([(0,n.Mo)("ha-automation-condition-not")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[]}}),a.w);t()}catch(i){t(i)}}))},76898:(i,t,e)=>{var o=e(309),n=e(5095),a=e(95260),s=e(14516),d=e(18394);e(39663);(0,o.Z)([(0,a.Mo)("ha-automation-condition-numeric_state")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.SB)()],key:"_inputAboveIsEntity",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputBelowIsEntity",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:""}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)(((i,t,e)=>[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:["access_token","auto_update","available_modes","away_mode","changed_by","code_format","color_modes","current_activity","device_class","editable","effect_list","effect","entity_picture","event_type","event_types","fan_mode","fan_modes","fan_speed_list","forecast","friendly_name","frontend_stream_type","has_date","has_time","hs_color","hvac_mode","hvac_modes","icon","media_album_name","media_artist","media_content_type","media_position_updated_at","media_title","next_dawn","next_dusk","next_midnight","next_noon","next_rising","next_setting","operation_list","operation_mode","options","preset_mode","preset_modes","release_notes","release_summary","release_url","restored","rgb_color","rgbw_color","shuffle","sound_mode_list","sound_mode","source_list","source_type","source","state_class","supported_features","swing_mode","swing_mode","swing_modes","title","token","unit_of_measurement","xy_color"]}},context:{filter_entity:"entity_id"}},{name:"mode_above",type:"select",required:!0,options:[["value",i("ui.panel.config.automation.editor.conditions.type.numeric_state.type_value")],["input",i("ui.panel.config.automation.editor.conditions.type.numeric_state.type_input")]]},...t?[{name:"above",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"above",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"mode_below",type:"select",required:!0,options:[["value",i("ui.panel.config.automation.editor.conditions.type.numeric_state.type_value")],["input",i("ui.panel.config.automation.editor.conditions.type.numeric_state.type_input")]]},...e?[{name:"below",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"below",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"value_template",selector:{template:{}}}]))},{kind:"method",key:"render",value:function(){var i,t;const e=null!==(i=this._inputAboveIsEntity)&&void 0!==i?i:"string"==typeof this.condition.above&&(this.condition.above.startsWith("input_number.")||this.condition.above.startsWith("number.")||this.condition.above.startsWith("sensor.")),o=null!==(t=this._inputBelowIsEntity)&&void 0!==t?t:"string"==typeof this.condition.below&&(this.condition.below.startsWith("input_number.")||this.condition.below.startsWith("number.")||this.condition.below.startsWith("sensor.")),a=this._schema(this.hass.localize,e,o),s={mode_above:e?"input":"value",mode_below:o?"input":"value",...this.condition};return n.dy` <ha-form .hass="${this.hass}" .data="${s}" .schema="${a}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const t=i.detail.value;this._inputAboveIsEntity="input"===t.mode_above,this._inputBelowIsEntity="input"===t.mode_below,delete t.mode_above,delete t.mode_below,""===t.value_template&&delete t.value_template,(0,d.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return i=>{switch(i.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.components.entity.entity-attribute-picker.attribute");default:return this.hass.localize(`ui.panel.config.automation.editor.triggers.type.numeric_state.${i.name}`)}}}}]}}),n.oi)},97326:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(95260),a=e(42552),s=i([a]);a=(s.then?(await s)():s)[0];(0,o.Z)([(0,n.Mo)("ha-automation-condition-or")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[]}}),a.w);t()}catch(i){t(i)}}))},67905:(i,t,e)=>{var o=e(309),n=e(5095),a=e(95260),s=e(38768),d=e(27959),l=e(18394),c=(e(39663),e(21686));const r=(0,s.Ry)({alias:(0,s.jt)((0,s.Z_)()),condition:(0,s.i0)("state"),entity_id:(0,s.jt)((0,s.Z_)()),attribute:(0,s.jt)((0,s.Z_)()),state:(0,s.jt)((0,s.Z_)()),for:(0,s.jt)((0,s.G0)([(0,s.Rx)(),(0,s.Z_)(),c.H])),enabled:(0,s.jt)((0,s.O7)())}),u=[{name:"entity_id",required:!0,selector:{entity:{}}},{name:"attribute",selector:{attribute:{hide_attributes:["access_token","available_modes","color_modes","editable","effect_list","entity_picture","event_types","fan_modes","fan_speed_list","forecast","friendly_name","hvac_modes","icon","operation_list","options","preset_modes","sound_mode_list","source_list","state_class","swing_modes","token"]}},context:{filter_entity:"entity_id"}},{name:"state",required:!0,selector:{state:{}},context:{filter_entity:"entity_id",filter_attribute:"attribute"}},{name:"for",selector:{duration:{}}}];(0,o.Z)([(0,a.Mo)("ha-automation-condition-state")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:"",state:""}}},{kind:"method",key:"shouldUpdate",value:function(i){if(i.has("condition"))try{(0,s.hu)(this.condition,r)}catch(i){return(0,l.B)(this,"ui-mode-not-available",i),!1}return!0}},{kind:"method",key:"render",value:function(){const i=(0,d.c)(this.condition.for),t={...this.condition,for:i};return n.dy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${u}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const t=i.detail.value;Object.keys(t).forEach((i=>void 0===t[i]||""===t[i]?delete t[i]:{})),t.state||(t.state=""),(0,l.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return i=>{switch(i.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.components.entity.entity-attribute-picker.attribute");case"for":return this.hass.localize("ui.panel.config.automation.editor.triggers.type.state.for");default:return this.hass.localize(`ui.panel.config.automation.editor.conditions.type.state.${i.name}`)}}}}]}}),n.oi)},50002:(i,t,e)=>{var o=e(309),n=e(5095),a=e(95260),s=e(14516),d=e(18394);e(39663);(0,o.Z)([(0,a.Mo)("ha-automation-condition-sun")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)((i=>[{name:"before",type:"select",required:!0,options:[["sunrise",i("ui.panel.config.automation.editor.conditions.type.sun.sunrise")],["sunset",i("ui.panel.config.automation.editor.conditions.type.sun.sunset")]]},{name:"before_offset",selector:{text:{}}},{name:"after",type:"select",required:!0,options:[["sunrise",i("ui.panel.config.automation.editor.conditions.type.sun.sunrise")],["sunset",i("ui.panel.config.automation.editor.conditions.type.sun.sunset")]]},{name:"after_offset",selector:{text:{}}}]))},{kind:"method",key:"render",value:function(){const i=this._schema(this.hass.localize);return n.dy` <ha-form .schema="${i}" .data="${this.condition}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const t=i.detail.value;(0,d.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return i=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.sun.${i.name}`)}}]}}),n.oi)},37127:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(5095),a=e(95260),s=(e(99539),e(96925)),d=i([s]);s=(d.then?(await d)():d)[0];(0,o.Z)([(0,a.Mo)("ha-automation-condition-template")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{value_template:""}}},{kind:"method",key:"render",value:function(){const{value_template:i}=this.condition;return n.dy` <p> ${this.hass.localize("ui.panel.config.automation.editor.conditions.type.template.value_template")} * </p> <ha-code-editor .name="${"value_template"}" mode="jinja2" .hass="${this.hass}" .value="${i}" .readOnly="${this.disabled}" autocomplete-entities @value-changed="${this._valueChanged}" dir="ltr"></ha-code-editor> `}},{kind:"method",key:"_valueChanged",value:function(i){(0,s.a)(this,i)}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`p{margin-top:0}`}}]}}),n.oi);t()}catch(i){t(i)}}))},8471:(i,t,e)=>{e.a(i,(async(i,t)=>{try{var o=e(309),n=e(5095),a=e(95260),s=e(14516),d=e(18007),l=e(18394),c=(e(39663),i([d]));d=(c.then?(await c)():c)[0];const r=["sun","mon","tue","wed","thu","fri","sat"];(0,o.Z)([(0,a.Mo)("ha-automation-condition-time")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputModeBefore",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_inputModeAfter",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)(((i,t,e,o)=>{const n=(0,d.Bt)(t),a=r.slice(n,r.length).concat(r.slice(0,n));return[{name:"mode_after",type:"select",required:!0,options:[["value",i("ui.panel.config.automation.editor.conditions.type.time.type_value")],["input",i("ui.panel.config.automation.editor.conditions.type.time.type_input")]]},{name:"after",selector:e?{entity:{filter:[{domain:"input_datetime"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}}},{name:"mode_before",type:"select",required:!0,options:[["value",i("ui.panel.config.automation.editor.conditions.type.time.type_value")],["input",i("ui.panel.config.automation.editor.conditions.type.time.type_input")]]},{name:"before",selector:o?{entity:{filter:[{domain:"input_datetime"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}}},{type:"multi_select",name:"weekday",options:a.map((t=>[t,i(`ui.panel.config.automation.editor.conditions.type.time.weekdays.${t}`)]))}]}))},{kind:"method",key:"render",value:function(){var i,t,e,o,a,s;const d=null!==(i=this._inputModeBefore)&&void 0!==i?i:(null===(t=this.condition.before)||void 0===t?void 0:t.startsWith("input_datetime."))||(null===(e=this.condition.before)||void 0===e?void 0:e.startsWith("sensor.")),l=null!==(o=this._inputModeAfter)&&void 0!==o?o:(null===(a=this.condition.after)||void 0===a?void 0:a.startsWith("input_datetime."))||(null===(s=this.condition.after)||void 0===s?void 0:s.startsWith("sensor.")),c=this._schema(this.hass.localize,this.hass.locale,l,d),r={mode_before:d?"input":"value",mode_after:l?"input":"value",...this.condition};return n.dy` <ha-form .hass="${this.hass}" .data="${r}" .schema="${c}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const t=i.detail.value;this._inputModeAfter="input"===t.mode_after,this._inputModeBefore="input"===t.mode_before,delete t.mode_after,delete t.mode_before,Object.keys(t).forEach((i=>void 0===t[i]||""===t[i]||Array.isArray(t[i])&&0===t[i].length?delete t[i]:{})),(0,l.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return i=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.time.${i.name}`)}}]}}),n.oi);t()}catch(i){t(i)}}))},53685:(i,t,e)=>{var o=e(309),n=e(34541),a=e(47838),s=(e(44577),e(5095)),d=e(95260),l=e(14516),c=e(4771),r=e(18394);e(39663),e(71133);(0,o.Z)([(0,d.Mo)("ha-automation-condition-trigger")],(function(i,t){class e extends t{constructor(...t){super(...t),i(this)}}return{F:e,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_triggers",value:()=>[]},{kind:"field",key:"_unsub",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{id:""}}},{kind:"field",key:"_schema",value:()=>(0,l.Z)((i=>[{name:"id",selector:{select:{multiple:!0,options:i.map((i=>i.id))}},required:!0}]))},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)((0,a.Z)(e.prototype),"connectedCallback",this).call(this);const i={callback:i=>this._automationUpdated(i)};(0,r.B)(this,"subscribe-automation-config",i),this._unsub=i.unsub}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)((0,a.Z)(e.prototype),"disconnectedCallback",this).call(this),this._unsub&&this._unsub()}},{kind:"method",key:"render",value:function(){if(!this._triggers.length)return this.hass.localize("ui.panel.config.automation.editor.conditions.type.trigger.no_triggers");const i=this._schema(this._triggers);return s.dy` <ha-form .schema="${i}" .data="${this.condition}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"field",key:"_computeLabelCallback",value(){return i=>this.hass.localize(`ui.panel.config.automation.editor.conditions.type.trigger.${i.name}`)}},{kind:"method",key:"_automationUpdated",value:function(i){const t=new Set;this._triggers=null!=i&&i.trigger?(0,c.r)(i.trigger).filter((i=>i.id&&!t.has(i.id)&&t.add(i.id))):[]}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const t=i.detail.value;"string"==typeof t.id?this._triggers.some((i=>i.id===t.id))||(t.id=""):Array.isArray(t.id)&&(t.id=t.id.filter((i=>this._triggers.some((t=>t.id===i)))),t.id.length||(t.id="")),(0,r.B)(this,"value-changed",{value:t})}}]}}),s.oi)},6689:(i,t,e)=>{var o=e(309),n=e(5095),a=e(95260),s=e(18394),d=e(3850),l=e(91131);e(91998);function c(i){return(0,l.t)(i)&&"zone"!==(0,d.N)(i)}const r=["zone"];(0,o.Z)([(0,a.Mo)("ha-automation-condition-zone")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"condition",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:"",zone:""}}},{kind:"method",key:"render",value:function(){const{entity_id:i,zone:t}=this.condition;return n.dy` <ha-entity-picker .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.entity")}" .value="${i}" @value-changed="${this._entityPicked}" .hass="${this.hass}" .disabled="${this.disabled}" allow-custom-entity .entityFilter="${c}"></ha-entity-picker> <ha-entity-picker .label="${this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.zone")}" .value="${t}" @value-changed="${this._zonePicked}" .hass="${this.hass}" .disabled="${this.disabled}" allow-custom-entity .includeDomains="${r}"></ha-entity-picker> `}},{kind:"method",key:"_entityPicked",value:function(i){i.stopPropagation(),(0,s.B)(this,"value-changed",{value:{...this.condition,entity_id:i.detail.value}})}},{kind:"method",key:"_zonePicked",value:function(i){i.stopPropagation(),(0,s.B)(this,"value-changed",{value:{...this.condition,zone:i.detail.value}})}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`ha-entity-picker:first-child{display:block;margin-bottom:24px}`}]}}),n.oi)},22075:(i,t,e)=>{e.d(t,{L:()=>a});const o={en:"US",hi:"IN",deva:"IN",te:"IN",mr:"IN",ta:"IN",gu:"IN",kn:"IN",or:"IN",ml:"IN",pa:"IN",bho:"IN",awa:"IN",as:"IN",mwr:"IN",mai:"IN",mag:"IN",bgc:"IN",hne:"IN",dcc:"IN",bn:"BD",beng:"BD",rkt:"BD",dz:"BT",tibt:"BT",tn:"BW",am:"ET",ethi:"ET",om:"ET",quc:"GT",id:"ID",jv:"ID",su:"ID",mad:"ID",ms_arab:"ID",he:"IL",hebr:"IL",jam:"JM",ja:"JP",jpan:"JP",km:"KH",khmr:"KH",ko:"KR",kore:"KR",lo:"LA",laoo:"LA",mh:"MH",my:"MM",mymr:"MM",mt:"MT",ne:"NP",fil:"PH",ceb:"PH",ilo:"PH",ur:"PK",pa_arab:"PK",lah:"PK",ps:"PK",sd:"PK",skr:"PK",gn:"PY",th:"TH",thai:"TH",tts:"TH",zh_hant:"TW",hant:"TW",sm:"WS",zu:"ZA",sn:"ZW",arq:"DZ",ar:"EG",arab:"EG",arz:"EG",fa:"IR",az_arab:"IR",dv:"MV",thaa:"MV"};const n={AG:0,ATG:0,28:0,AS:0,ASM:0,16:0,BD:0,BGD:0,50:0,BR:0,BRA:0,76:0,BS:0,BHS:0,44:0,BT:0,BTN:0,64:0,BW:0,BWA:0,72:0,BZ:0,BLZ:0,84:0,CA:0,CAN:0,124:0,CO:0,COL:0,170:0,DM:0,DMA:0,212:0,DO:0,DOM:0,214:0,ET:0,ETH:0,231:0,GT:0,GTM:0,320:0,GU:0,GUM:0,316:0,HK:0,HKG:0,344:0,HN:0,HND:0,340:0,ID:0,IDN:0,360:0,IL:0,ISR:0,376:0,IN:0,IND:0,356:0,JM:0,JAM:0,388:0,JP:0,JPN:0,392:0,KE:0,KEN:0,404:0,KH:0,KHM:0,116:0,KR:0,KOR:0,410:0,LA:0,LA0:0,418:0,MH:0,MHL:0,584:0,MM:0,MMR:0,104:0,MO:0,MAC:0,446:0,MT:0,MLT:0,470:0,MX:0,MEX:0,484:0,MZ:0,MOZ:0,508:0,NI:0,NIC:0,558:0,NP:0,NPL:0,524:0,PA:0,PAN:0,591:0,PE:0,PER:0,604:0,PH:0,PHL:0,608:0,PK:0,PAK:0,586:0,PR:0,PRI:0,630:0,PT:0,PRT:0,620:0,PY:0,PRY:0,600:0,SA:0,SAU:0,682:0,SG:0,SGP:0,702:0,SV:0,SLV:0,222:0,TH:0,THA:0,764:0,TT:0,TTO:0,780:0,TW:0,TWN:0,158:0,UM:0,UMI:0,581:0,US:0,USA:0,840:0,VE:0,VEN:0,862:0,VI:0,VIR:0,850:0,WS:0,WSM:0,882:0,YE:0,YEM:0,887:0,ZA:0,ZAF:0,710:0,ZW:0,ZWE:0,716:0,AE:6,ARE:6,784:6,AF:6,AFG:6,4:6,BH:6,BHR:6,48:6,DJ:6,DJI:6,262:6,DZ:6,DZA:6,12:6,EG:6,EGY:6,818:6,IQ:6,IRQ:6,368:6,IR:6,IRN:6,364:6,JO:6,JOR:6,400:6,KW:6,KWT:6,414:6,LY:6,LBY:6,434:6,OM:6,OMN:6,512:6,QA:6,QAT:6,634:6,SD:6,SDN:6,729:6,SY:6,SYR:6,760:6,MV:5,MDV:5,462:5};function a(i){return function(i,t,e){if(i){var o,n=i.toLowerCase().split(/[-_]/),a=n[0],s=a;if(n[1]&&4===n[1].length?(s+="_"+n[1],o=n[2]):o=n[1],o||(o=t[s]||t[a]),o)return function(i,t){var e=t["string"==typeof i?i.toUpperCase():i];return"number"==typeof e?e:1}(o.match(/^\d+$/)?Number(o):o,e)}return 1}(i,o,n)}}};
|
|
//# sourceMappingURL=2552.cF7vAGjp59o.js.map
|