From 353b6c6917317dd54aa03b5dd8cf7a1c4bfb0c15 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:17:15 +0200 Subject: [PATCH 1/6] Let PlugwiseCirclePlus class load NodeFeature.CIRCLE too This makes the reset energy collection function available to the + devices --- plugwise_usb/nodes/circle_plus.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugwise_usb/nodes/circle_plus.py b/plugwise_usb/nodes/circle_plus.py index a9a4b50f6..5ff0f42f0 100644 --- a/plugwise_usb/nodes/circle_plus.py +++ b/plugwise_usb/nodes/circle_plus.py @@ -39,6 +39,7 @@ async def load(self) -> bool: NodeFeature.RELAY_LOCK, NodeFeature.ENERGY, NodeFeature.POWER, + NodeFeature.CIRCLE, NodeFeature.CIRCLEPLUS, ), ) @@ -76,6 +77,7 @@ async def load(self) -> bool: NodeFeature.RELAY_LOCK, NodeFeature.ENERGY, NodeFeature.POWER, + NodeFeature.CIRCLE, NodeFeature.CIRCLEPLUS, ), ) From 228759499a30d7a51c4330cad860c32bd7e6cb2b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:20:22 +0200 Subject: [PATCH 2/6] Bump to 0.44.5a0 test-version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 29155a6f0..47db17d58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise_usb" -version = "0.44.4" +version = "0.44.5a0" license = "MIT" keywords = ["home", "automation", "plugwise", "module", "usb"] classifiers = [ From 3c1e79b3ec37e193cb6f139bc5461ef7dd9ec598 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:30:16 +0200 Subject: [PATCH 3/6] Update related test-assert --- tests/test_usb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_usb.py b/tests/test_usb.py index e861175cf..f2de030c6 100644 --- a/tests/test_usb.py +++ b/tests/test_usb.py @@ -2484,6 +2484,7 @@ async def test_node_discovery_and_load( # noqa: PLR0915 assert sorted(state[pw_api.NodeFeature.INFO].features) == sorted( ( pw_api.NodeFeature.AVAILABLE, + pw_api.NodeFeature.CIRCLE, pw_api.NodeFeature.CIRCLEPLUS, pw_api.NodeFeature.INFO, pw_api.NodeFeature.PING, From 7645b4d3a7dd8fe12ce72e1b0493cc5be5ecf876 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:46:56 +0200 Subject: [PATCH 4/6] Update CHANGELOG --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02d1f74c5..54a14bc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## v0.44.4 +## v0.44.5 - 2025-06-22 + +- PR [274](https://github.com/plugwise/python-plugwise-usb/pull/274): Make the energy-reset function available to Plus devices + +## v0.44.4 - 2025-06-21 - PR [#255](https://github.com/plugwise/python-plugwise-usb/pull/255): Improve enery-logs reset process, enable use of a button in Plugwise_usb beta - PR [#261](https://github.com/plugwise/python-plugwise-usb/pull/261): Sense: bugfix parsing of humidity value as an unsigned int From 939f7f18eca9610ea4a67ddd5a1188e2bd60867e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:50:45 +0200 Subject: [PATCH 5/6] Implement improvement suggestion --- plugwise_usb/nodes/circle_plus.py | 38 ++++++++++++------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/plugwise_usb/nodes/circle_plus.py b/plugwise_usb/nodes/circle_plus.py index 5ff0f42f0..33842b0a2 100644 --- a/plugwise_usb/nodes/circle_plus.py +++ b/plugwise_usb/nodes/circle_plus.py @@ -19,6 +19,15 @@ _LOGGER = logging.getLogger(__name__) +FEATURES_CIRCLE_PLUS = ( + NodeFeature.RELAY, + NodeFeature.RELAY_INIT, + NodeFeature.RELAY_LOCK, + NodeFeature.ENERGY, + NodeFeature.POWER, + NodeFeature.CIRCLE, + NodeFeature.CIRCLEPLUS, +) class PlugwiseCirclePlus(PlugwiseCircle): """Plugwise Circle+ node.""" @@ -31,21 +40,11 @@ async def load(self) -> bool: _LOGGER.debug("Loading Circle node %s from cache", self._node_info.mac) if await self._load_from_cache(): self._loaded = True - self._setup_protocol( - CIRCLE_PLUS_FIRMWARE_SUPPORT, - ( - NodeFeature.RELAY, - NodeFeature.RELAY_INIT, - NodeFeature.RELAY_LOCK, - NodeFeature.ENERGY, - NodeFeature.POWER, - NodeFeature.CIRCLE, - NodeFeature.CIRCLEPLUS, - ), - ) + self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS) if await self.initialize(): await self._loaded_callback(NodeEvent.LOADED, self.mac) return True + _LOGGER.info( "Loading Circle+ node %s from cache failed", self._node_info.mac, @@ -68,21 +67,12 @@ async def load(self) -> bool: self._node_info.mac, ) return False + self._loaded = True - self._setup_protocol( - CIRCLE_PLUS_FIRMWARE_SUPPORT, - ( - NodeFeature.RELAY, - NodeFeature.RELAY_INIT, - NodeFeature.RELAY_LOCK, - NodeFeature.ENERGY, - NodeFeature.POWER, - NodeFeature.CIRCLE, - NodeFeature.CIRCLEPLUS, - ), - ) + self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS) if not await self.initialize(): return False + await self._loaded_callback(NodeEvent.LOADED, self.mac) return True From cc30f22502f842896db60e11826874aa81cdd32f Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 22 Jun 2025 12:54:11 +0200 Subject: [PATCH 6/6] Set to v0.44.5 release-version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 47db17d58..7eca9a2ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise_usb" -version = "0.44.5a0" +version = "0.44.5" license = "MIT" keywords = ["home", "automation", "plugwise", "module", "usb"] classifiers = [