UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

3 lines 59.5 kB
/*! For license information please see 27283.a14cbc7c06cdf4d1.js.LICENSE.txt */ export const __webpack_ids__=["27283"];export const __webpack_modules__={93958:function(e,t,i){i.d(t,{F:()=>h});var a=i(9065),n=i(15093),s=i(92444),l=i(76688);let o=class extends s.A{};o.styles=[l.W],o=(0,a.__decorate)([(0,n.Mo)("mwc-checkbox")],o);var r=i(57243),d=i(35359),c=i(65703);class h extends c.K{constructor(){super(...arguments),this.left=!1,this.graphic="control"}render(){const e={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},t=this.renderText(),i=this.graphic&&"control"!==this.graphic&&!this.left?this.renderGraphic():r.dy``,a=this.hasMeta&&this.left?this.renderMeta():r.dy``,n=this.renderRipple();return r.dy` ${n} ${i} ${this.left?"":t} <span class="${(0,d.$)(e)}"> <mwc-checkbox reducedTouchTarget tabindex="${this.tabindex}" .checked="${this.selected}" ?disabled="${this.disabled}" @change="${this.onChange}"> </mwc-checkbox> </span> ${this.left?t:""} ${a}`}async onChange(e){const t=e.target;this.selected===t.checked||(this._skipPropRequest=!0,this.selected=t.checked,await this.updateComplete,this._skipPropRequest=!1)}}(0,a.__decorate)([(0,n.IO)("slot")],h.prototype,"slotElement",void 0),(0,a.__decorate)([(0,n.IO)("mwc-checkbox")],h.prototype,"checkboxElement",void 0),(0,a.__decorate)([(0,n.Cb)({type:Boolean})],h.prototype,"left",void 0),(0,a.__decorate)([(0,n.Cb)({type:String,reflect:!0})],h.prototype,"graphic",void 0)},97536:function(e,t,i){i.d(t,{W:()=>a});const a=i(57243).iv`:host(:not([twoline])){height:56px}:host(:not([left])) .mdc-deprecated-list-item__meta{height:40px;width:40px}`},43537:function(e,t,i){i.d(t,{Z:()=>n});const a=e=>e<10?`0${e}`:e;function n(e){const t=Math.floor(e/3600),i=Math.floor(e%3600/60),n=Math.floor(e%3600%60);return t>0?`${t}:${a(i)}:${a(n)}`:i>0?`${i}:${a(n)}`:n>0?""+n:null}},27015:function(e,t,i){i.d(t,{K:()=>c,R:()=>d});i(9359),i(1331),i(52924);var a=i(73850),n=i(22431),s=i(96530),l=i(72344),o=i(63318),r=i(75101);const d=(e,t,i,n,o,r)=>{if(!!e.states[t]?.attributes.restored)return!0;const d=(0,a.M)(t),c=n.find((e=>e.entity_id===t));if((0,s.X)(d))return!!((0,l.p)(e,d)&&c&&r.some((e=>e.id===c.unique_id)));const h=c?.config_entry_id;if(!h)return!1;const u=o.find((e=>e.entry_id===h));return"helper"===i.find((e=>e.domain===u?.domain))?.integration_type},c=(e,t,i,d,c,h)=>{const u=(0,a.M)(t),p=d.find((e=>e.entity_id===t));if((0,s.X)(u)){if((0,l.p)(e,u)&&p&&h.some((e=>e.id===p.unique_id)))return void n.E[u].delete(e,p.unique_id);const i=e.states[t];if(!i?.attributes.restored)return;return void(0,o.z3)(e,t)}const f=p?.config_entry_id,_=f?c.find((e=>e.entry_id===f)):void 0;!_||"helper"!==i.find((e=>e.domain===_.domain))?.integration_type?(0,o.z3)(e,t):(0,r.iJ)(e,f)}},99426:function(e,t,i){i.r(t);var a=i(44249),n=i(57243),s=i(15093),l=i(35359),o=i(36522);i(23334),i(37583);const r={info:"M11,9H13V7H11M12,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,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,s.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"title",value:()=>""},{kind:"field",decorators:[(0,s.Cb)({attribute:"alert-type"})],key:"alertType",value:()=>"info"},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"dismissable",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return n.dy` <div class="issue-type ${(0,l.$)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${r[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,l.$)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?n.dy`<div class="title">${this.title}</div>`:n.Ld} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?n.dy`<ha-icon-button @click="${this._dismissClicked}" label="Dismiss alert" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}"></ha-icon-button>`:n.Ld} </slot> </div> </div> </div> `}},{kind:"method",key:"_dismissClicked",value:function(){(0,o.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`}]}}),n.oi)},48103:function(e,t,i){var a=i(44249),n=i(72621),s=i(57243),l=i(93958),o=i(97536),r=i(46289),d=i(15093),c=i(36522);(0,a.Z)([(0,d.Mo)("ha-check-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"onChange",value:async function(e){(0,n.Z)(i,"onChange",this,3)([e]),(0,c.B)(this,e.type)}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,o.W,s.iv`:host{--mdc-theme-secondary:var(--primary-color)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,16px);margin-inline-start:0px;direction:var(--direction)}.mdc-deprecated-list-item__meta{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0}.mdc-deprecated-list-item__graphic{margin-top:var(--check-list-item-graphic-margin-top)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{margin-inline-start:0;margin-inline-end:var(--mdc-list-item-graphic-margin,32px)}`]}]}}),l.F)},41307:function(e,t,i){var a=i(44249),n=i(72621),s=i(57243),l=i(15093),o=i(35359),r=i(36522),d=i(76320);i(37583);(0,a.Z)([(0,l.Mo)("ha-expansion-panel")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"left-chevron",type:Boolean,reflect:!0})],key:"leftChevron",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"no-collapse",type:Boolean,reflect:!0})],key:"noCollapse",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,l.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){const e=this.noCollapse?s.Ld:s.dy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,o.$)({expanded:this.expanded})}"></ha-svg-icon> `;return s.dy` <div class="top ${(0,o.$)({expanded:this.expanded})}"> <div id="summary" class="${(0,o.$)({noCollapse:this.noCollapse})}" @click="${this._toggleContainer}" @keydown="${this._toggleContainer}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1"> ${this.leftChevron?e:s.Ld} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> ${this.leftChevron?s.Ld:e} <slot name="icons"></slot> </div> </div> <div class="container ${(0,o.$)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?s.dy`<slot></slot>`:""} </div> `}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),e.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,r.B)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,d.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=t,(0,r.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`}]}}),s.oi)},72807:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=(i(9359),i(56475),i(31526),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(2060),i(57243)),s=i(15093),l=i(91583),o=i(27486),r=i(36522),d=i(1416),c=i(57816),h=i(28008),u=i(33067),p=(i(41307),i(48103),i(4398),i(73850)),f=e([u]);u=(f.then?(await f)():f)[0];const _="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";(0,a.Z)([(0,s.Mo)("ha-filter-domains")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_shouldRender",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_filter",value:void 0},{kind:"method",key:"render",value:function(){return n.dy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.entities.picker.headers.domain")} ${this.value?.length?n.dy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${_}" @click="${this._clearFilter}"></ha-icon-button>`:n.Ld} </div> ${this._shouldRender?n.dy`<search-input-outlined .hass="${this.hass}" .filter="${this._filter}" @value-changed="${this._handleSearchChange}"> </search-input-outlined> <mwc-list class="ha-scrollbar" @click="${this._handleItemClick}" multi> ${(0,l.r)(this._domains(this.hass.states,this._filter),(e=>e),(e=>n.dy`<ha-check-list-item .value="${e}" .selected="${(this.value||[]).includes(e)}" graphic="icon"> <ha-domain-icon slot="graphic" .hass="${this.hass}" .domain="${e}" brand-fallback></ha-domain-icon> ${(0,c.Lh)(this.hass.localize,e)} </ha-check-list-item>`))} </mwc-list> `:n.Ld} </ha-expansion-panel> `}},{kind:"field",key:"_domains",value(){return(0,o.Z)(((e,t)=>{const i=new Set;return Object.keys(e).forEach((e=>{i.add((0,p.M)(e))})),Array.from(i.values()).map((e=>({domain:e,name:(0,c.Lh)(this.hass.localize,e)}))).filter((e=>!t||e.domain.toLowerCase().includes(t)||e.name.toLowerCase().includes(t))).sort(((e,t)=>(0,d.$K)(e.name,t.name,this.hass.locale.language))).map((e=>e.domain))}))}},{kind:"method",key:"updated",value:function(e){e.has("expanded")&&this.expanded&&setTimeout((()=>{this.expanded&&(this.renderRoot.querySelector("mwc-list").style.height=this.clientHeight-49-32+"px")}),300)}},{kind:"method",key:"_expandedWillChange",value:function(e){this._shouldRender=e.detail.expanded}},{kind:"method",key:"_expandedChanged",value:function(e){this.expanded=e.detail.expanded}},{kind:"method",key:"_handleItemClick",value:function(e){const t=e.target.closest("ha-check-list-item"),i=t?.value;i&&(this.value?.includes(i)?this.value=this.value?.filter((e=>e!==i)):this.value=[...this.value||[],i],t.selected=this.value.includes(i),(0,r.B)(this,"data-table-filter-changed",{value:this.value,items:void 0}))}},{kind:"method",key:"_clearFilter",value:function(e){e.preventDefault(),this.value=void 0,(0,r.B)(this,"data-table-filter-changed",{value:void 0,items:void 0})}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value.toLowerCase()}},{kind:"get",static:!0,key:"styles",value:function(){return[h.$c,n.iv`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:0;--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:initial;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;min-width:16px;box-sizing:border-box;border-radius:50%;font-weight:400;font-size:11px;background-color:var(--primary-color);line-height:16px;text-align:center;padding:0px 2px;color:var(--text-primary-color)}search-input-outlined{display:block;padding:0 8px}`]}}]}}),n.oi);t()}catch(e){t(e)}}))},18216:function(e,t,i){i.d(t,{G1:()=>n,Rm:()=>s,W2:()=>a,YL:()=>l});const a=e=>e.callWS({type:"counter/list"}),n=(e,t)=>e.callWS({type:"counter/create",...t}),s=(e,t,i)=>e.callWS({type:"counter/update",counter_id:t,...i}),l=(e,t)=>e.callWS({type:"counter/delete",counter_id:t})},62992:function(e,t,i){i.d(t,{m:()=>s});const a=async(e,t,i,n,s,...l)=>{const o=s,r=o[e],d=r=>n&&n(s,r.result)!==r.cacheKey?(o[e]=void 0,a(e,t,i,n,s,...l)):r.result;if(r)return r instanceof Promise?r.then(d):d(r);const c=i(s,...l);return o[e]=c,c.then((i=>{o[e]={result:i,cacheKey:n?.(s,i)},setTimeout((()=>{o[e]=void 0}),t)}),(()=>{o[e]=void 0})),c},n=e=>e.callWS({type:"entity/source"}),s=e=>a("_entitySources",3e4,n,(e=>Object.keys(e.states).length),e)},22431:function(e,t,i){i.d(t,{E:()=>u});var a=i(18216),n=i(9343),s=i(6819),l=i(25542),o=i(57800),r=i(67759),d=i(52261),c=i(76154),h=i(84428);const u={input_boolean:{fetch:n.Aj,update:n.Xr,delete:n.wO},input_button:{fetch:s.fY,update:s.Wq,delete:s.Wx},input_text:{fetch:d.YL,update:d.jt,delete:d.KB},input_number:{fetch:o.K4,update:o.hb,delete:o.fH},input_datetime:{fetch:l.s2,update:l.FF,delete:l.Gi},input_select:{fetch:r.LN,update:r.ON,delete:r.H3},counter:{fetch:a.W2,update:a.Rm,delete:a.YL},timer:{fetch:h.aT,update:h.mZ,delete:h.WH},schedule:{fetch:c.fn,update:c.Fv,delete:c.wn}}},9343:function(e,t,i){i.d(t,{Aj:()=>a,Xr:()=>s,Z0:()=>n,wO:()=>l});const a=e=>e.callWS({type:"input_boolean/list"}),n=(e,t)=>e.callWS({type:"input_boolean/create",...t}),s=(e,t,i)=>e.callWS({type:"input_boolean/update",input_boolean_id:t,...i}),l=(e,t)=>e.callWS({type:"input_boolean/delete",input_boolean_id:t})},6819:function(e,t,i){i.d(t,{Sv:()=>n,Wq:()=>s,Wx:()=>l,fY:()=>a});const a=e=>e.callWS({type:"input_button/list"}),n=(e,t)=>e.callWS({type:"input_button/create",...t}),s=(e,t,i)=>e.callWS({type:"input_button/update",input_button_id:t,...i}),l=(e,t)=>e.callWS({type:"input_button/delete",input_button_id:t})},25542:function(e,t,i){i.d(t,{FF:()=>o,Gi:()=>r,Qp:()=>n,g2:()=>a,s2:()=>s,vY:()=>l});const a=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,n=(e,t,i=void 0,a=void 0)=>{const n={entity_id:t,time:i,date:a};e.callService("input_datetime","set_datetime",n)},s=e=>e.callWS({type:"input_datetime/list"}),l=(e,t)=>e.callWS({type:"input_datetime/create",...t}),o=(e,t,i)=>e.callWS({type:"input_datetime/update",input_datetime_id:t,...i}),r=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},57800:function(e,t,i){i.d(t,{K4:()=>a,Mt:()=>n,fH:()=>l,hb:()=>s});const a=e=>e.callWS({type:"input_number/list"}),n=(e,t)=>e.callWS({type:"input_number/create",...t}),s=(e,t,i)=>e.callWS({type:"input_number/update",input_number_id:t,...i}),l=(e,t)=>e.callWS({type:"input_number/delete",input_number_id:t})},67759:function(e,t,i){i.d(t,{Ek:()=>s,H3:()=>o,LN:()=>n,ON:()=>l,cv:()=>a});const a=(e,t,i)=>e.callService("input_select","select_option",{option:i,entity_id:t}),n=e=>e.callWS({type:"input_select/list"}),s=(e,t)=>e.callWS({type:"input_select/create",...t}),l=(e,t,i)=>e.callWS({type:"input_select/update",input_select_id:t,...i}),o=(e,t)=>e.callWS({type:"input_select/delete",input_select_id:t})},52261:function(e,t,i){i.d(t,{$t:()=>s,KB:()=>o,YL:()=>n,jt:()=>l,sO:()=>a});const a=(e,t,i)=>e.callService(t.split(".",1)[0],"set_value",{value:i,entity_id:t}),n=e=>e.callWS({type:"input_text/list"}),s=(e,t)=>e.callWS({type:"input_text/create",...t}),l=(e,t,i)=>e.callWS({type:"input_text/update",input_text_id:t,...i}),o=(e,t)=>e.callWS({type:"input_text/delete",input_text_id:t})},76154:function(e,t,i){i.d(t,{AS:()=>s,Fv:()=>l,KY:()=>a,fn:()=>n,wn:()=>o});const a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n=e=>e.callWS({type:"schedule/list"}),s=(e,t)=>e.callWS({type:"schedule/create",...t}),l=(e,t,i)=>e.callWS({type:"schedule/update",schedule_id:t,...i}),o=(e,t)=>e.callWS({type:"schedule/delete",schedule_id:t})},84428:function(e,t,i){i.d(t,{rv:()=>d,mK:()=>r,aT:()=>n,mZ:()=>l,eF:()=>s,WH:()=>o});i(9359),i(70104);var a=i(43537);const n=e=>e.callWS({type:"timer/list"}),s=(e,t)=>e.callWS({type:"timer/create",...t}),l=(e,t,i)=>e.callWS({type:"timer/update",timer_id:t,...i}),o=(e,t)=>e.callWS({type:"timer/delete",timer_id:t}),r=e=>{if(!e.attributes.remaining)return;let t=function(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}(e.attributes.remaining);if("active"===e.state){const i=(new Date).getTime(),a=new Date(e.attributes.finishes_at).getTime();t=Math.max((a-i)/1e3,0)}return t},d=(e,t,i)=>{if(!t)return null;if("idle"===t.state||0===i)return e.formatEntityState(t);let n=(0,a.Z)(i||0)||"0";return"paused"===t.state&&(n=`${n} (${e.formatEntityState(t)})`),n}},12939:function(e,t,i){i.d(t,{A:()=>n});var a=i(36522);const n=(e,t)=>(0,a.B)(e,"hass-more-info",t)},75375:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(44249),s=i(57243),l=i(15093),o=i(17170),r=(i(54202),i(43344),i(28008)),d=e([o]);o=(d.then?(await d)():d)[0];(0,n.Z)([(0,l.Mo)("hass-loading-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,attribute:"no-toolbar"})],key:"noToolbar",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"rootnav",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"message",value:void 0},{kind:"method",key:"render",value:function(){return s.dy` ${this.noToolbar?"":s.dy`<div class="toolbar"> ${this.rootnav||history.state?.root?s.dy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:s.dy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._handleBack}"></ha-icon-button-arrow-prev> `} </div>`} <div class="content"> <ha-spinner></ha-spinner> ${this.message?s.dy`<div id="loading-text">${this.message}</div>`:s.Ld} </div> `}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,s.iv`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`]}}]}}),s.oi);a()}catch(e){a(e)}}))},89783:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaConfigEntities:()=>ee});var n=i(44249),s=i(72621),l=(i(92745),i(9359),i(68107),i(56475),i(1331),i(31526),i(70104),i(52924),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(75656),i(50100),i(18084),i(60738)),o=i(57243),r=i(15093),d=i(20552),c=i(69634),h=i(27486),u=i(75011),p=i(64214),f=i(68958),_=i(73850),m=i(27015),b=i(96530),g=i(22431),v=i(47194),y=i(46355),k=i(35076),x=(i(10504),i(99426),i(34273),i(48103),i(51868),i(76268),i(72807)),$=(i(43082),i(87315)),C=(i(86735),i(9425),i(65981),i(23334),i(7843),i(4573),i(37583),i(56032)),w=i(75101),S=i(30635),L=i(96194),A=i(63318),M=i(57816),z=i(62992),H=i(63860),E=i(76131),W=i(12939),B=i(75375),Z=(i(38419),i(6736)),F=i(28008),T=i(82967),V=(i(44536),i(84361)),O=i(26345),P=e([x,$,C,B,p]);[x,$,C,B,p]=P.then?(await P)():P;const D="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",j="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",N="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",R="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",I="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",Y="M12,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,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",K="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",G="M7,10L12,15L17,10H7Z",q="M18.66,2C18.4,2 18.16,2.09 17.97,2.28L16.13,4.13L19.88,7.88L21.72,6.03C22.11,5.64 22.11,5 21.72,4.63L19.38,2.28C19.18,2.09 18.91,2 18.66,2M3.28,4L2,5.28L8.5,11.75L4,16.25V20H7.75L12.25,15.5L18.72,22L20,20.72L13.5,14.25L9.75,10.5L3.28,4M15.06,5.19L11.03,9.22L14.78,12.97L18.81,8.94L15.06,5.19Z",U="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",X="M13 3C8 3 4 7 4 12H1L4.9 15.9L5 16L9 12H6C6 8.1 9.1 5 13 5S20 8.1 20 12 16.9 19 13 19C11.1 19 9.3 18.2 8.1 16.9L6.7 18.3C8.3 20 10.5 21 13 21C18 21 22 17 22 12S18 3 13 3M12 15H14V17H12V15M12 7H14V13H12V7",Q="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z",J="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";let ee=(0,n.Z)([(0,r.Mo)("ha-config-entities")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_stateEntities",value:()=>[]},{kind:"field",decorators:[(0,r.SB)()],key:"_entries",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_subEntries",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_manifests",value:void 0},{kind:"field",decorators:[(0,r.SB)(),(0,l.F_)({context:S.we,subscribe:!0})],key:"_entities",value:void 0},{kind:"field",decorators:[(0,f.t)({storage:"sessionStorage",key:"entities-table-search",state:!0,subscribe:!1})],key:"_filter",value:()=>history.state?.filter||""},{kind:"field",decorators:[(0,r.SB)()],key:"_searchParms",value:()=>new URLSearchParams(window.location.search)},{kind:"field",decorators:[(0,f.t)({storage:"sessionStorage",key:"entities-table-filters",state:!0,subscribe:!1})],key:"_filters",value:()=>({})},{kind:"field",decorators:[(0,r.SB)()],key:"_filteredItems",value:()=>({})},{kind:"field",decorators:[(0,r.SB)()],key:"_selected",value:()=>[]},{kind:"field",decorators:[(0,r.SB)()],key:"_expandedFilter",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_labels",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_entitySources",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-sort",state:!1,subscribe:!1})],key:"_activeSorting",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-grouping",state:!1,subscribe:!1})],key:"_activeGrouping",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-collapsed",state:!1,subscribe:!1})],key:"_activeCollapsed",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-column-order",state:!1,subscribe:!1})],key:"_activeColumnOrder",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-hidden-columns",state:!1,subscribe:!1})],key:"_activeHiddenColumns",value:void 0},{kind:"field",decorators:[(0,r.IO)("hass-tabs-subpage-data-table",!0)],key:"_dataTable",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}},{kind:"field",key:"_locationChanged",value(){return()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_popState",value(){return()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_states",value:()=>(0,h.Z)((e=>[{value:"available",label:e("ui.panel.config.entities.picker.status.available")},{value:"unavailable",label:e("ui.panel.config.entities.picker.status.unavailable")},{value:"enabled",label:e("ui.panel.config.entities.picker.status.enabled")},{value:"disabled",label:e("ui.panel.config.entities.picker.status.disabled")},{value:"visible",label:e("ui.panel.config.entities.picker.status.visible")},{value:"hidden",label:e("ui.panel.config.entities.picker.status.hidden")},{value:"readonly",label:e("ui.panel.config.entities.picker.status.unmanageable")},{value:"restored",label:e("ui.panel.config.entities.picker.status.not_provided")}]))},{kind:"field",key:"_columns",value(){return(0,h.Z)((e=>({icon:{title:"",label:e("ui.panel.config.entities.picker.headers.state_icon"),type:"icon",showNarrow:!0,moveable:!1,template:e=>e.icon?o.dy`<ha-icon .icon="${e.icon}"></ha-icon>`:e.entity?o.dy` <ha-state-icon title="${(0,d.o)(e.entity?this.hass.formatEntityState(e.entity):void 0)}" slot="item-icon" .hass="${this.hass}" .stateObj="${e.entity}"></ha-state-icon> `:o.dy`<ha-domain-icon .domain="${(0,_.M)(e.entity_id)}"></ha-domain-icon>`},name:{main:!0,title:e("ui.panel.config.entities.picker.headers.name"),sortable:!0,filterable:!0,direction:"asc",flex:2,extraTemplate:e=>e.label_entries.length?o.dy` <ha-data-table-labels .labels="${e.label_entries}"></ha-data-table-labels> `:o.Ld},entity_id:{title:e("ui.panel.config.entities.picker.headers.entity_id"),sortable:!0,filterable:!0},localized_platform:{title:e("ui.panel.config.entities.picker.headers.integration"),sortable:!0,groupable:!0,filterable:!0},domain:{title:e("ui.panel.config.entities.picker.headers.domain"),sortable:!1,hidden:!0,filterable:!0,groupable:!0},area:{title:e("ui.panel.config.entities.picker.headers.area"),sortable:!0,filterable:!0,groupable:!0},disabled_by:{title:e("ui.panel.config.entities.picker.headers.disabled_by"),hidden:!0,filterable:!0,template:e=>null===e.disabled_by?"":this.hass.localize(`config_entry.disabled_by.${e.disabled_by}`)},status:{title:e("ui.panel.config.entities.picker.headers.status"),type:"icon",showNarrow:!0,sortable:!0,filterable:!0,minWidth:"80px",maxWidth:"80px",template:e=>e.unavailable||e.disabled_by||e.hidden_by||e.readonly?o.dy` <div tabindex="0" style="display:inline-block;position:relative"> <ha-tooltip placement="left" .content="${e.restored?this.hass.localize("ui.panel.config.entities.picker.status.not_provided"):e.unavailable?this.hass.localize("ui.panel.config.entities.picker.status.unavailable"):e.disabled_by?this.hass.localize("ui.panel.config.entities.picker.status.disabled"):e.hidden_by?this.hass.localize("ui.panel.config.entities.picker.status.hidden"):this.hass.localize("ui.panel.config.entities.picker.status.unmanageable")}"> <ha-svg-icon style="${(0,c.V)({color:e.unavailable?"var(--error-color)":""})}" .path="${e.restored?X:e.unavailable?D:e.disabled_by?j:e.hidden_by?K:q}"></ha-svg-icon> </ha-tooltip> </div> `:"—"},created_at:{title:e("ui.panel.config.generic.headers.created_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.created_at?(0,p.Fu)(new Date(1e3*e.created_at),this.hass.locale,this.hass.config):"—"},modified_at:{title:e("ui.panel.config.generic.headers.modified_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.modified_at?(0,p.Fu)(new Date(1e3*e.modified_at),this.hass.locale,this.hass.config):"—"},available:{title:e("ui.panel.config.entities.picker.headers.availability"),sortable:!0,groupable:!0,hidden:!0},visible:{title:e("ui.panel.config.entities.picker.headers.visibility"),sortable:!0,groupable:!0,hidden:!0},enabled:{title:e("ui.panel.config.entities.picker.headers.enabled"),sortable:!0,groupable:!0,hidden:!0},labels:{title:"",hidden:!0,filterable:!0,template:e=>e.label_entries.map((e=>e.name)).join(" ")}})))}},{kind:"field",key:"_filteredEntitiesAndDomains",value(){return(0,h.Z)(((e,t,i,a,n,s,l,o,r)=>{const d=[],c=s["ha-filter-states"],h=!c?.length||c.includes("enabled"),u=!c?.length||c.includes("disabled"),p=!c?.length||c.includes("visible"),f=!c?.length||c.includes("hidden"),m=!c?.length||c.includes("available"),b=!c?.length||c.includes("unavailable"),g=!c?.length||c.includes("restored"),v=!c?.length||c.includes("readonly");let y,k=t.concat(n);const x=new Set;Object.entries(s).forEach((([e,t])=>{if("config_entry"===e&&Array.isArray(t)&&t.length){if(k=k.filter((e=>e.config_entry_id&&t.includes(e.config_entry_id))),!o)return void this._loadConfigEntries();const e=o.filter((e=>e.entry_id&&t.includes(e.entry_id)));e.forEach((e=>{x.add(e.domain)})),1===e.length&&(y=e[0])}else if("sub_entry"===e&&Array.isArray(t)&&t.length){if(!Array.isArray(this._filters.config_entry)||1!==this._filters.config_entry.length)return;k=k.filter((e=>e.config_subentry_id&&t.includes(e.config_subentry_id))),this._subEntries||this._loadSubEntries(this._filters.config_entry[0])}else if("ha-filter-integrations"===e&&Array.isArray(t)&&t.length){if(!o)return void this._loadConfigEntries();const e=o.filter((e=>t.includes(e.domain))).map((e=>e.entry_id)),i=new Set,a=this._entitySources||{},n={};for(const[e,t]of Object.entries(a))t.domain in n||(n[t.domain]=[]),n[t.domain].push(e);for(const e of t)e in n&&n[e].forEach((e=>i.add(e)));k=k.filter((a=>i.has(a.entity_id)||t.includes(a.platform)||a.config_entry_id&&e.includes(a.config_entry_id))),t.forEach((e=>x.add(e)))}else"ha-filter-domains"===e&&Array.isArray(t)&&t.length?k=k.filter((e=>t.includes((0,_.M)(e.entity_id)))):"ha-filter-labels"===e&&Array.isArray(t)&&t.length&&(k=k.filter((e=>e.labels.some((e=>t.includes(e))))))})),Object.values(l).forEach((e=>{e&&(k=k.filter((t=>e.has(t.entity_id))))}));for(const t of k){const n=this.hass.states[t.entity_id],s=n?.state===L.nZ,l=!0===n?.attributes.restored,o=t.area_id??i[t.device_id]?.area_id,c=o?a[o]:void 0,y=!!t.hidden_by,k=!!t.disabled_by,x=t.readonly,$=n?.state&&n.state!==L.nZ;if(!(m&&$||b&&s||g&&l||p&&!y||f&&y||u&&k||h&&!k||v&&x))continue;const C=(r&&t?.labels||[]).map((e=>r.find((t=>t.label_id===e))));d.push({...t,entity:n,name:(0,A.vA)(this.hass,t),unavailable:s,restored:l,localized_platform:(0,M.Lh)(e,t.platform),area:c?c.name:"—",domain:(0,M.Lh)(e,(0,_.M)(t.entity_id)),status:e(l?"ui.panel.config.entities.picker.status.not_provided":s?"ui.panel.config.entities.picker.status.unavailable":k?"ui.panel.config.entities.picker.status.disabled":y?"ui.panel.config.entities.picker.status.hidden":x?"ui.panel.config.entities.picker.status.unmanageable":"ui.panel.config.entities.picker.status.available"),label_entries:C,available:e(s?"ui.panel.config.entities.picker.status.unavailable":"ui.panel.config.entities.picker.status.available"),enabled:e(k?"ui.panel.config.entities.picker.status.disabled":"ui.panel.config.entities.picker.status.enabled"),visible:e(y?"ui.panel.config.entities.picker.status.hidden":"ui.panel.config.entities.picker.status.visible")})}return{filteredEntities:d,filteredConfigEntry:y,filteredDomains:x}}))}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,H.f4)(this.hass.connection,(e=>{this._labels=e}))]}},{kind:"method",key:"render",value:function(){if(!this.hass||void 0===this._entities)return o.dy` <hass-loading-screen></hass-loading-screen> `;const{filteredEntities:e,filteredDomains:t}=this._filteredEntitiesAndDomains(this.hass.localize,this._entities,this.hass.devices,this.hass.areas,this._stateEntities,this._filters,this._filteredItems,this._entries,this._labels),i=1===t.size&&y.S.includes([...t][0]),a=o.dy` ${this._labels?.map((e=>{const t=e.color?(0,u.I)(e.color):void 0,i=this._selected.every((t=>this.hass.entities[t]?.labels.includes(e.label_id))),a=!i&&this._selected.some((t=>this.hass.entities[t]?.labels.includes(e.label_id)));return o.dy`<ha-md-menu-item .value="${e.label_id}" .action="${i?"remove":"add"}" @click="${this._handleBulkLabel}" keep-open> <ha-checkbox slot="start" .checked="${i}" .indeterminate="${a}" reducedTouchTarget></ha-checkbox> <ha-label style="${t?`--color: ${t}`:""}"> ${e.icon?o.dy`<ha-icon slot="icon" .icon="${e.icon}"></ha-icon>`:o.Ld} ${e.name} </ha-label> </ha-md-menu-item>`}))} <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${this._bulkCreateLabel}"> <div slot="headline"> ${this.hass.localize("ui.panel.config.labels.add_label")} </div></ha-md-menu-item>`;return o.dy` <hass-tabs-subpage-data-table .hass="${this.hass}" .narrow="${this.narrow}" .backPath="${this._searchParms.has("historyBack")?void 0:"/config"}" .route="${this.route}" .tabs="${T.configSections.devices}" .columns="${this._columns(this.hass.localize)}" .data="${e}" .searchLabel="${this.hass.localize("ui.panel.config.entities.picker.search",{number:e.length})}" has-filters .filters="${Object.values(this._filters).filter((e=>Array.isArray(e)?e.length:e&&Object.values(e).some((e=>Array.isArray(e)?e.length:e)))).length}" selectable .selected="${this._selected.length}" .initialGroupColumn="${this._activeGrouping}" .initialCollapsedGroups="${this._activeCollapsed}" .initialSorting="${this._activeSorting}" .columnOrder="${this._activeColumnOrder}" .hiddenColumns="${this._activeHiddenColumns}" @columns-changed="${this._handleColumnsChanged}" @sorting-changed="${this._handleSortingChanged}" @grouping-changed="${this._handleGroupingChanged}" @collapsed-changed="${this._handleCollapseChanged}" @selection-changed="${this._handleSelectionChanged}" clickable @clear-filter="${this._clearFilter}" .filter="${this._filter}" @search-changed="${this._handleSearchChange}" @row-click="${this._openEditEntry}" id="entity_id" .hasFab="${i}" class="${this.narrow?"narrow":""}"> <ha-integration-overflow-menu .hass="${this.hass}" slot="toolbar-icon"></ha-integration-overflow-menu> ${this.narrow?o.Ld:o.dy`<ha-md-button-menu slot="selection-bar"> <ha-assist-chip slot="trigger" .label="${this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label")}"> <ha-svg-icon slot="trailing-icon" .path="${G}"></ha-svg-icon> </ha-assist-chip> ${a} </ha-md-button-menu>`} <ha-md-button-menu has-overflow slot="selection-bar"> ${this.narrow?o.dy`<ha-assist-chip .label="${this.hass.localize("ui.panel.config.automation.picker.bulk_action")}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${G}"></ha-svg-icon> </ha-assist-chip>`:o.dy`<ha-icon-button .path="${I}" .label="${this.hass.localize("ui.panel.config.automation.picker.bulk_action")}" slot="trigger"></ha-icon-button>`} <ha-svg-icon slot="trailing-icon" .path="${G}"></ha-svg-icon> ${this.narrow?o.dy`<ha-sub-menu> <ha-md-menu-item slot="item"> <div slot="headline"> ${this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label")} </div> <ha-svg-icon slot="end" .path="${N}"></ha-svg-icon> </ha-md-menu-item> <ha-menu slot="menu">${a}</ha-menu> </ha-sub-menu> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider>`:o.Ld} <ha-md-menu-item .clickAction="${this._enableSelected}"> <ha-svg-icon slot="start" .path="${Q}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize("ui.panel.config.entities.picker.enable_selected.button")} </div> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._disableSelected}"> <ha-svg-icon slot="start" .path="${J}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize("ui.panel.config.entities.picker.disable_selected.button")} </div> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${this._unhideSelected}"> <ha-svg-icon slot="start" .path="${Y}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize("ui.panel.config.entities.picker.unhide_selected.button")} </div> </ha-md-menu-item> <ha-md-menu-item .clickAction="${this._hideSelected}"> <ha-svg-icon slot="start" .path="${K}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize("ui.panel.config.entities.picker.hide_selected.button")} </div> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${this._removeSelected}" class="warning"> <ha-svg-icon slot="start" .path="${R}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize("ui.panel.config.entities.picker.delete_selected.button")} </div> </ha-md-menu-item> </ha-md-button-menu> ${Array.isArray(this._filters.config_entry)&&this._filters.config_entry.length?o.dy`<ha-alert slot="filter-pane"> ${this.hass.localize("ui.panel.config.entities.picker.filtering_by_config_entry")} ${this._entries?.find((e=>e.entry_id===this._filters.config_entry[0]))?.title||this._filters.config_entry[0]}${1===this._filters.config_entry.length&&Array.isArray(this._filters.sub_entry)&&this._filters.sub_entry.length?o.dy` (${this._subEntries?.find((e=>e.subentry_id===this._filters.sub_entry[0]))?.title||this._filters.sub_entry[0]})`:o.Ld} </ha-alert>`:o.Ld} <ha-filter-floor-areas .hass="${this.hass}" type="entity" .value="${this._filters["ha-filter-floor-areas"]}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-floor-areas"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-floor-areas> <ha-filter-devices .hass="${this.hass}" .type="${"entity"}" .value="${this._filters["ha-filter-devices"]}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-devices"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-devices> <ha-filter-domains .hass="${this.hass}" .value="${this._filters["ha-filter-domains"]}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-domains"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-domains> <ha-filter-integrations .hass="${this.hass}" .value="${this._filters["ha-filter-integrations"]}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-integrations"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-integrations> <ha-filter-states .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.entities.picker.headers.status")}" .value="${this._filters["ha-filter-states"]}" .states="${this._states(this.hass.localize)}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-states"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-states> <ha-filter-labels .hass="${this.hass}" .value="${this._filters["ha-filter-labels"]}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" .expanded="${"ha-filter-labels"===this._expandedFilter}" .narrow="${this.narrow}" @expanded-changed="${this._filterExpanded}"></ha-filter-labels> ${i?o.dy`<ha-fab .label="${this.hass.localize("ui.panel.config.devices.add_device")}" extended @click="${this._addDevice}" slot="fab"> <ha-svg-icon slot="icon" .path="${U}"></ha-svg-icon> </ha-fab>`:o.Ld} </hass-tabs-subpage-data-table> `}},{kind:"method",key:"_filterExpanded",value:function(e){e.detail.expanded?this._expandedFilter=e.target.localName:this._expandedFilter===e.target.localName&&(this._expandedFilter=void 0)}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.target.localName;this._filters={...this._filters,[t]:e.detail.value},this._filteredItems={...this._filteredItems,[t]:e.detail.items}}},{kind:"method",key:"firstUpdated",value:function(){(0,z.m)(this.hass).then((e=>{this._entitySources=e})),this._setFiltersFromUrl(),Object.keys(this._filters).length||(this._filters={"ha-filter-states":["enabled"]})}},{kind:"method",key:"_setFiltersFromUrl",value:function(){const e=this._searchParms.get("domain"),t=this._searchParms.get("config_entry"),i=this._searchParms.get("sub_entry"),a=this._searchParms.has("label");(e||t||a)&&(this._filter=history.state?.filter||"",this._filters={"ha-filter-states":[],"ha-filter-integrations":e?[e]:[],config_entry:t?[t]:[],sub_entry:i?[i]:[]},this._filterLabel())}},{kind:"method",key:"_filterLabel",value:function(){const e=this._searchParms.get("label");e&&(this._filters={...this._filters,"ha-filter-labels":[e]})}},{kind:"method",key:"_clearFilter",value:function(){this._filters={},this._filteredItems={}}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(i,"willUpdate",this,3)([e]);const t=e.get("hass");let a=!1;if(this.hass&&this._entities&&(e.has("hass")&&(!t||t.states!==this.hass.states)||e.has("_entities")||e.has("_entitySources"))){const i=[],n=new Set(this._entities.map((e=>e.entity_id)));for(const s of Object.keys(this.hass.states))n.has(s)||(!e.has("_entitySources")&&(!e.has("hass")||t&&t.states[s])||(a=!0),i.push({name:(0,v.C)(this.hass.states[s]),entity_id:s,platform:this._entitySources?.[s]?.domain||(0,_.M)(s),disabled_by:null,hidden_by:null,area_id:null,config_entry_id:null,config_subentry_id:null,device_id:null,icon:null,readonly:!0,selectable:!1,entity_category:null,has_entity_name:!1,options:null,labels:[],categories:{},created_at:0,modified_at:0}));a&&(this._stateEntities=i)}}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value,history.replaceState({filter:this._filter},"")}},{kind:"method",key:"_handleSelectionChanged",value:function(e){this._selected=e.detail.value}},{kind:"field",key:"_enableSelected",value(){return async()=>{(0,E.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.enable_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.enable_selected.confirm_text"),confirmText:this.hass.localize("ui.common.enable"),dismissText:this.hass.localize("ui.common.cancel"),confirm:async()=>{let e=!1,t=0;const i=await Promise.allSettled(this._selected.map((async i=>{const a=await(0,A.Nv)(this.hass,i,{disabled_by:null});a.require_restart&&(e=!0),a.reload_delay&&(t=Math.max(t,a.reload_delay))})));if((0,k.M)(i)){const e=(0,k.a)(i);(0,E.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:o.dy`<pre> ${e.map((e=>e.reason.message||e.reason.code||e.reason)).join("\r\n")}</pre>`})}this._clearSelection(),e?(0,E.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_restart_confirm")}):t&&(0,E.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_delay_confirm",{delay:t})})}})}}},{kind:"field",key:"_disableSelected",value(){return()=>{(0,E.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.disable_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.disable_selected.confirm_text"),confirmText:this.hass.localize("ui.common.disable"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{disabled_by:"user"}))),this._clearSelection()}})}}},{kind:"field",key:"_hideSelected",value(){return()=>{(0,E.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.hide_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.hide_selected.confirm"),confirmText:this.hass.localize("ui.common.hide"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{hidden_by:"user"}))),this._clearSelection()}})}}},{kind:"field",key:"_unhideSelected",value(){return()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{hidden_by:null}))),this._clearSelection()}}},{kind:"method",key:"_handleBulkLabel",value:async function(e){const t=e.currentTarget.value,i=e.currentTarget.action;await this._bulkLabel(t,i)}},{kind:"method",key:"_bulkLabel",value:async function(e,t){const i=[];this._selected.forEach((a=>{const n=this.hass.entities[a]||this._entities.find((e=>e.entity_id===a));n&&i.push((0,A.Nv)(this.hass,a,{labels:"add"===t?n.labels.conca