You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am noticing frequent polling of the API in the log. This behavior affects how the Apps can access the data. I am suggesting we eliminate interval polling as ThinQ V2 devices send "heartbeat" MQTT messages that keep things in sync. Asking the API should be a fall back.
Asking Co-Pilot to improve polling behavior. Findings:
Both polling mechanisms use the same fixed intervalTime
No exponential backoff on failures
Sequential polling could cause delays
No consideration for device state changes
The text was updated successfully, but these errors were encountered:
Working on latest 2.0.0-beta.4
I am noticing frequent polling of the API in the log. This behavior affects how the Apps can access the data. I am suggesting we eliminate interval polling as ThinQ V2 devices send "heartbeat" MQTT messages that keep things in sync. Asking the API should be a fall back.
Asking Co-Pilot to improve polling behavior. Findings:
`// ThinQ2 devices polling (backup method)
setInterval(() => {
this.ThinQ.devices().then((devices) => {
devices.filter(device => device.platform === PlatformType.ThinQ2)
.forEach(device => {
this.events.emit(device.id, device.snapshot);
});
});
}, this.intervalTime);
// ThinQ1 devices polling
const interval = setInterval(async () => {
try {
for (const accessory of this.accessories) {
const device = accessory.context.device;
if (device.platform === PlatformType.ThinQ1 && this.enable_thinq1) {
const deviceWithSnapshot = await ThinQ.pollMonitor(device);
if (deviceWithSnapshot.snapshot.raw !== null) {
this.events.emit(device.id, deviceWithSnapshot.snapshot);
}
}
}
} catch (err) {
// ... error handling
}
}, this.intervalTime);`
Key issues to address:
Both polling mechanisms use the same fixed intervalTime
No exponential backoff on failures
Sequential polling could cause delays
No consideration for device state changes
The text was updated successfully, but these errors were encountered: