openWB Pro: add return energy (#33216)

This commit is contained in:
andig 2026-08-27 11:30:11 +02:00 • committed by GitHub
parent 8d425d3920
commit f693454502
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,6 +172,14 @@ func (wb *OpenWBPro) TotalEnergy() (float64, error) {
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
func (wb *OpenWBPro) getPhaseValues(f func(pro.Status) []float64) (float64, float64, float64, error) {
status, err := wb.statusG.Get()