UNPKG

iobroker.lovelace

Version:

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

1 lines 2.61 kB
export const __rspack_esm_id=42577;export const __rspack_esm_ids=[42577];export const __webpack_modules__={92840(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HuiEnergyDateSelectionCardEditor:()=>m});var o=i(62826),c=i(5124),n=i(22441),l=i(22786),r=i(63533),s=i(1087),d=i(52763),p=i(84698),u=e([d]);d=(u.then?(await u)():u)[0];const _=(0,r.kp)(p.H,(0,r.Ik)({disable_compare:(0,r.lq)((0,r.zM)()),collection_key:(0,r.lq)((0,r.Yj)()),vertical_opening_direction:(0,r.lq)((0,r.KC)([(0,r.eu)("auto"),(0,r.eu)("up"),(0,r.eu)("down")])),opening_direction:(0,r.lq)((0,r.KC)([(0,r.eu)("auto"),(0,r.eu)("right"),(0,r.eu)("left"),(0,r.eu)("center")]))})),h=["auto","up","down"],g=["auto","right","left","center"];class m extends c.WF{setConfig(e){(0,r.vA)(e,_),this._config=e}render(){if(!this.hass||!this._config)return c.s6;const e={...this._config},t=this._schema(this.hass.localize);return c.qy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${t}" .computeLabel="${this._computeLabelCallback}" .computeHelper="${this._computeHelperCallback}" @value-changed="${this._valueChanged}"></ha-form>`}_valueChanged(e){(0,s.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,l.A)(e=>[{name:"",type:"grid",schema:[{name:"vertical_opening_direction",required:!1,selector:{select:{options:h.map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.energy-date-selection.vertical_opening_directions.${t}`)}))}}},{name:"opening_direction",required:!1,selector:{select:{options:g.map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.energy-date-selection.opening_directions.${t}`)}))}}},{name:"disable_compare",required:!1,selector:{boolean:{}}},{type:"string",name:"collection_key",required:!1}]}]),this._computeHelperCallback=e=>{if("collection_key"===e.name)return this.hass.localize("ui.panel.lovelace.editor.card.generic.collection_key_description")},this._computeLabelCallback=e=>{switch(e.name){case"vertical_opening_direction":case"opening_direction":case"disable_compare":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-date-selection.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,n.wk)()],m.prototype,"_config",void 0),m=(0,o.Cg)([(0,n.EM)("hui-energy-date-selection-card-editor")],m),a()}catch(e){a(e)}})},84698(e,t,i){i.d(t,{H:()=>o});var a=i(63533);const o=(0,a.Ik)({type:(0,a.Yj)(),view_layout:(0,a.bz)(),layout_options:(0,a.bz)(),grid_options:(0,a.bz)(),visibility:(0,a.bz)(),disabled:(0,a.lq)((0,a.zM)())})}};