Easee: publish total energy (#4741)
This commit is contained in:
parent
6057ce6632
commit
d9e8161779
1 changed files with 13 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ type Easee struct {
|
|||
smartCharging bool
|
||||
enabledStatus bool
|
||||
phaseMode int
|
||||
currentPower, sessionEnergy,
|
||||
currentPower, sessionEnergy, totalEnergy,
|
||||
currentL1, currentL2, currentL3 float64
|
||||
rfid string
|
||||
lp loadpoint.API
|
||||
|
|
@ -278,6 +278,8 @@ func (c *Easee) observe(typ string, i json.RawMessage) {
|
|||
c.currentPower = 1e3 * value.(float64)
|
||||
case easee.SESSION_ENERGY:
|
||||
c.sessionEnergy = value.(float64)
|
||||
case easee.LIFETIME_ENERGY:
|
||||
c.totalEnergy = value.(float64)
|
||||
case easee.IN_CURRENT_T3:
|
||||
c.currentL1 = value.(float64)
|
||||
case easee.IN_CURRENT_T4:
|
||||
|
|
@ -498,6 +500,16 @@ func (c *Easee) Currents() (float64, float64, float64, error) {
|
|||
return c.currentL1, c.currentL2, c.currentL3, nil
|
||||
}
|
||||
|
||||
var _ api.MeterEnergy = (*Easee)(nil)
|
||||
|
||||
// TotalEnergy implements the api.MeterEnergy interface
|
||||
func (c *Easee) TotalEnergy() (float64, error) {
|
||||
c.mux.L.Lock()
|
||||
defer c.mux.L.Unlock()
|
||||
|
||||
return c.totalEnergy, nil
|
||||
}
|
||||
|
||||
var _ api.Identifier = (*Easee)(nil)
|
||||
|
||||
// Currents implements the api.MeterCurrent interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue