diff --git a/core/helper.go b/core/helper.go index bc976ca23..307c101b4 100644 --- a/core/helper.go +++ b/core/helper.go @@ -18,11 +18,6 @@ func powerToCurrent(power float64, phases int64) int64 { return int64(power / (float64(phases) * Voltage)) } -// currentToPower is a helper function to convert phase current to total power -func currentToPower(current, phases int64) float64 { - return float64(current*phases) * Voltage -} - // consumedPower estimates how much power the charger might have consumed given it was the only load // func consumedPower(pv, battery, grid float64) float64 { // return math.Abs(pv) + battery + grid diff --git a/core/site.go b/core/site.go index cfb709e2c..1342d429c 100644 --- a/core/site.go +++ b/core/site.go @@ -63,6 +63,9 @@ func NewSiteFromConfig( site := NewSite() util.DecodeOther(log, other, &site) + Voltage = site.Voltage + site.loadpoints = loadpoints + // workaround mapstructure if site.Mode == "0" { site.Mode = api.ModeOff @@ -85,13 +88,6 @@ func NewSiteFromConfig( site.batteryMeter = cp.Meter(site.Meters.BatteryMeterRef) } - // convert loadpoints to interfaces - for _, lp := range loadpoints { - site.loadpoints = append(site.loadpoints, lp) - } - - Voltage = site.Voltage - return site }