Skip to content
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
0fd1978
Circle: add relay-lock
bouwew Jun 5, 2025
31fca5c
Test relay-locking
bouwew Jun 5, 2025
7a9659e
Bump to v0.43.0a0 test-version
bouwew Jun 5, 2025
d3b5268
Back to limited test-output
bouwew Jun 5, 2025
6e16b65
Add RELAY_LOCK NodeFeature
bouwew Jun 5, 2025
67b314d
Update api with set_relay_state()
bouwew Jun 5, 2025
09dbb3e
Implement NodeFeature.RELAY_LOCK
bouwew Jun 5, 2025
c606ce5
Set NodeFeature.RELAY_LOCK as well.
bouwew Jun 5, 2025
6d87d02
Fix to async
bouwew Jun 5, 2025
c196796
Add more test-asserts
bouwew Jun 5, 2025
1f794d0
Try
bouwew Jun 5, 2025
4dc14c9
Add NodeFeature.RELAY_LOCK to CirclePlus
bouwew Jun 5, 2025
80e9b66
Add more relay-lock-related code
bouwew Jun 5, 2025
e83facd
Add NodeFeature.RELAY_LOCK to FEATURE_SUPPORTED_AT_FIRMWARE
bouwew Jun 6, 2025
857dd5f
Fix asserts
bouwew Jun 6, 2025
f72fd17
Add relay_lock to cache-handling, formatting
bouwew Jun 6, 2025
e2ac8c5
Formatting
bouwew Jun 6, 2025
11d9329
Use match-case construct in get_state()
bouwew Jun 6, 2025
a9d05f1
Bump to a1
bouwew Jun 6, 2025
a10a6ad
Define RelayLock class, implement
bouwew Jun 6, 2025
c27077d
Update test-asserts
bouwew Jun 6, 2025
2e0e24f
Simplify lock_state to state
bouwew Jun 6, 2025
af9e3fa
Add/update missing property, update set_relay_lock typing
bouwew Jun 6, 2025
85df557
Correct _relay_update_lock()
bouwew Jun 7, 2025
0a7211f
Move and protect set_relay_lock()
bouwew Jun 7, 2025
46410fe
Test set_relay_lock() protection
bouwew Jun 7, 2025
cfbbad6
Add relay_lock to node-cache
bouwew Jun 7, 2025
0d4b4ce
Adapt related test-code
bouwew Jun 7, 2025
5c12a19
Bump to a2
bouwew Jun 7, 2025
3982522
Remove double publish_feature_...
bouwew Jun 7, 2025
60ab4c4
Don't init self._relay_lock, will be set from cache
bouwew Jun 7, 2025
904e6e4
Bump to a3
bouwew Jun 7, 2025
1da9bb7
_relay_lock: only replace after state_update
bouwew Jun 7, 2025
ff6ef38
Update CHANGELOG
bouwew Jun 7, 2025
c771745
Fix node property, as suggested
bouwew Jun 7, 2025
493e18c
Improve-fix error messages
bouwew Jun 7, 2025
f050ee0
Remove blank spaces
bouwew Jun 7, 2025
b7f1c2a
Update testcode as suggested
bouwew Jun 7, 2025
9c74ad2
Update CHANGELOG
bouwew Jun 7, 2025
83e1ab2
Bump to a4
bouwew Jun 7, 2025
cdf40d8
Improve _relay_load_from_cache(): init relay_lock when not present
bouwew Jun 7, 2025
bdbff0e
Adapt testcode
bouwew Jun 7, 2025
d876ff6
Improve logic as suggested
bouwew Jun 7, 2025
4ee8051
Bump to a5
bouwew Jun 7, 2025
b22296b
Pylint fixes
bouwew Jun 7, 2025
6683d1e
update_node_details(); add debug logging
bouwew Jun 7, 2025
235d881
Bump to a6
bouwew Jun 7, 2025
a8498e6
_node_info_load_from_cache() debug result
bouwew Jun 7, 2025
89746da
Bump to a7
bouwew Jun 7, 2025
448b143
More debugging
bouwew Jun 7, 2025
ec5839e
Bump to a8
bouwew Jun 7, 2025
9e3ad65
Correct/improve circle._load_from_cache(()
bouwew Jun 7, 2025
be0d125
Formatting
bouwew Jun 7, 2025
b26ad87
Bump to a9
bouwew Jun 7, 2025
f364bcf
Debug circle._node_info_load_from_cache()
bouwew Jun 7, 2025
fa7d787
Bump to a10
bouwew Jun 7, 2025
a318e56
Improve comments, formatting
bouwew Jun 8, 2025
d75237d
Make sure to execute all steps in _load_from_cache()
bouwew Jun 8, 2025
ca01f28
Bump to a11
bouwew Jun 8, 2025
86a7c41
Fix logic mistake, as suggested
bouwew Jun 8, 2025
7308013
Bump to a12
bouwew Jun 8, 2025
8efb91f
Remove unneeded guard
bouwew Jun 8, 2025
d4cf635
Replace getattr() as suggested
bouwew Jun 8, 2025
d9f4d3c
Remove double call to node._node_info_load_from_cache()
bouwew Jun 8, 2025
1ca96a2
Bump to a13
bouwew Jun 8, 2025
3d73993
Remove test-debug-logging
bouwew Jun 8, 2025
530fe0f
Revert addition of relay_lock to update_node_info()
bouwew Jun 8, 2025
61c5c8b
Adapt test-code
bouwew Jun 8, 2025
2ce800b
Spelling
bouwew Jun 8, 2025
80108a1
Bump to a14
bouwew Jun 8, 2025
0d17ad2
Add missing save_cache()
bouwew Jun 8, 2025
92e967a
Write initial current_log_address to cache at starting
bouwew Jun 8, 2025
049ca5b
Remove double save_cache()
bouwew Jun 8, 2025
b393965
Bump to a15
bouwew Jun 8, 2025
f2ae55f
Update CHANGELOG
bouwew Jun 8, 2025
d0a2bbe
Improve logic
bouwew Jun 8, 2025
e5bc252
Bump to a16
bouwew Jun 8, 2025
9e93e3b
NodeCache init: remove empty string
bouwew Jun 8, 2025
e392dd1
Correct _current_log_address update logic
bouwew Jun 8, 2025
3407a3b
Compare options
bouwew Jun 8, 2025
74f26d5
Return to existing code
bouwew Jun 9, 2025
b60d9b3
Remove save_cache()s, handled in the calling function
bouwew Jun 9, 2025
09df036
Improve logger-messages
bouwew Jun 9, 2025
b639c1f
Update CHANGELOG
bouwew Jun 9, 2025
7a50535
Set to v0.43.0 release -version
bouwew Jun 9, 2025
7cc8cfb
Remove trailing space
bouwew Jun 9, 2025
644b0bd
Remove added save_cache(), wrongly added
bouwew Jun 9, 2025
382026a
SED: move save_cache() to task-list
bouwew Jun 9, 2025
46a5d43
Bump version to v0.43.0-1
bouwew Jun 9, 2025
6e716e1
Block relay without raising an error
bouwew Jun 9, 2025
49c12bf
Adapt related test-assert
bouwew Jun 9, 2025
1f7c526
Bump to a17
bouwew Jun 9, 2025
adced7d
Bump to v0.43.0.2 release-version
bouwew Jun 9, 2025
ba33eaf
Update CHANGELOG
bouwew Jun 9, 2025
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.43.0

- Feature Request: add a lock to disable relay-switch-changes (energy devices only) [#254](https://github.com/plugwise/python-plugwise-usb/pull/254)
- Fix cache-related bugs, improve related functions

## v0.42.1

- Implement code improvements, extend debug message [#253](https://github.com/plugwise/python-plugwise-usb/pull/247)
Expand Down
18 changes: 18 additions & 0 deletions plugwise_usb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class NodeFeature(str, Enum):
POWER = "power"
RELAY = "relay"
RELAY_INIT = "relay_init"
RELAY_LOCK = "relay_lock"
SWITCH = "switch"
TEMPERATURE = "temperature"

Expand Down Expand Up @@ -171,6 +172,13 @@ class RelayConfig:
init_state: bool | None = None


@dataclass(frozen=True)
class RelayLock:
"""Status of relay lock."""

state: bool | None = None


@dataclass(frozen=True)
class RelayState:
"""Status of relay."""
Expand Down Expand Up @@ -369,6 +377,13 @@ def relay(self) -> bool:
Raises NodeError when relay feature is not present at device.
"""

@property
def relay_lock(self) -> RelayLock:
"""Last known relay lock state information.

Raises NodeError when relay lock feature is not present at device.
"""

@property
def relay_state(self) -> RelayState:
"""Last known relay state information.
Expand Down Expand Up @@ -420,6 +435,9 @@ async def set_relay(self, state: bool) -> bool:

"""

async def set_relay_lock(self, state: bool) -> bool:
"""Change the state of the relay-lock."""

# endregion

# region configuration properties
Expand Down
Loading
Loading