Initial Commit
This commit is contained in:
commit
d4a69c41be
2748 files changed
+80489
No files matched your search
@@ -0,0 +1,2 @@
|
||||
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([["8660"],{66912:function(e,i,t){t.a(e,(async function(e,i){try{var s=t(73577),a=(t(19083),t(71695),t(61893),t(40251),t(61006),t(39527),t(92181),t(99790),t(13334),t(36993),t(47021),t(57243)),d=t(50778),n=t(27486),r=t(11297),l=t(79575),o=t(32770),c=t(59848),u=t(92374),h=t(69484),v=(t(74064),e([h]));h=(v.then?(await v)():v)[0];let p,y,m=e=>e;const k=e=>(0,a.dy)(p||(p=m`<ha-list-item .twoline="${0}"> <span>${0}</span> <span slot="secondary">${0}</span> </ha-list-item>`),!!e.area,e.name,e.area);(0,s.Z)([(0,d.Mo)("ha-device-picker")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array,attribute:"exclude-devices"})],key:"excludeDevices",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"deviceFilter",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"entityFilter",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,d.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_init",value(){return!1}},{kind:"field",key:"_getDevices",value(){return(0,n.Z)(((e,i,t,s,a,d,n,r,c)=>{if(!e.length)return[{id:"no_devices",area:"",name:this.hass.localize("ui.components.device-picker.no_devices"),strings:[]}];let h={};(s||a||d||r)&&(h=(0,u.R6)(t));let v=e.filter((e=>e.id===this.value||!e.disabled_by));s&&(v=v.filter((e=>{const i=h[e.id];return!(!i||!i.length)&&h[e.id].some((e=>s.includes((0,l.M)(e.entity_id))))}))),a&&(v=v.filter((e=>{const i=h[e.id];return!i||!i.length||t.every((e=>!a.includes((0,l.M)(e.entity_id))))}))),c&&(v=v.filter((e=>!c.includes(e.id)))),d&&(v=v.filter((e=>{const i=h[e.id];return!(!i||!i.length)&&h[e.id].some((e=>{const i=this.hass.states[e.entity_id];return!!i&&(i.attributes.device_class&&d.includes(i.attributes.device_class))}))}))),r&&(v=v.filter((e=>{const i=h[e.id];return!(!i||!i.length)&&i.some((e=>{const i=this.hass.states[e.entity_id];return!!i&&r(i)}))}))),n&&(v=v.filter((e=>e.id===this.value||n(e))));const p=v.map((e=>{const t=(0,u.jL)(e,this.hass,h[e.id]);return{id:e.id,name:t||this.hass.localize("ui.components.device-picker.unnamed_device"),area:e.area_id&&i[e.area_id]?i[e.area_id].name:this.hass.localize("ui.components.device-picker.no_area"),strings:[t||""]}}));return p.length?1===p.length?p:p.sort(((e,i)=>(0,o.$)(e.name||"",i.name||"",this.hass.locale.language))):[{id:"no_devices",area:"",name:this.hass.localize("ui.components.device-picker.no_match"),strings:[]}]}))}},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.open())}},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.focus())}},{kind:"method",key:"updated",value:function(e){if(!this._init&&this.hass||this._init&&e.has("_opened")&&this._opened){this._init=!0;const e=this._getDevices(Object.values(this.hass.devices),this.hass.areas,Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeDevices);this.comboBox.items=e,this.comboBox.filteredItems=e}}},{kind:"method",key:"render",value:function(){return(0,a.dy)(y||(y=m` <ha-combo-box .hass="${0}" .label="${0}" .value="${0}" .helper="${0}" .renderer="${0}" .disabled="${0}" .required="${0}" item-id-path="id" item-value-path="id" item-label-path="name" @opened-changed="${0}" @value-changed="${0}" @filter-changed="${0}"></ha-combo-box> `),this.hass,void 0===this.label&&this.hass?this.hass.localize("ui.components.device-picker.device"):this.label,this._value,this.helper,k,this.disabled,this.required,this._openedChanged,this._deviceChanged,this._filterChanged)}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_filterChanged",value:function(e){const i=e.target,t=e.detail.value.toLowerCase();i.filteredItems=t.length?(0,c.q)(t,i.items||[]):i.items}},{kind:"method",key:"_deviceChanged",value:function(e){e.stopPropagation();let i=e.detail.value;"no_deviLine truncated
|
||||
//# sourceMappingURL=8660.76cebd15df0ddf4c.js.map
|
||||
Reference in new issue
Block a user