UNPKG

iobroker.lovelace

Version:

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

2 lines 3.15 kB
export const __webpack_ids__=["74317"];export const __webpack_modules__={28370:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HuiSensorCardEditor:()=>p});var n=a(44249),o=a(57243),s=a(15093),l=a(62900),r=a(36522),c=(a(29073),a(18200)),d=a(10991),u=a(88374),h=e([u]);u=(h.then?(await h)():h)[0];const m=(0,l.f0)(c.I,(0,l.Ry)({entity:(0,l.jt)((0,l.Z_)()),name:(0,l.jt)((0,l.Z_)()),icon:(0,l.jt)((0,l.Z_)()),graph:(0,l.jt)((0,l.G0)([(0,l.i0)("line"),(0,l.i0)("none")])),unit:(0,l.jt)((0,l.Z_)()),detail:(0,l.jt)((0,l.Rx)()),theme:(0,l.jt)((0,l.Z_)()),hours_to_show:(0,l.jt)((0,l.Rx)()),limits:(0,l.jt)((0,l.Ry)({min:(0,l.jt)((0,l.Rx)()),max:(0,l.jt)((0,l.Rx)())}))})),_=[{name:"entity",selector:{entity:{domain:["counter","input_number","number","sensor"]}}},{name:"name",selector:{text:{}}},{type:"grid",name:"",schema:[{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}},{name:"graph",selector:{select:{options:[{value:"none",label:"None"},{value:"line",label:"Line"}]}}},{name:"unit",selector:{text:{}}},{name:"detail",selector:{boolean:{}}},{name:"theme",selector:{theme:{}}},{name:"hours_to_show",default:u.K,selector:{number:{min:1,mode:"box"}}}]},{type:"grid",name:"limits",schema:[{name:"min",selector:{number:{mode:"box"}}},{name:"max",selector:{number:{mode:"box"}}}]}];let p=(0,n.Z)([(0,s.Mo)("hui-sensor-card-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,l.hu)(e,m),this._config=e}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return o.Ld;const e={graph:"none",...this._config,detail:2===this._config.detail};return o.dy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${_}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.detail.value;t.detail=t.detail?2:1,(0,r.B)(this,"config-changed",{config:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"theme":return`${this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;case"detail":return this.hass.localize("ui.panel.lovelace.editor.card.sensor.show_more_detail");case"graph":return this.hass.localize("ui.panel.lovelace.editor.card.sensor.graph_type");case"min":return this.hass.localize("ui.panel.lovelace.editor.card.sensor.limit_min");case"max":return this.hass.localize("ui.panel.lovelace.editor.card.sensor.limit_max");default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}},{kind:"get",static:!0,key:"styles",value:function(){return d.A}}]}}),o.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=74317.7652bd971098290e.js.map