UNPKG

iobroker.lovelace

Version:

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

1 lines 3.21 kB
export const __rspack_esm_id=29764;export const __rspack_esm_ids=[29764];export const __webpack_modules__={30831(t,a,e){e.a(t,async function(t,i){try{e.r(a),e.d(a,{HuiShortcutBadgeEditor:()=>k});var o=e(62826),n=e(5124),s=e(22441),c=e(22786),l=e(63533),r=e(1087),h=e(52763),_=e(96779),d=e(56505),p=e(53034),u=e(91408),f=e(45031),m=e(7382),g=t([h,d]);[h,d]=g.then?(await g)():g;const v="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",b="M4,9H20V11H4V9M4,13H14V15H4V13Z",C=["navigate","url","assist","perform-action","none"],y=(0,l.kp)(f.y,(0,l.Ik)({text:(0,l.lq)((0,l.Yj)()),icon:(0,l.lq)((0,l.Yj)()),color:(0,l.lq)((0,l.Yj)()),tap_action:(0,l.lq)(u.kn),hold_action:(0,l.lq)(u.kn),double_tap_action:(0,l.lq)(u.kn)}));class k extends n.WF{setConfig(t){(0,l.vA)(t,y),this._config=t}willUpdate(t){if((t.has("hass")||t.has("_config"))&&this.hass){const t=this._config?.tap_action;this._navInfo.update(this.hass,"navigate"===t?.action?t.navigation_path:void 0),this._serviceInfo.updateService("perform-action"===t?.action||"call-service"===t?.action?t.perform_action||t.service:void 0)}}render(){if(!this.hass||!this._config)return n.s6;const t=(0,p.J)(this.hass,this._config.tap_action,this._navInfo.info,this._serviceInfo.info);return n.qy` <ha-form .hass="${this.hass}" .data="${this._config}" .schema="${this._schema(t.label,t.icon)}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(t){t.stopPropagation(),this._config&&this.hass&&(0,r.r)(this,"config-changed",{config:t.detail.value})}constructor(...t){super(...t),this._navInfo=new _.q(this),this._serviceInfo=new d.G(this),this._schema=(0,c.A)((t,a)=>[{name:"tap_action",selector:{ui_action:{default_action:"none",actions:C}}},{name:"content",flatten:!0,type:"expandable",expanded:!0,iconPath:b,schema:[{name:"text",selector:{text:{placeholder:t}}},{name:"",type:"grid",schema:[{name:"icon",selector:{icon:{placeholder:a||"mdi:link"}}},{name:"color",selector:{ui_color:{default_color:"primary"}}}]}]},{name:"additional_interactions",type:"expandable",flatten:!0,iconPath:v,schema:[{name:"hold_action",selector:{ui_action:{default_action:"none",actions:C}}},{name:"double_tap_action",selector:{ui_action:{default_action:"none",actions:C}}}]}]),this._computeLabelCallback=t=>{switch(t.name){case"text":case"additional_interactions":return this.hass.localize(`ui.panel.lovelace.editor.card.shortcut.${t.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}}}}k.styles=m.U,(0,o.Cg)([(0,s.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],k.prototype,"_config",void 0),k=(0,o.Cg)([(0,s.EM)("hui-shortcut-badge-editor")],k),i()}catch(t){i(t)}})},45031(t,a,e){e.d(a,{y:()=>o});var i=e(63533);const o=(0,i.Ik)({type:(0,i.Yj)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}};