UNPKG

iobroker.lovelace

Version:

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

1 lines 2.27 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[82230],{25494:function(t,e,s){s.d(e,{B4:function(){return n},KF:function(){return o},fi:function(){return c}});var i=s(86518);s(62953);const a=["customize"],o=({field:t,customize:e,options:s})=>[{name:"customize",selector:{boolean:{}}},...e?[{name:t,selector:{select:{mode:"list",reorder:!0,multiple:!0,options:s}}}]:[]],n=(t,e)=>Object.assign(Object.assign({},t),{},{customize:void 0!==t[e]}),c=(t,e,s)=>{const{customize:o}=t,n=(0,i.A)(t,a);return o&&!n[e]?n[e]=[...s]:o||delete n[e],n}},1109:function(t,e,s){s.a(t,async function(t,i){try{s.r(e),s.d(e,{HuiVacuumCommandsCardFeatureEditor:function(){return p}});s(18111),s(22489),s(61701),s(62953);var a=s(40445),o=s(5124),n=s(67576),c=s(22786),u=s(1087),r=s(52763),l=s(65115),h=s(37531),d=s(25494),m=t([r]);r=(m.then?(await m)():m)[0];let f,v=t=>t;class p extends o.WF{setConfig(t){this._config=t}render(){var t;if(!this.hass||!this._config)return o.s6;const e=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[this.context.entity_id]:void 0,s=(0,d.B4)(this._config,"commands"),i=this._schema(e,s.customize);return(0,o.qy)(f||(f=v` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,s,i,this._computeLabelCallback,this._valueChanged)}_valueChanged(t){var e;const s=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,i=l.vA.filter(t=>s&&(0,l.Fv)(s,t)),a=(0,d.fi)(t.detail.value,"commands",i);(0,u.r)(this,"config-changed",{config:a})}constructor(...t){super(...t),this._schema=(0,c.A)((t,e)=>(0,d.KF)({field:"commands",customize:e,options:h.zz.filter(e=>t&&(0,l.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,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,a.Cg)([(0,n.wk)()],p.prototype,"_config",void 0),p=(0,a.Cg)([(0,n.EM)("hui-vacuum-commands-card-feature-editor")],p),i()}catch(f){i(f)}})}}]);