iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 1.57 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[17813],{97588:function(t,i,e){e.r(i),e.d(i,{HuiPictureHeaderFooter:function(){return f}});e(16280);var o=e(40445),s=e(5124),a=e(67576),n=e(6412),r=e(63672),h=(e(76776),e(19037)),c=e(22064),l=e(97176);let d,g,u=t=>t;class f 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(){var t;if(!this._config||!this.hass)return s.s6;const i=(0,l.A)(this._config);return(0,s.qy)(d||(d=u` <img alt="${0}" @action="${0}" .actionHandler="${0}" tabindex="${0}" class="${0}" src="${0}"> `),(0,r.J)(null===(t=this._config)||void 0===t?void 0:t.alt_text),this._handleAction,(0,h.T)({hasHold:(0,l.h)(this._config.hold_action),hasDoubleClick:(0,l.h)(this._config.double_tap_action)}),(0,r.J)(i?0:void 0),(0,n.H)({clickable:i}),this.hass.hassUrl(this._config.image))}_handleAction(t){(0,c.$)(this,this.hass,this._config,t.detail.action)}}f.styles=(0,s.AH)(g||(g=u`img.clickable{cursor:pointer}img{display:block;width:100%;-webkit-touch-callout:none}`)),(0,o.Cg)([(0,a.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)()],f.prototype,"type",void 0),(0,o.Cg)([(0,a.wk)()],f.prototype,"_config",void 0),f=(0,o.Cg)([(0,a.EM)("hui-picture-header-footer")],f)}}]);