We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4ad4ab commit 2bc498bCopy full SHA for 2bc498b
plugwise_usb/nodes/helpers/pulses.py
@@ -384,7 +384,11 @@ def add_log(
384
import_only: bool = False,
385
) -> bool:
386
"""Store pulse log."""
387
- log_record = PulseLogRecord(timestamp, pulses, CONSUMED)
+ direction = CONSUMED
388
+ if self._log_production and pulses < 0:
389
+ direction = PRODUCED
390
+
391
+ log_record = PulseLogRecord(timestamp, pulses, direction)
392
if not self._add_log_record(address, slot, log_record):
393
if not self._log_exists(address, slot):
394
return False
0 commit comments