Fix linter

This commit is contained in:
andig 2020-07-19 21:31:20 +02:00
parent fda956759a
commit 744ef1c8b3
2 changed files with 3 additions and 12 deletions

View file

@ -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

View file

@ -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
}