Closed deanlyoung closed 4 years ago
@ToddGreenfield any chance you could take a look? I'd love to understand your approach on this in case I am misunderstanding.
What is your polling set to in the config? If I recall, GetAirQuality is called by HomeKit, GetObservation is what actually calls out to the api. It should not be redundant. I havent used for a while now and don’t actively maintain at this time. Try setting your polling to a higher number like 300 or 600.
Thanks for the insights! I'll try the longer polling interval.
It's not quite clear what this portion is for
https://github.com/ToddGreenfield/homebridge-airnow/blob/5210af192da54740bc4cd5fd5a25c69068e30d86/index.js#L87
it appears redundant to this portion
https://github.com/ToddGreenfield/homebridge-airnow/blob/5210af192da54740bc4cd5fd5a25c69068e30d86/index.js#L93
and only called here
https://github.com/ToddGreenfield/homebridge-airnow/blob/5210af192da54740bc4cd5fd5a25c69068e30d86/index.js#L287
It does not follow the setTimeout polling convention here
https://github.com/ToddGreenfield/homebridge-airnow/blob/5210af192da54740bc4cd5fd5a25c69068e30d86/index.js#L81
which I believe is resulting in the API getting called too often