iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 1.49 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[68827],{53110:function(t,s,i){i.a(t,async function(t,n){try{i.r(s);i(16280),i(18111),i(13579);var e=i(40445),a=i(5124),h=i(67576),o=i(46190),r=i(71727),g=i(25240),u=i(784),c=i(79757),f=i(85979),y=t([g,c,f]);[g,c,f]=y.then?(await y)():y;let d,_,l,p,v=t=>t;class w extends a.WF{_computeCanToggle(t,s){return s.some(s=>{const i=(0,r.m)(s);var n;return"group"===i?this._computeCanToggle(t,null===(n=this.hass)||void 0===n?void 0:n.states[s].attributes.entity_id):o.FD.has(i)})}setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,u.LX)(this,t)}render(){if(!this._config||!this.hass)return a.s6;const t=this.hass.states[this._config.entity];return t?(0,a.qy)(_||(_=v` <hui-generic-entity-row .hass="${0}" .config="${0}"> ${0} </hui-generic-entity-row> `),this.hass,this._config,this._computeCanToggle(this.hass,t.attributes.entity_id)?(0,a.qy)(l||(l=v` <ha-entity-toggle .hass="${0}" .stateObj="${0}"></ha-entity-toggle> `),this.hass,t):(0,a.qy)(p||(p=v` <div class="text-content"> ${0} </div> `),this.hass.formatEntityState(t))):(0,a.qy)(d||(d=v` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,f.j)(this.hass,this._config.entity))}}(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-group-entity-row")],w),n()}catch(d){n(d)}})}}]);