iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 2 kB
JavaScript
export const __rspack_esm_id=82230;export const __rspack_esm_ids=[82230];export const __webpack_modules__={25494(t,e,s){s.d(e,{B4:()=>a,KF:()=>o,fi:()=>i});const o=({field:t,customize:e,options:s})=>[{name:"customize",selector:{boolean:{}}},...e?[{name:t,selector:{select:{mode:"list",reorder:!0,multiple:!0,options:s}}}]:[]],a=(t,e)=>({...t,customize:void 0!==t[e]}),i=(t,e,s)=>{const{customize:o,...a}=t,i=a;return o&&!i[e]?i[e]=[...s]:o||delete i[e],i}},1109(t,e,s){s.a(t,async function(t,o){try{s.r(e),s.d(e,{HuiVacuumCommandsCardFeatureEditor:()=>_});s(18111),s(22489),s(61701);var a=s(62826),i=s(5124),c=s(22441),n=s(22786),r=s(1087),m=s(52763),d=s(65115),l=s(37531),u=s(25494),h=t([m]);m=(h.then?(await h)():h)[0];class _ extends i.WF{setConfig(t){this._config=t}render(){if(!this.hass||!this._config)return i.s6;const t=this.context?.entity_id?this.hass.states[this.context.entity_id]:void 0,e=(0,u.B4)(this._config,"commands"),s=this._schema(t,e.customize);return i.qy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${s}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(t){const e=this.context?.entity_id?this.hass.states[this.context.entity_id]:void 0,s=d.vA.filter(t=>e&&(0,d.Fv)(e,t)),o=(0,u.fi)(t.detail.value,"commands",s);(0,r.r)(this,"config-changed",{config:o})}constructor(...t){super(...t),this._schema=(0,n.A)((t,e)=>(0,u.KF)({field:"commands",customize:e,options:l.zz.filter(e=>t&&(0,d.Fv)(t,e)).map(t=>({value:t,label:this.hass.localize(`ui.panel.lovelace.editor.features.types.vacuum-commands.commands_list.${t}`)}))})),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.lovelace.editor.features.types.vacuum-commands.${t.name}`)}}(0,a.Cg)([(0,c.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,c.MZ)({attribute:!1})],_.prototype,"context",void 0),(0,a.Cg)([(0,c.wk)()],_.prototype,"_config",void 0),_=(0,a.Cg)([(0,c.EM)("hui-vacuum-commands-card-feature-editor")],_),o()}catch(t){o(t)}})}};