iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 1.64 kB
JavaScript
export const __rspack_esm_id=2202;export const __rspack_esm_ids=[2202];export const __webpack_modules__={97889(t,a,i){i.a(t,async function(t,s){try{i.r(a);var e=i(62826),c=i(5124),n=i(22441),l=i(18350),o=t([l]);l=(o.then?(await o)():o)[0];class h extends c.WF{render(){return this.hass&&this.stateObj?c.qy` <div class="actions"> ${"idle"===this.stateObj.state||"paused"===this.stateObj.state?c.qy` <ha-button appearance="plain" size="small" .action="${"start"}" ="${this._handleActionClick}"> ${this.hass.localize("ui.card.timer.actions.start")} </ha-button> `:""} ${"active"===this.stateObj.state?c.qy` <ha-button appearance="plain" size="small" .action="${"pause"}" ="${this._handleActionClick}"> ${this.hass.localize("ui.card.timer.actions.pause")} </ha-button> `:""} ${"active"===this.stateObj.state||"paused"===this.stateObj.state?c.qy` <ha-button appearance="plain" size="small" .action="${"cancel"}" ="${this._handleActionClick}"> ${this.hass.localize("ui.card.timer.actions.cancel")} </ha-button> <ha-button appearance="plain" size="small" .action="${"finish"}" ="${this._handleActionClick}"> ${this.hass.localize("ui.card.timer.actions.finish")} </ha-button> `:""} </div> `:c.s6}_handleActionClick(t){const a=t.currentTarget.action;this.hass.callService("timer",a,{entity_id:this.stateObj.entity_id})}}h.styles=c.AH`.actions{margin:var(--ha-space-2) 0;display:flex;flex-wrap:wrap;justify-content:center}`,(0,e.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,e.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"stateObj",void 0),h=(0,e.Cg)([(0,n.EM)("more-info-timer")],h),s()}catch(t){s(t)}})}};