UNPKG

iobroker.lovelace

Version:

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

1 lines 5 kB
export const __rspack_esm_id=18893;export const __rspack_esm_ids=[18893];export const __webpack_modules__={56555(e,a,t){t.a(e,async function(e,a){try{var s=t(62826),i=t(5124),p=t(22441),o=t(1087),n=t(606),r=t(91485),c=(t(28170),t(50723),e([n,r]));[n,r]=c.then?(await c)():c;const h=1;class d extends i.WF{render(){return i.qy` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.update_preference.label")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.schedule.update_preference.supporting_text")} </span> <ha-select slot="end" @selected="${this._updatePreferenceChanged}" .value="${this.supervisorUpdateConfig?.add_on_backup_before_update?.toString()||"false"}" .options="${[{value:"false",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.skip_backups")},{value:"true",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.backup_before_update")}]}"></ha-select> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.schedule.retention")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.settings.app_update_backup.retention_description")} </span> <ha-input slot="end" @change="${this._backupRetentionChanged}" .value="${this.supervisorUpdateConfig?.add_on_backup_retain_copies?.toString()||"1"}" type="number" min="${h.toString()}" step="1"> <span slot="end"> ${this.hass.localize("ui.panel.config.backup.schedule.retention_units.copies")} </span> </ha-input> </ha-list-item-base> </ha-list-base> `}_updatePreferenceChanged(e){e.stopPropagation();const a="true"===e.detail.value;(0,o.r)(this,"update-config-changed",{value:{add_on_backup_before_update:a}})}_backupRetentionChanged(e){const a=e.currentTarget,t=Number(a.value);t>=h&&(0,o.r)(this,"update-config-changed",{value:{add_on_backup_retain_copies:t}})}}d.styles=i.AH`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-select{min-width:210px}ha-input{width:210px}@media all and (max-width:450px){ha-select{min-width:160px;width:160px}ha-input{width:160px}}`,(0,s.Cg)([(0,p.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,s.Cg)([(0,p.MZ)({attribute:!1})],d.prototype,"supervisorUpdateConfig",void 0),d=(0,s.Cg)([(0,p.EM)("ha-backup-config-addon")],d),a()}catch(e){a(e)}})},41596(e,a,t){t.a(e,async function(e,s){try{t.r(a);var i=t(62826),p=t(5124),o=t(22441),n=t(36312),r=t(9899),c=t(38962),h=(t(76776),t(26581)),d=t(81310),u=t(56555),l=e([c,d,u]);[c,d,u]=l.then?(await l)():l;class g extends p.WF{willUpdate(e){super.willUpdate(e),!this.hasUpdated&&this.hass&&(0,n.x)(this.hass.config,"hassio")&&this._getSupervisorUpdateConfig()}render(){return p.qy` <hass-subpage back-path="/config/backup/overview" .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.backup.app_update_backups.header")}"> <div class="content"> <ha-card> <div class="card-content"> <p> ${this.hass.localize("ui.panel.config.backup.settings.app_update_backup.description")} </p> <p> ${this.hass.localize("ui.panel.config.backup.settings.app_update_backup.local_only")} </p> ${this._error?p.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:p.s6} <ha-backup-config-addon .hass="${this.hass}" .supervisorUpdateConfig="${this._supervisorUpdateConfig}" @update-config-changed="${this._supervisorUpdateConfigChanged}"></ha-backup-config-addon> </div> </ha-card> </div> </hass-subpage> `}async _getSupervisorUpdateConfig(){try{this._supervisorUpdateConfig=await(0,h.y)(this.hass),this._error=void 0}catch(e){console.error(e),this._error=this.hass.localize("ui.panel.config.backup.settings.app_update_backup.error_load",{error:e?.message||e})}}async _supervisorUpdateConfigChanged(e){const a=e.detail.value;this._supervisorUpdateConfig={...this._supervisorUpdateConfig,...a},this._debounceSaveSupervisorUpdateConfig()}async _saveSupervisorUpdateConfig(){if(this._supervisorUpdateConfig)try{await(0,h.r)(this.hass,this._supervisorUpdateConfig),this._error=void 0}catch(e){console.error(e),this._error=this.hass.localize("ui.panel.config.backup.settings.app_update_backup.error_save",{error:e?.message||e?.toString()})}}constructor(...e){super(...e),this.narrow=!1,this._debounceSaveSupervisorUpdateConfig=(0,r.s)(()=>this._saveSupervisorUpdateConfig(),500)}}g.styles=p.AH`p{color:var(--secondary-text-color)}.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:var(--ha-space-6);display:flex;flex-direction:column;margin-bottom:24px}.card-content{padding-bottom:0}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,i.Cg)([(0,o.wk)()],g.prototype,"_supervisorUpdateConfig",void 0),(0,i.Cg)([(0,o.wk)()],g.prototype,"_error",void 0),g=(0,i.Cg)([(0,o.EM)("ha-config-backup-app-update-backups")],g),s()}catch(e){s(e)}})}};