iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 1.44 kB
JavaScript
export const __rspack_esm_id=17813;export const __rspack_esm_ids=[17813];export const __webpack_modules__={97588(t,i,e){e.r(i),e.d(i,{HuiPictureHeaderFooter:()=>_});var o=e(62826),s=e(5124),a=e(22441),n=e(6412),r=e(63672),c=(e(76776),e(19037)),h=e(22064),l=e(97176);class _ extends s.WF{static getStubConfig(){return{image:"https://www.home-assistant.io/images/lovelace/header-footer/balloons-header.png",tap_action:{action:"none"},hold_action:{action:"none"}}}getCardSize(){return 3}setConfig(t){if(!t||!t.image)throw new Error("Image required");this._config=t}shouldUpdate(t){return 1!==t.size||!t.has("hass")||!t.get("hass")}render(){if(!this._config||!this.hass)return s.s6;const t=(0,l.A)(this._config);return s.qy` <img alt="${(0,r.J)(this._config?.alt_text)}" @action="${this._handleAction}" .actionHandler="${(0,c.T)({hasHold:(0,l.h)(this._config.hold_action),hasDoubleClick:(0,l.h)(this._config.double_tap_action)})}" tabindex="${(0,r.J)(t?0:void 0)}" class="${(0,n.H)({clickable:t})}" src="${this.hass.hassUrl(this._config.image)}"> `}_handleAction(t){(0,h.$)(this,this.hass,this._config,t.detail.action)}}_.styles=s.AH`img.clickable{cursor:pointer}img{display:block;width:100%;-webkit-touch-callout:none}`,(0,o.Cg)([(0,a.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)()],_.prototype,"type",void 0),(0,o.Cg)([(0,a.wk)()],_.prototype,"_config",void 0),_=(0,o.Cg)([(0,a.EM)("hui-picture-header-footer")],_)}};