UNPKG

iobroker.lovelace

Version:

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

2 lines 3.67 kB
export const __webpack_ids__=["54694"];export const __webpack_modules__={7803:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HuiThermostatCardEditor:()=>y});var n=a(44249),s=a(57243),o=a(15093),c=a(62900),r=a(36522),h=(a(41307),a(29073),a(37583),a(18200)),d=a(10991),l=a(71295),u=e([l]);l=(u.then?(await u)():u)[0];const f="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",m=["climate-hvac-modes","climate-preset-modes","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes"],_=(0,c.f0)(h.I,(0,c.Ry)({entity:(0,c.jt)((0,c.Z_)()),name:(0,c.jt)((0,c.Z_)()),theme:(0,c.jt)((0,c.Z_)()),show_current_as_primary:(0,c.jt)((0,c.O7)()),features:(0,c.jt)((0,c.IX)((0,c.Yj)()))})),g=[{name:"entity",selector:{entity:{domain:"climate"}}},{type:"grid",name:"",schema:[{name:"name",selector:{text:{}}},{name:"theme",selector:{theme:{}}}]},{name:"show_current_as_primary",selector:{boolean:{}}}];let y=(0,n.Z)([(0,o.Mo)("hui-thermostat-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,c.hu)(e,_),this._config=e}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return s.Ld;const e=this._config.entity,t=e?this.hass.states[e]:void 0;return s.dy` <ha-form .hass="${this.hass}" .data="${this._config}" .schema="${g}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path="${f}"></ha-svg-icon> <h3 slot="header"> ${this.hass.localize("ui.panel.lovelace.editor.card.generic.features")} </h3> <div class="content"> <hui-card-features-editor .hass="${this.hass}" .stateObj="${t}" .featuresTypes="${m}" .features="${this._config.features??[]}" @features-changed="${this._featuresChanged}" @edit-detail-element="${this._editDetailElement}"></hui-card-features-editor> </div> </ha-expansion-panel> `}},{kind:"method",key:"_valueChanged",value:function(e){(0,r.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,a={...this._config,features:t};0===t.length&&delete a.features,(0,r.B)(this,"config-changed",{config:a})}},{kind:"method",key:"_editDetailElement",value:function(e){const t=e.detail.subElementConfig.index,a=this._config.features[t];(0,r.B)(this,"edit-sub-element",{config:a,saveConfig:e=>this._updateFeature(t,e),context:{entity_id:this._config.entity},type:"feature"})}},{kind:"method",key:"_updateFeature",value:function(e,t){const a=this._config.features.concat();a[e]=t;const i={...this._config,features:a};(0,r.B)(this,"config-changed",{config:i})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>"show_current_as_primary"===e.name?this.hass.localize("ui.panel.lovelace.editor.card.thermostat.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,s.iv`ha-form{display:block;margin-bottom:24px}`]}}]}}),s.oi);i()}catch(e){i(e)}}))},18200:function(e,t,a){a.d(t,{I:()=>n});var i=a(62900);const n=(0,i.Ry)({type:(0,i.Z_)(),view_layout:(0,i.Yj)(),layout_options:(0,i.Yj)(),grid_options:(0,i.Yj)(),visibility:(0,i.Yj)()})}}; //# sourceMappingURL=54694.59ec68004c7d0c53.js.map