iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 2.29 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[88532],{25494:function(t,e,s){s.d(e,{B4:function(){return n},KF:function(){return a},fi:function(){return c}});var i=s(86518);s(62953);const o=["customize"],a=({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:a}=t,n=(0,i.A)(t,o);return a&&!n[e]?n[e]=[...s]:a||delete n[e],n}},22303:function(t,e,s){s.a(t,async function(t,i){try{s.r(e),s.d(e,{HuiLawnMowerCommandsCardFeatureEditor:function(){return v}});s(18111),s(22489),s(61701),s(62953);var o=s(40445),a=s(5124),n=s(67576),c=s(22786),r=s(1087),l=s(52763),u=s(38409),h=s(37531),d=s(25494),m=t([l]);l=(m.then?(await m)():m)[0];let f,p=t=>t;class v extends a.WF{setConfig(t){this._config=t}render(){var t;if(!this.hass||!this._config)return a.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,a.qy)(f||(f=p` <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=h.Ry.filter(t=>s&&(0,u.Gw)(s,t)),o=(0,d.fi)(t.detail.value,"commands",i);(0,r.r)(this,"config-changed",{config:o})}constructor(...t){super(...t),this._schema=(0,c.A)((t,e)=>(0,d.KF)({field:"commands",customize:e,options:h.Ry.filter(e=>t&&(0,u.Gw)(t,e)).map(t=>({value:t,label:this.hass.localize(`ui.panel.lovelace.editor.features.types.lawn-mower-commands.commands_list.${t}`)}))})),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.lovelace.editor.features.types.lawn-mower-commands.${t.name}`)}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"context",void 0),(0,o.Cg)([(0,n.wk)()],v.prototype,"_config",void 0),v=(0,o.Cg)([(0,n.EM)("hui-lawn-mower-commands-card-feature-editor")],v),i()}catch(f){i(f)}})}}]);