iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 3.99 kB
JavaScript
webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["62294"],{79674:function(e,t,a){a.r(t),a.d(t,{HuiButtonCardEditor:()=>p});var n=a(61701),i=(a(19083),a(71695),a(19423),a(95078),a(97499),a(61006),a(47021),a(57243)),o=a(50778),c=a(27486),s=a(62900),l=a(36522),h=(a(29073),a(3613)),r=a(30571),d=a(18200),u=a(10991);let _,m=e=>e;const f=(0,s.f0)(d.I,(0,s.Ry)({entity:(0,s.jt)((0,s.Z_)()),name:(0,s.jt)((0,s.Z_)()),show_name:(0,s.jt)((0,s.O7)()),icon:(0,s.jt)((0,s.Z_)()),show_icon:(0,s.jt)((0,s.O7)()),icon_height:(0,s.jt)((0,s.Z_)()),tap_action:(0,s.jt)(r.fJ),hold_action:(0,s.jt)(r.fJ),double_tap_action:(0,s.jt)(r.fJ),theme:(0,s.jt)((0,s.Z_)()),show_state:(0,s.jt)((0,s.O7)())}));let p=(0,n.Z)([(0,o.Mo)("hui-button-card-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.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,s.hu)(e,f),this._config=e}},{kind:"field",key:"_schema",value(){return(0,c.Z)((e=>[{name:"entity",selector:{entity:{}}},{name:"",type:"grid",schema:[{name:"name",selector:{text:{}}},{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}}]},{name:"",type:"grid",column_min_width:"100px",schema:[{name:"show_name",selector:{boolean:{}}},{name:"show_state",selector:{boolean:{}}},{name:"show_icon",selector:{boolean:{}}}]},{name:"",type:"grid",schema:[{name:"icon_height",selector:{text:{suffix:"px"}}},{name:"theme",selector:{theme:{}}}]},{name:"interactions",type:"expandable",flatten:!0,iconPath:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",schema:[{name:"tap_action",selector:{ui_action:{default_action:(0,h.K)(e)}}},{name:"hold_action",selector:{ui_action:{default_action:"more-info"}}},{name:"",type:"optional_actions",flatten:!0,schema:[{name:"double_tap_action",selector:{ui_action:{default_action:"none"}}}]}]}]))}},{kind:"method",key:"render",value:function(){var e;if(!this.hass||!this._config)return i.Ld;const t=Object.assign({show_name:!0,show_icon:!0},this._config);null!==(e=t.icon_height)&&void 0!==e&&e.includes("px")&&(t.icon_height=String(parseFloat(t.icon_height)));const a=this._schema(this._config.entity);return(0,i.dy)(_||(_=m` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),this.hass,t,a,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.detail.value;t.icon_height&&!t.icon_height.endsWith("px")&&(t.icon_height+="px"),(0,l.B)(this,"config-changed",{config:t})}},{kind:"field",key:"_computeHelperCallback",value(){return e=>{switch(e.name){case"tap_action":case"hold_action":return this.hass.localize("ui.panel.lovelace.editor.card.button.default_action_help");default:return}}}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"theme":case"tap_action":case"hold_action":return`${this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}},{kind:"field",static:!0,key:"styles",value(){return u.A}}]}}),i.oi)},18200:function(e,t,a){a.d(t,{I:()=>i});var n=a(62900);const i=(0,n.Ry)({type:(0,n.Z_)(),view_layout:(0,n.Yj)(),layout_options:(0,n.Yj)(),grid_options:(0,n.Yj)(),visibility:(0,n.Yj)()})}}]);
//# sourceMappingURL=62294.6bc7841322fb9d18.js.map
;(self.