UNPKG

iobroker.lovelace

Version:

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

1 lines 4.21 kB
export const __rspack_esm_id=61854;export const __rspack_esm_ids=[61854];export const __webpack_modules__={57150(e,t,i){i.d(t,{Q:()=>o});var s=i(1087);const a=()=>Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(83113),i.e(67218),i.e(58416),i.e(99788),i.e(58303),i.e(21543),i.e(22398),i.e(82134),i.e(46601),i.e(93581),i.e(26092),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(53480),i.e(90790),i.e(89747),i.e(59532),i.e(55076),i.e(87692),i.e(36332),i.e(77563),i.e(15862),i.e(41344),i.e(97500),i.e(49625),i.e(1945)]).then(i.bind(i,78305)),o=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:a,dialogParams:t})}},85633(e,t,i){i.d(t,{X:()=>a});var s=i(1087);const a=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e(44335),i.e(40901)]).then(i.bind(i,54564)),dialogParams:t})}},39693(e,t,i){i.a(e,async function(e,s){try{i.r(t),i.d(t,{HuiUnusedEntities:()=>p});var a=i(62826),o=i(5124),n=i(22441),l=i(6412),c=i(18350),d=(i(67094),i(99939)),h=i(40747),r=i(83824),g=i(57150),v=i(85633),u=e([c,r]);[c,r]=u.then?(await u)():u;const _="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class p extends o.WF{get _config(){return this.lovelace.config}updated(e){super.updated(e),e.has("lovelace")&&this._getUnusedEntities()}render(){return this.hass&&this.lovelace?"storage"===this.lovelace.mode&&!1===this.lovelace.editMode?o.s6:o.qy` <div class="container"> ${this.narrow?"":o.qy` <ha-card header="${this.hass.localize("ui.panel.lovelace.unused_entities.title")}"> <div class="card-content"> ${this.hass.localize("ui.panel.lovelace.unused_entities.available_entities")} ${"storage"===this.lovelace.mode?o.qy` <br>${this.hass.localize("ui.panel.lovelace.unused_entities.select_to_add")} `:""} </div> </ha-card> `} <hui-entity-picker-table .hass="${this.hass}" .narrow="${this.narrow}" .entities="${this._unusedEntities}" @selected-changed="${this._handleSelectedChanged}"></hui-entity-picker-table> </div> <div class="fab ${(0,l.H)({selected:this._selectedEntities.length})}"> <ha-button size="large" @click="${this._addToLovelaceView}"> <ha-svg-icon slot="start" .path="${_}"></ha-svg-icon> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")} </ha-button> </div> `:o.s6}_getUnusedEntities(){if(!this.hass||!this.lovelace)return;this._selectedEntities=[];const e=(0,d.lZ)(this.hass,this._config);this._unusedEntities=[...e].sort()}_handleSelectedChanged(e){this._selectedEntities=e.detail.selectedEntities}_addToLovelaceView(){const e=(0,h.Bi)(this.hass,this._selectedEntities,{}),t=(0,h.ZI)(this._selectedEntities,{});1!==this.lovelace.config.views.length?(0,v.X)(this,{lovelaceConfig:this.lovelace.config,allowDashboardChange:!1,viewSelectedCallback:(i,s,a)=>{(0,g.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[a],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}}):(0,g.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[0],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}constructor(...e){super(...e),this.narrow=!1,this._unusedEntities=[],this._selectedEntities=[]}}p.styles=o.AH`:host{overflow:hidden}.container{display:flex;flex-direction:column;height:100%}ha-card{--ha-card-box-shadow:none;--ha-card-border-radius:var(--ha-border-radius-square)}hui-entity-picker-table{flex-grow:1}.fab{position:sticky;float:var(--float-end);right:calc(16px + var(--safe-area-inset-right));bottom:calc(16px + var(--safe-area-inset-bottom));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;z-index:1}ha-button{position:relative;bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s;--ha-button-box-shadow:var(--ha-box-shadow-l)}.fab.selected ha-button{bottom:0}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"lovelace",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"narrow",void 0),(0,a.Cg)([(0,n.wk)()],p.prototype,"_unusedEntities",void 0),(0,a.Cg)([(0,n.wk)()],p.prototype,"_selectedEntities",void 0),p=(0,a.Cg)([(0,n.EM)("hui-unused-entities")],p),s()}catch(e){s(e)}})}};