Skip to content

Commit

Permalink
feat: keep the regulator using 2 min avg
Browse files Browse the repository at this point in the history
  • Loading branch information
mewejo committed Feb 8, 2023
1 parent 6d050e0 commit d9bb436
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/app/manage_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"log"
"time"

"github.com/mewejo/go-watering/pkg/constants"
"github.com/mewejo/go-watering/pkg/model"
"github.com/mewejo/go-watering/pkg/persistence"
)
Expand Down Expand Up @@ -67,7 +66,7 @@ func (app *App) regulateZone(zone *model.Zone) error {
}

if zone.Mode == model.GetDefaultZoneMode() {
averageMoisture, err := persistence.GetAverageReadingForSensorsSince(zone.MoistureSensors, constants.MOISTURE_READINGS_AVERAGE_DURATION)
averageMoisture, err := persistence.GetAverageReadingForSensorsSince(zone.MoistureSensors, 2*time.Minute)

if err != nil {
return err
Expand Down

0 comments on commit d9bb436

Please sign in to comment.