UNPKG

iobroker.lovelace

Version:

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

1 lines 5.39 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[18893],{56555:function(e,a,t){t.a(e,async function(e,a){try{var s=t(40445),i=t(5124),n=t(67576),o=t(1087),p=t(606),r=t(91485),c=(t(28170),t(50723),e([p,r]));[p,r]=c.then?(await c)():c;let u,h,d=e=>e;const l=1;class g extends i.WF{render(){var e,a;return(0,i.qy)(u||(u=d` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-select slot="end" @selected="${0}" .value="${0}" .options="${0}"></ha-select> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-input slot="end" @change="${0}" .value="${0}" type="number" min="${0}" step="1"> <span slot="end"> ${0} </span> </ha-input> </ha-list-item-base> </ha-list-base> `),this.hass.localize("ui.panel.config.backup.schedule.update_preference.label"),this.hass.localize("ui.panel.config.backup.schedule.update_preference.supporting_text"),this._updatePreferenceChanged,(null===(e=this.supervisorUpdateConfig)||void 0===e||null===(e=e.add_on_backup_before_update)||void 0===e?void 0:e.toString())||"false",[{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")}],this.hass.localize("ui.panel.config.backup.schedule.retention"),this.hass.localize("ui.panel.config.backup.settings.app_update_backup.retention_description"),this._backupRetentionChanged,(null===(a=this.supervisorUpdateConfig)||void 0===a||null===(a=a.add_on_backup_retain_copies)||void 0===a?void 0:a.toString())||"1",l.toString(),this.hass.localize("ui.panel.config.backup.schedule.retention_units.copies"))}_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>=l&&(0,o.r)(this,"update-config-changed",{value:{add_on_backup_retain_copies:t}})}}g.styles=(0,i.AH)(h||(h=d`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,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"supervisorUpdateConfig",void 0),g=(0,s.Cg)([(0,n.EM)("ha-backup-config-addon")],g),a()}catch(u){a(u)}})},41596:function(e,a,t){t.a(e,async function(e,s){try{t.r(a);t(3362),t(62953);var i=t(40445),n=t(5124),o=t(67576),p=t(36312),r=t(9899),c=t(38962),u=(t(76776),t(26581)),h=t(81310),d=t(56555),l=e([c,h,d]);[c,h,d]=l.then?(await l)():l;let g,_,f,b=e=>e;class v extends n.WF{willUpdate(e){super.willUpdate(e),!this.hasUpdated&&this.hass&&(0,p.x)(this.hass.config,"hassio")&&this._getSupervisorUpdateConfig()}render(){return(0,n.qy)(g||(g=b` <hass-subpage back-path="/config/backup/overview" .hass="${0}" .narrow="${0}" .header="${0}"> <div class="content"> <ha-card> <div class="card-content"> <p> ${0} </p> <p> ${0} </p> ${0} <ha-backup-config-addon .hass="${0}" .supervisorUpdateConfig="${0}" @update-config-changed="${0}"></ha-backup-config-addon> </div> </ha-card> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.backup.app_update_backups.header"),this.hass.localize("ui.panel.config.backup.settings.app_update_backup.description"),this.hass.localize("ui.panel.config.backup.settings.app_update_backup.local_only"),this._error?(0,n.qy)(_||(_=b`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):n.s6,this.hass,this._supervisorUpdateConfig,this._supervisorUpdateConfigChanged)}async _getSupervisorUpdateConfig(){try{this._supervisorUpdateConfig=await(0,u.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:(null==e?void 0:e.message)||e})}}async _supervisorUpdateConfigChanged(e){const a=e.detail.value;this._supervisorUpdateConfig=Object.assign(Object.assign({},this._supervisorUpdateConfig),a),this._debounceSaveSupervisorUpdateConfig()}async _saveSupervisorUpdateConfig(){if(this._supervisorUpdateConfig)try{await(0,u.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:(null==e?void 0:e.message)||(null==e?void 0:e.toString())})}}constructor(...e){super(...e),this.narrow=!1,this._debounceSaveSupervisorUpdateConfig=(0,r.s)(()=>this._saveSupervisorUpdateConfig(),500)}}v.styles=(0,n.AH)(f||(f=b`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})],v.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,i.Cg)([(0,o.wk)()],v.prototype,"_supervisorUpdateConfig",void 0),(0,i.Cg)([(0,o.wk)()],v.prototype,"_error",void 0),v=(0,i.Cg)([(0,o.EM)("ha-config-backup-app-update-backups")],v),s()}catch(g){s(g)}})}}]);