iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 2.48 kB
JavaScript
export const __rspack_esm_id=68616;export const __rspack_esm_ids=[68616];export const __webpack_modules__={37863(t,e,s){s.d(e,{K:()=>a});const a=s(5124).AH`:host{display:flex;flex-direction:column;flex:1;justify-content:space-between}.controls{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1}.controls:not(:last-child){margin-bottom:var(--ha-space-6)}.controls>:not(:last-child){margin-bottom:var(--ha-space-6)}.buttons{display:flex;align-items:center;justify-content:center;margin-bottom:var(--ha-space-3)}.buttons>*{margin:var(--ha-space-2)}ha-attributes{display:block;width:100%}ha-more-info-control-select-container+ha-attributes:not([empty]){margin-top:var(--ha-space-4)}`},72315(t,e,s){s.a(t,async function(t,a){try{s.r(e);s(18111),s(22489),s(20116),s(61701);var i=s(62826),o=s(5124),n=s(22441),r=s(69558),h=s(68287),c=s(2416),d=s(37863),p=s(2928),b=t([c,p]);[c,p]=b.then?(await b)():b;class l extends o.WF{updated(t){if(!this.hass||!this.stateObj||!t.has("hass")&&!t.has("stateObj"))return;const e=this.stateObj.attributes.entity_id.map(t=>this.hass.states[t]).filter(t=>t);if(!e.length)return this._groupDomainStateObj=void 0,void(this._moreInfoType=void 0);const s=e.find(t=>t.state===this.stateObj.state)||e[0],a=(0,h.z)(this.stateObj);if(a&&"group"!==a){this._groupDomainStateObj={...s,entity_id:this.stateObj.entity_id,last_updated:this.stateObj.last_updated,last_changed:this.stateObj.last_changed,attributes:{...s.attributes,friendly_name:this.stateObj.attributes.friendly_name,entity_id:this.stateObj.attributes.entity_id}};const t=(0,p.mE)(a);(0,p.S5)(t),this._moreInfoType="hidden"===t?void 0:`more-info-${t}`}else this._groupDomainStateObj=void 0,this._moreInfoType=void 0}render(){return this.hass&&this.stateObj?o.qy`${this._moreInfoType?(0,r._)(this._moreInfoType,{hass:this.hass,stateObj:this._groupDomainStateObj}):""} ${this.stateObj.attributes.entity_id.map(t=>{const e=this.hass.states[t];return e?o.qy` <state-card-content .stateObj="${e}" .hass="${this.hass}"></state-card-content> `:""})}`:o.s6}static get styles(){return[d.K,o.AH`state-card-content{display:block;margin-top:var(--ha-space-2)}`]}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"stateObj",void 0),(0,i.Cg)([(0,n.wk)()],l.prototype,"_groupDomainStateObj",void 0),(0,i.Cg)([(0,n.wk)()],l.prototype,"_moreInfoType",void 0),l=(0,i.Cg)([(0,n.EM)("more-info-group")],l),a()}catch(t){a(t)}})}};