UNPKG

iobroker.lovelace

Version:

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

2 lines 2.45 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["13304"],{44600:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HuiUpdateActionsCardFeatureEditor:()=>f});var s=a(61701),n=(a(71695),a(19423),a(47021),a(57243)),o=a(50778),u=a(27486),l=a(36522),c=(a(29073),a(75278)),d=a(69919),r=a(93738),h=e([r,d]);[r,d]=h.then?(await h)():h;let p,k=e=>e,f=(0,s.Z)([(0,o.Mo)("hui-update-actions-card-feature-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"field",key:"_schema",value(){return(0,u.Z)(((e,t)=>[{name:"backup",disabled:!t,selector:{select:{default:"no",mode:"dropdown",options:["ask","yes","no"].map((t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.update-actions.backup_options.${t}`)})))}}}]))}},{kind:"get",key:"_stateObj",value:function(){var e,t;return null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(t=this.context)||void 0===t?void 0:t.entity_id]:void 0}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return n.Ld;const e=null!=this._stateObj&&(0,c.e)(this._stateObj,d.EX.BACKUP),t=this._schema(this.hass.localize,e),a=Object.assign({},this._config);return!this._config.backup&&e&&(a.backup=r.Q),(0,n.dy)(p||(p=k` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),this.hass,a,t,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){(0,l.B)(this,"config-changed",{config:e.detail.value})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>"backup"===e.name?this.hass.localize(`ui.panel.lovelace.editor.features.types.update-actions.${e.name}`):""}},{kind:"field",key:"_computeHelperCallback",value(){return e=>{const t=null!=this._stateObj&&(0,c.e)(this._stateObj,d.EX.BACKUP);if("backup"===e.name)return t?void 0:this.hass.localize("ui.panel.lovelace.editor.features.types.update-actions.backup_not_supported")}}}]}}),n.oi);i()}catch(p){i(p)}}))}}]); //# sourceMappingURL=13304.318bf07f6706e08e.js.map