UNPKG

iobroker.lovelace

Version:

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

1 lines 1.45 kB
export const __rspack_esm_id=14328;export const __rspack_esm_ids=[14328];export const __webpack_modules__={38539(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HuiTrendGraphCardFeatureEditor:()=>u});var s=a(62826),r=a(5124),i=a(22441),c=a(1087),n=a(52763),h=a(45429),d=e([n,h]);[n,h]=d.then?(await d)():d;const l=[{name:"hours_to_show",default:24,selector:{number:{min:1,mode:"box"}}},{name:"detail",selector:{boolean:{}}}];class u extends r.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return r.s6;const e={...this._config};return this._config.hours_to_show||(e.hours_to_show=24),void 0===this._config.detail&&(e.detail=!0),r.qy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${l}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){(0,c.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._computeLabelCallback=e=>{switch(e.name){case"hours_to_show":return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`);case"detail":return this.hass.localize("ui.panel.lovelace.editor.features.types.trend-graph.detail");default:return""}}}}(0,s.Cg)([(0,i.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,i.MZ)({attribute:!1})],u.prototype,"context",void 0),(0,s.Cg)([(0,i.wk)()],u.prototype,"_config",void 0),u=(0,s.Cg)([(0,i.EM)("hui-trend-graph-card-feature-editor")],u),o()}catch(e){o(e)}})}};