From efca3d3e1757df0c99c5ab744929c027e3d43a14 Mon Sep 17 00:00:00 2001 From: Tor Erik Date: Mon, 6 Jul 2020 22:05:04 +0200 Subject: [PATCH] Added check for power production --- stream.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stream.go b/stream.go index 30cdf95..7021a26 100644 --- a/stream.go +++ b/stream.go @@ -81,6 +81,11 @@ func (m *LiveMeasurement) HasPower() bool { return m.Power > 0 } +// HasProductionOrConsumptionPower return true if measurement contains values +func (m *LiveMeasurement) HasProductionOrConsumptionPower() bool { + return m.Power > 0 || m.PowerProduction > 0 +} + // AsFloatMap returns the LiveMeasurement struct as a float map func (m *LiveMeasurement) AsFloatMap() map[string]float64 { return map[string]float64{