Skip to content

Conversation

aparcar
Copy link
Contributor

@aparcar aparcar commented Jun 13, 2025

Description

The API changed and no longer excepts POST for the legacy API. This commit adds support for the "new" RPC API.

Ref: https://shelly-api-docs.shelly.cloud/gen2/General/RPCProtocol

Tested with a Shelly Plug S MTR Gen3

Checklist

  • Documentation for the feature
    • Added in docstring
  • Tests for the feature
    • Tested with real hardware
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

@aparcar aparcar marked this pull request as ready for review June 13, 2025 16:44
Copy link

codecov bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 55.7%. Comparing base (f9d8ca0) to head (8d3ec78).
Report is 2 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/power/shelly_gen2.py 0.0% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1664     +/-   ##
========================================
- Coverage    55.7%   55.7%   -0.1%     
========================================
  Files         171     172      +1     
  Lines       13408   13420     +12     
========================================
  Hits         7477    7477             
- Misses       5931    5943     +12     
Flag Coverage Δ
3.10 55.7% <0.0%> (-0.1%) ⬇️
3.11 55.7% <0.0%> (-0.1%) ⬇️
3.12 55.7% <0.0%> (-0.1%) ⬇️
3.13 55.6% <0.0%> (-0.1%) ⬇️
3.9 55.7% <0.0%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Bastian-Krause
Bastian-Krause previously approved these changes Jul 4, 2025
Copy link
Member

@Bastian-Krause Bastian-Krause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. The power backend looks good. I've adjusted the commit message slightly and added a doc entry.

Since this adds support for another network PDU, see our merge policy for those: #1031. I'm gonna merge this into labgrid, but maybe it makes sense in the long run to add support for it into pdudaemon and use that.

The API changed and no longer accepts POST for the legacy API. This
commit adds support for the "new" RPC API.

Ref: https://shelly-api-docs.shelly.cloud/gen2/General/RPCProtocol

Signed-off-by: Paul Spooren <[email protected]>
[bst: adjusted commit message to fit common style, fix typo. add doc
entry, mark as ruff formatted]
Signed-off-by: Bastian Krause <[email protected]>
@Bastian-Krause Bastian-Krause merged commit 948ad80 into labgrid-project:master Jul 4, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants