UNPKG

iobroker.lovelace

Version:

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

2 lines 3.85 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["41437"],{16273:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiHumidifierCardEditor:()=>k});var n=i(61701),s=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),r=i(62900),c=i(36522),h=(i(41307),i(29073),i(37583),i(18200)),d=i(10991),u=i(71295),l=e([u]);u=(l.then?(await l)():l)[0];let f,g,m=e=>e;const _="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z",y=["humidifier-modes","humidifier-toggle"],v=(0,r.f0)(h.I,(0,r.Ry)({entity:(0,r.jt)((0,r.Z_)()),name:(0,r.jt)((0,r.Z_)()),theme:(0,r.jt)((0,r.Z_)()),show_current_as_primary:(0,r.jt)((0,r.O7)()),features:(0,r.jt)((0,r.IX)((0,r.Yj)()))})),p=[{name:"entity",required:!0,selector:{entity:{domain:"humidifier"}}},{type:"grid",name:"",schema:[{name:"name",selector:{text:{}}},{name:"theme",selector:{theme:{}}}]},{name:"show_current_as_primary",selector:{boolean:{}}}];let k=(0,n.Z)([(0,o.Mo)("hui-humidifier-card-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,r.hu)(e,v),this._config=e}},{kind:"method",key:"render",value:function(){var e;if(!this.hass||!this._config)return s.Ld;const t=this._config.entity,i=t?this.hass.states[t]:void 0;return(0,s.dy)(f||(f=m` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path="${0}"></ha-svg-icon> <h3 slot="header"> ${0} </h3> <div class="content"> <hui-card-features-editor .hass="${0}" .stateObj="${0}" .featuresTypes="${0}" .features="${0}" @features-changed="${0}" @edit-detail-element="${0}"></hui-card-features-editor> </div> </ha-expansion-panel> `),this.hass,this._config,p,this._computeLabelCallback,this._valueChanged,_,this.hass.localize("ui.panel.lovelace.editor.card.generic.features"),this.hass,i,y,null!==(e=this._config.features)&&void 0!==e?e:[],this._featuresChanged,this._editDetailElement)}},{kind:"method",key:"_valueChanged",value:function(e){(0,c.B)(this,"config-changed",{config:e.detail.value})}},{kind:"method",key:"_featuresChanged",value:function(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t=e.detail.features,i=Object.assign(Object.assign({},this._config),{},{features:t});0===t.length&&delete i.features,(0,c.B)(this,"config-changed",{config:i})}},{kind:"method",key:"_editDetailElement",value:function(e){const t=e.detail.subElementConfig.index,i=this._config.features[t];(0,c.B)(this,"edit-sub-element",{config:i,saveConfig:e=>this._updateFeature(t,e),context:{entity_id:this._config.entity},type:"feature"})}},{kind:"method",key:"_updateFeature",value:function(e,t){const i=this._config.features.concat();i[e]=t;const a=Object.assign(Object.assign({},this._config),{},{features:i});(0,c.B)(this,"config-changed",{config:a})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>"show_current_as_primary"===e.name?this.hass.localize("ui.panel.lovelace.editor.card.humidifier.show_current_as_primary"):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}},{kind:"get",static:!0,key:"styles",value:function(){return[d.A,(0,s.iv)(g||(g=m`ha-form{display:block;margin-bottom:24px}`))]}}]}}),s.oi);a()}catch(f){a(f)}}))},18200:function(e,t,i){i.d(t,{I:()=>n});var a=i(62900);const n=(0,a.Ry)({type:(0,a.Z_)(),view_layout:(0,a.Yj)(),layout_options:(0,a.Yj)(),grid_options:(0,a.Yj)(),visibility:(0,a.Yj)()})}}]); //# sourceMappingURL=41437.7af9e72bb3660fc7.js.map