Closed sztof closed 4 years ago
problem is that the value it is based on (hourly run time) will be updated at 24:00 and will show values for the next day. I am not sure how to make this work properly if I need to allow a user to manually update daily adjusted run time. Also, calling it more than once will break things. I will probably remove this service.
the reason for the problem is that you are calling it several times, you should only be calling it once really.
As far as I understand the plan is to run it manually once, lets say at 21:00 before sprinkling, and then "reset_bucket" service, after sprinklig is done. But again, at 23:00 "update daily counter" will be automatically called. Because of it - calculating sprinkling time on second day will be called twice (23:00 - automatically, and 21:00 next day - by user)
The plan is to make auto refresh configurable. So if you wanted you could go all manual. see #18
please use v0.0.22 (or later) - it allows you to disable auto refresh so you can safely call the daily update service once.
Calling service "smart_irrigation.calculate_daily_adjusted_run_time" several times causes to accumulate seconds several times. Because of it, there should be a possibility to disable automatic calculation at 23:00, so user could calculate once time once - just before starting sprinklers. Otherwise - user will calculate time on its own, and additionally it will be done at 23:00. This may cause exceeding optimal sprinkling time by value accumulation.