baboons / homebridge-electrolux-wellbeing

Homebridge plugin for Electrolux Pure A9
Apache License 2.0
15 stars 12 forks source link

Skip state update when data is missing #12

Closed mafredri closed 3 years ago

mafredri commented 3 years ago

The API requests seem to fail intermittently, e.g.:

[8/10/2021, 4:36:41 PM] [ElectroluxWellbeing] Could not fetch appliances data: Error: read ECONNRESET
[8/10/2021, 6:15:41 PM] [ElectroluxWellbeing] Could not fetch appliances data: Error: read ECONNRESET
[8/10/2021, 8:54:42 PM] [ElectroluxWellbeing] Could not fetch appliances data: Error: Client network socket disconnected before secure TLS connection was established

This guard avoids updating HomeKit with empty data.

A better option might be to retry the request, maybe 1-3 times and perhaps using some sort of backoff.