iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 1.2 kB
JavaScript
export const __rspack_esm_id=96654;export const __rspack_esm_ids=[96654];export const __webpack_modules__={46493(t,s,i){i.a(t,async function(t,e){try{i.r(s);var n=i(62826),a=i(5124),o=i(22441),h=i(25240),r=i(22675),c=i(784),g=i(79757),_=i(85979),y=t([h,g,_]);[h,g,_]=y.then?(await y)():y;class f extends a.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,c.LX)(this,t)}render(){if(!this._config||!this.hass)return a.s6;const t=this.hass.states[this._config.entity];if(!t)return a.qy` <hui-warning .hass="${this.hass}"> ${(0,_.j)(this.hass,this._config.entity)} </hui-warning> `;const s="open"===t.state||"closed"===t.state||t.state===r.Hh||t.state===r.HV;return a.qy` <hui-generic-entity-row .hass="${this.hass}" .config="${this._config}" .catchInteraction="${!s}"> ${s?a.qy` <ha-entity-toggle .hass="${this.hass}" .stateObj="${t}"></ha-entity-toggle> `:a.qy` <div class="text-content"> ${this.hass.formatEntityState(t)} </div> `} </hui-generic-entity-row> `}}(0,n.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,n.Cg)([(0,o.wk)()],f.prototype,"_config",void 0),f=(0,n.Cg)([(0,o.EM)("hui-valve-entity-row")],f),e()}catch(t){e(t)}})}};