iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 2.25 kB
JavaScript
export const __webpack_ids__=["46291"];export const __webpack_modules__={8887:function(e,t,i){i.r(t),i.d(t,{HuiHumidifierModesCardFeatureEditor:()=>n});var s=i(44249),o=(i(9359),i(70104),i(57243)),a=i(15093),d=i(27486),l=i(36522);i(29073);let n=(0,s.Z)([(0,a.Mo)("hui-humidifier-modes-card-feature-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"field",key:"_schema",value:()=>(0,d.Z)(((e,t,i,s)=>[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map((t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.humidifier-modes.style_list.${t}`)})))}}},{name:"customize_modes",selector:{boolean:{}}},...s?[{name:"modes",selector:{select:{reorder:!0,multiple:!0,options:i?.attributes.available_modes?.map((e=>({value:e,label:t(i,"mode",e)})))||[]}}}]:[]]))},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return o.Ld;const e=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0,t={style:"dropdown",...this._config,customize_modes:void 0!==this._config.modes},i=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,e,t.customize_modes);return o.dy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${i}" .computeLabel="${this._computeLabelCallback}" -changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){const{customize_modes:t,...i}=e.detail.value,s=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0;t&&!i.modes&&(i.modes=s?.attributes.available_modes||[]),!t&&i.modes&&delete i.modes,(0,l.B)(this,"config-changed",{config:i})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"style":case"modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.humidifier-modes.${e.name}`);default:return""}}}}]}}),o.oi)}};
//# sourceMappingURL=46291.b2e542086764e1d6.js.map