Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## v0.44.1
## v0.44.2 - 2025-06-11

- Bugfix: implement solution for Issue [#259](https://github.com/plugwise/plugwise_usb-beta/issues/259)

## v0.44.1 - 2025-06-10

- PR [#258](https://github.com/plugwise/python-plugwise-usb/pull/258)
- Sense: make sure NodeFeature.BATTERY is called and configuration parameters are propagated properly

## v0.44.0
## v0.44.0 - 2025-06-10

- PR [#256](https://github.com/plugwise/python-plugwise-usb/pull/256) Implement PlugWise Sense product

Expand Down
17 changes: 12 additions & 5 deletions plugwise_usb/nodes/helpers/pulses.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,14 @@ def _update_log_direction(
) -> None:
"""Update Energy direction of log record.

Two subsequential logs with the same timestamp indicates the first
is consumption and second production.
Two subsequential logging slots with the same timestamp indicate
both consumption and production logging is active.
The first slot (e.g. 1) contains consumption data,
the second slot (e.g. 2) production data.

This code expects either single slots containing consumption data
or double slots containing consumption and production data.
Single slots containing production data only is NOT supported/tested.
"""
if self._logs is None:
return
Expand All @@ -513,10 +519,11 @@ def _update_log_direction(
next_timestamp = self._check_next_production(address, slot, timestamp)
if self._first_prev_log_processed and self._first_next_log_processed:
# _log_production is True when 2 out of 3 consecutive slots have
# the same timestamp, otherwise it is False
# the same timestamp
self._log_production = (
next_timestamp == timestamp and prev_timestamp != timestamp
) or (next_timestamp == prev_timestamp and next_timestamp != timestamp)
(prev_timestamp == timestamp)
^ (next_timestamp == timestamp)
)

def _check_prev_production(
self, address: int, slot: int, timestamp: datetime
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "plugwise_usb"
version = "0.44.1"
version = "0.44.2"
license = "MIT"
keywords = ["home", "automation", "plugwise", "module", "usb"]
classifiers = [
Expand Down
Loading