Skip to content

Commit 557fdf4

Browse files
authored
Merge pull request #274 from plugwise/fix_plus_energy_reset
Let PlugwiseCirclePlus class load NodeFeature.CIRCLE too
2 parents ccc3a26 + cc30f22 commit 557fdf4

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
## v0.44.4
3+
## v0.44.5 - 2025-06-22
4+
5+
- PR [274](https://github.com/plugwise/python-plugwise-usb/pull/274): Make the energy-reset function available to Plus devices
6+
7+
## v0.44.4 - 2025-06-21
48

59
- 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
610
- PR [#261](https://github.com/plugwise/python-plugwise-usb/pull/261): Sense: bugfix parsing of humidity value as an unsigned int

plugwise_usb/nodes/circle_plus.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919

2020
_LOGGER = logging.getLogger(__name__)
2121

22+
FEATURES_CIRCLE_PLUS = (
23+
NodeFeature.RELAY,
24+
NodeFeature.RELAY_INIT,
25+
NodeFeature.RELAY_LOCK,
26+
NodeFeature.ENERGY,
27+
NodeFeature.POWER,
28+
NodeFeature.CIRCLE,
29+
NodeFeature.CIRCLEPLUS,
30+
)
2231

2332
class PlugwiseCirclePlus(PlugwiseCircle):
2433
"""Plugwise Circle+ node."""
@@ -31,20 +40,11 @@ async def load(self) -> bool:
3140
_LOGGER.debug("Loading Circle node %s from cache", self._node_info.mac)
3241
if await self._load_from_cache():
3342
self._loaded = True
34-
self._setup_protocol(
35-
CIRCLE_PLUS_FIRMWARE_SUPPORT,
36-
(
37-
NodeFeature.RELAY,
38-
NodeFeature.RELAY_INIT,
39-
NodeFeature.RELAY_LOCK,
40-
NodeFeature.ENERGY,
41-
NodeFeature.POWER,
42-
NodeFeature.CIRCLEPLUS,
43-
),
44-
)
43+
self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS)
4544
if await self.initialize():
4645
await self._loaded_callback(NodeEvent.LOADED, self.mac)
4746
return True
47+
4848
_LOGGER.info(
4949
"Loading Circle+ node %s from cache failed",
5050
self._node_info.mac,
@@ -67,20 +67,12 @@ async def load(self) -> bool:
6767
self._node_info.mac,
6868
)
6969
return False
70+
7071
self._loaded = True
71-
self._setup_protocol(
72-
CIRCLE_PLUS_FIRMWARE_SUPPORT,
73-
(
74-
NodeFeature.RELAY,
75-
NodeFeature.RELAY_INIT,
76-
NodeFeature.RELAY_LOCK,
77-
NodeFeature.ENERGY,
78-
NodeFeature.POWER,
79-
NodeFeature.CIRCLEPLUS,
80-
),
81-
)
72+
self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS)
8273
if not await self.initialize():
8374
return False
75+
8476
await self._loaded_callback(NodeEvent.LOADED, self.mac)
8577
return True
8678

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise_usb"
7-
version = "0.44.4"
7+
version = "0.44.5"
88
license = "MIT"
99
keywords = ["home", "automation", "plugwise", "module", "usb"]
1010
classifiers = [

tests/test_usb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,6 +2484,7 @@ async def test_node_discovery_and_load( # noqa: PLR0915
24842484
assert sorted(state[pw_api.NodeFeature.INFO].features) == sorted(
24852485
(
24862486
pw_api.NodeFeature.AVAILABLE,
2487+
pw_api.NodeFeature.CIRCLE,
24872488
pw_api.NodeFeature.CIRCLEPLUS,
24882489
pw_api.NodeFeature.INFO,
24892490
pw_api.NodeFeature.PING,

0 commit comments

Comments
 (0)