diff --git a/bases/device.ts b/bases/device.ts index 96dfd3fd..254e2b10 100644 --- a/bases/device.ts +++ b/bases/device.ts @@ -230,6 +230,7 @@ export default abstract class< protected async setCapabilityValues( data: ListDevice[T]['Device'], ): Promise { + this.homey.api.realtime('deviceUpdate', undefined) await Promise.all( this.#opCapabilityTagEntries.map(async ([capability, tag]) => { if (tag in data) { diff --git a/widgets/ata-group-setting/public/index.ts b/widgets/ata-group-setting/public/index.ts index 53c81d9b..3ffd5566 100644 --- a/widgets/ata-group-setting/public/index.ts +++ b/widgets/ata-group-setting/public/index.ts @@ -365,7 +365,12 @@ const setAtaValues = async (homey: Homey): Promise => { } } -const addAtaValuesEventListeners = (homey: Homey): void => { +const addEventListeners = (homey: Homey): void => { + zoneElement.addEventListener('change', () => { + fetchAtaValues(homey).catch(() => { + // + }) + }) refreshAtaValues.addEventListener('click', () => { refreshAtaValuesElement() }) @@ -374,15 +379,11 @@ const addAtaValuesEventListeners = (homey: Homey): void => { // }) }) -} - -const addEventListeners = (homey: Homey): void => { - zoneElement.addEventListener('change', () => { + homey.on('deviceUpdate', () => { fetchAtaValues(homey).catch(() => { // }) }) - addAtaValuesEventListeners(homey) } // eslint-disable-next-line func-style