openWB Pro: add return energy (#33216)
This commit is contained in:
parent
8d425d3920
commit
f693454502
1 changed files with 8 additions and 0 deletions
|
|
@ -172,6 +172,14 @@ func (wb *OpenWBPro) TotalEnergy() (float64, error) {
|
||||||
return res.Imported / 1e3, err
|
return res.Imported / 1e3, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ api.MeterReturnEnergy = (*OpenWBPro)(nil)
|
||||||
|
|
||||||
|
// ReturnEnergy implements the api.MeterReturnEnergy interface
|
||||||
|
func (wb *OpenWBPro) ReturnEnergy() (float64, error) {
|
||||||
|
res, err := wb.statusG.Get()
|
||||||
|
return res.Exported / 1e3, err
|
||||||
|
}
|
||||||
|
|
||||||
// getPhaseValues returns phase values
|
// getPhaseValues returns phase values
|
||||||
func (wb *OpenWBPro) getPhaseValues(f func(pro.Status) []float64) (float64, float64, float64, error) {
|
func (wb *OpenWBPro) getPhaseValues(f func(pro.Status) []float64) (float64, float64, float64, error) {
|
||||||
status, err := wb.statusG.Get()
|
status, err := wb.statusG.Get()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue