UNPKG

iobroker.lovelace

Version:

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

1 lines 1.32 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[96654],{46493:function(t,s,i){i.a(t,async function(t,n){try{i.r(s);i(16280);var e=i(40445),a=i(5124),h=i(67576),o=i(25240),r=i(22675),c=i(784),g=i(79757),f=i(85979),u=t([o,g,f]);[o,g,f]=u.then?(await u)():u;let y,d,l,_,p=t=>t;class w 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(0,a.qy)(y||(y=p` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,f.j)(this.hass,this._config.entity));const s="open"===t.state||"closed"===t.state||t.state===r.Hh||t.state===r.HV;return(0,a.qy)(d||(d=p` <hui-generic-entity-row .hass="${0}" .config="${0}" .catchInteraction="${0}"> ${0} </hui-generic-entity-row> `),this.hass,this._config,!s,s?(0,a.qy)(l||(l=p` <ha-entity-toggle .hass="${0}" .stateObj="${0}"></ha-entity-toggle> `),this.hass,t):(0,a.qy)(_||(_=p` <div class="text-content"> ${0} </div> `),this.hass.formatEntityState(t)))}}(0,e.Cg)([(0,h.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,e.Cg)([(0,h.wk)()],w.prototype,"_config",void 0),w=(0,e.Cg)([(0,h.EM)("hui-valve-entity-row")],w),n()}catch(y){n(y)}})}}]);