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