Skip to content

Commit

Permalink
fixed errors to 'make style' run
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLaffer committed Jun 20, 2019
1 parent c84b212 commit 5dcd3a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/readout/files.go
Expand Up @@ -78,7 +78,7 @@ func writeSharedFile(c *smartpi.Config, values *smartpi.ADE7878Readout, balanced
f.Close()
}

func updateCounterFile(c *smartpi.Config, f string, v float64) (float64){
func updateCounterFile(c *smartpi.Config, f string, v float64) float64 {
t := time.Now()
var counter float64
counterFile, err := ioutil.ReadFile(f)
Expand All @@ -101,5 +101,5 @@ func updateCounterFile(c *smartpi.Config, f string, v float64) (float64){
if err != nil {
panic(err)
}
return counter+v
return counter + v
}
1 change: 0 additions & 1 deletion src/readout/main.go
Expand Up @@ -181,7 +181,6 @@ func pollSmartPi(config *smartpi.Config, device *i2c.Device) {
publishMQTTCalculations(config, mqttclient, consumedWattHourBalanced60s, producedWattHourBalanced60s, consumedCounter, producedCounter)
}
}


delay := time.Since(startTime) - (time.Duration(1000/config.Samplerate) * time.Millisecond)
if int64(delay) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/readout/mqtt.go
Expand Up @@ -74,7 +74,7 @@ func publishMQTTReadouts(c *smartpi.Config, mqttclient MQTT.Client, values *smar
publishMQTT(mqttclient, &status, c.MQTTtopic+"/Ec"+label, accuvalues.WattHoursConsumed[p])
publishMQTT(mqttclient, &status, c.MQTTtopic+"/Ep"+label, accuvalues.WattHoursProduced[p])
}
pTotalBalanced = 0.0;
pTotalBalanced = 0.0
for _, p := range smartpi.MainPhases {
pTotalBalanced = pTotalBalanced + values.ActiveWatts[p]
}
Expand Down

0 comments on commit 5dcd3a5

Please sign in to comment.