metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

Fetch only every X seconds/minutes #6

Closed alesf closed 6 years ago

alesf commented 7 years ago

Would it be possible to add config option to set frequency of fetching data. I'm using national weather service and I don't want to spam their service (they change data every 5 minutes or so).

metbosch commented 7 years ago

Hi @alesf, It is possible but I'm not sure if I will have time to take a look at that next weeks. I do not consider it a must feature. In any case, if you are really interested and you want to contribute the project, take a look at https://www.npmjs.com/package/cached-request. Thanks!

shidevil commented 7 years ago

@alesf I have added the config option to set frequency of fetching data. Check pull request

imperialjoy commented 7 years ago

My automations based on falling temperature (turn on heater if the kids room got too cold at night) never triggered, and now I know why. This plugin doesn't update the temperature unless you're looking at your phone. @shidevil your fix works great! I replaced the index.js with yours and now it works as expected - thank you!

shidevil commented 7 years ago

@imperialjoy That's great to hear! you are welcome 👍

metbosch commented 6 years ago

@alesf I think that the current implementation is enough smart for your needs, so I'm closing the issue. Let us know if you still have some problem.