Repository navigation
Add power_on and switch_lock to system for Energy Socket v2 API - #641
Merged
Merged
Conversation
The Energy Socket v2 API exposes power_on and switch_lock on /api/system instead of a separate state endpoint. Add both fields to System and SystemUpdate, accept them in system() for v1 and v2, and map the v1 state onto system in CombinedModels so consumers can use system for both APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #641 +/- ##
==========================================
+ Coverage 99.27% 99.28% +0.01%
==========================================
Files 9 9
Lines 685 699 +14
Branches 65 70 +5
==========================================
+ Hits 680 694 +14
Misses 2 2
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nvanofwegen
approved these changes
Nov 19, 2026
DCSBL
approved these changes
Nov 19, 2026
DCSBL
left a comment
Contributor
There was a problem hiding this comment.
Other than a unrelated bump; no remarks
|
|
||
| - name: Upload coverage report | ||
| uses: codecov/codecov-action@v6.0.1 | ||
| uses: codecov/codecov-action@v6.0.2 |
5 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Energy Socket v2 API (API docs PR homewizard/api-documentation#303) has no
/api/state. Instead,power_onandswitch_lockare read/write fields on/api/system.power_onandswitch_locktoSystemandSystemUpdate, and accept them insystem()(base, v1 and v2).PUT /api/system. If the cached device has no switch, raiseUnsupportedErrorinstead./api/v1/state, the same waystatus_led_brightness_pctalready is.CombinedModelscopies v1state.power_onandstate.switch_lockontosystem, so consumers can readsystemfor both APIs.state(), socombined()doesn't request/api/systemtwice.HWE-SKTfixtures and tests. Most snapshot changes are only the two newSystemfields.Not yet tested against real v2 socket hardware: the current socket firmware stops accepting new connections after a few (EMB-1474).
🤖 Generated with Claude Code