UNPKG

iobroker.lovelace

Version:

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

1 lines 2.52 kB
export const __rspack_esm_id=88899;export const __rspack_esm_ids=[88899];export const __webpack_modules__={2670(e,a,t){t.a(e,async function(e,i){try{t.r(a),t.d(a,{HuiEnergyDevicesCardEditor:()=>m});var s=t(62826),o=t(5124),c=t(22441),r=t(63533),l=t(22786),n=t(1087),d=t(52763),h=t(84698),p=e([d]);d=(p.then?(await p)():p)[0];const _=(0,r.kp)(h.H,(0,r.Ik)({type:(0,r.KC)([(0,r.eu)("energy-devices-graph"),(0,r.eu)("energy-devices-detail-graph")]),title:(0,r.lq)((0,r.Yj)()),collection_key:(0,r.lq)((0,r.Yj)()),max_devices:(0,r.lq)((0,r.ai)()),modes:(0,r.lq)((0,r.YO)((0,r.KC)([(0,r.eu)("bar"),(0,r.eu)("pie")]))),hide_compound_stats:(0,r.lq)((0,r.zM)())})),u=["bar","pie"];class m extends o.WF{setConfig(e){(0,r.vA)(e,_),this._config=e}render(){if(!this.hass||!this._config)return o.s6;const e=this._schema(this.hass.localize,this._config.type),a={...this._config};return o.qy` <ha-form .hass="${this.hass}" .data="${a}" .schema="${e}" .computeLabel="${this._computeLabelCallback}" .computeHelper="${this._computeHelperCallback}" @value-changed="${this._valueChanged}"></ha-form>`}_valueChanged(e){(0,n.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,l.A)((e,a)=>[{name:"title",selector:{text:{}}},{name:"",type:"grid",schema:[..."energy-devices-graph"===a?[{name:"modes",required:!1,selector:{select:{multiple:!0,mode:"list",options:u.map(a=>({value:a,label:e(`ui.panel.lovelace.editor.card.energy-devices-graph.mode_options.${a}`)}))}}},{name:"hide_compound_stats",required:!1,selector:{boolean:{}}}]:[],{name:"max_devices",required:!1,selector:{number:{min:1,mode:"box"}}},{type:"string",name:"collection_key",required:!1}]}]),this._computeHelperCallback=e=>{if("collection_key"===e.name)return this.hass.localize("ui.panel.lovelace.editor.card.generic.collection_key_description")},this._computeLabelCallback=e=>{switch(e.name){case"modes":case"max_devices":case"hide_compound_stats":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-devices-graph.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,s.Cg)([(0,c.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,c.wk)()],m.prototype,"_config",void 0),m=(0,s.Cg)([(0,c.EM)("hui-energy-devices-card-editor")],m),i()}catch(e){i(e)}})},84698(e,a,t){t.d(a,{H:()=>s});var i=t(63533);const s=(0,i.Ik)({type:(0,i.Yj)(),view_layout:(0,i.bz)(),layout_options:(0,i.bz)(),grid_options:(0,i.bz)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}};