Skip to content

Commit

Permalink
fix(all): tune
Browse files Browse the repository at this point in the history
  • Loading branch information
atbore-phx committed Mar 2, 2024
1 parent e6080d3 commit 907cdb8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/forecast.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"forecasts": [
{
"period_end": "2024-03-03T00:00:00Z",
"pv_estimate": 0
"pv_estimate": 4
},
{
"period_end": "2024-03-03T00:30:00Z",
"pv_estimate": 0
"pv_estimate": 4
},
{
"period_end": "2024-04-03T00:00:00Z",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func init() {
scdCmd.Flags().StringP("url", "u", "", "URL")
scdCmd.Flags().StringP("apikey", "k", "", "APIKEY")
scdCmd.Flags().StringP("fronius_ip", "H", "", "FRONIUS_IP")
scdCmd.Flags().StringP("start_hr", "s", "22:00", "START_HR")
scdCmd.Flags().StringP("start_hr", "s", "00:00", "START_HR")
scdCmd.Flags().StringP("end_hr", "e", "06:00", "END_HR")
scdCmd.Flags().Float64P("pw_consumption", "c", 0.0, "PW_CONSUMPTION")
scdCmd.Flags().IntP("max_charge", "m", 3500, "MAX_CHARGE")
Expand Down
2 changes: 1 addition & 1 deletion pkg/fronius/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func Setdefaults(modbus_ip string) error {
}

func ForceCharge(modbus_ip string, power_prc int16) error {
u.Log.Infof("Setting Fronius Storage Force Charge at %d%", power_prc)
u.Log.Infof("Setting Fronius Storage Force Charge at %d%%", power_prc)
if power_prc > 0 {
regList := mdsc

Expand Down
4 changes: 2 additions & 2 deletions pkg/power/power_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func TestGetTotalDayPowerEstimate(t *testing.T) {

func TestHandler(t *testing.T) {
now := time.Now()
pe := now.AddDate(0, 0, 1).Format(time.RFC3339)
pe30 := now.AddDate(0, 0, 1).Add(time.Minute * 30).Format(time.RFC3339)
pe := now.Format(time.RFC3339)
pe30 := now.Add(time.Minute * 30).Format(time.RFC3339)
// Create a mock HTTP server
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
Expand Down
10 changes: 5 additions & 5 deletions src/utils/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"log"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)

var Log *zap.SugaredLogger

func init() {
logger, err := zap.NewProduction()
config := zap.NewProductionConfig()
config.EncoderConfig.EncodeTime = zapcore.RFC3339TimeEncoder
logger, err := config.Build()
if err != nil {
log.Fatal(err)
log.Fatalf("can't initialize zap logger: %v", err)
}

Log = logger.Sugar()
defer logger.Sync()

}

0 comments on commit 907cdb8

Please sign in to comment.