Skip to content

Commit 69dd717

Browse files
committed
Add extra guarding: ignore negative production-pulses when only consumption
1 parent 61d71f4 commit 69dd717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def add_log(
397397
import_only,
398398
)
399399
direction = CONSUMED
400-
if pulses < 0:
400+
if self._log_production and pulses < 0:
401401
direction = PRODUCED
402402

403403
log_record = PulseLogRecord(timestamp, pulses, direction)

0 commit comments

Comments
 (0)