Skip to content

driver/power: Add RPM1521 support - #1934

Open
CalebEthridgeADI wants to merge 2 commits into
labgrid-project:masterfrom
CalebEthridgeADI:add-rpm1521-driver
Open

driver/power: Add RPM1521 support#1934
CalebEthridgeADI wants to merge 2 commits into
labgrid-project:masterfrom
CalebEthridgeADI:add-rpm1521-driver

Conversation

@CalebEthridgeADI

@CalebEthridgeADI CalebEthridgeADI commented Jul 13, 2026

Copy link
Copy Markdown

Add power driver support for the Minuteman RPM1521 series which comes in 2, 4 and 8 port configurations. This driver should also work for the Amberry IP2,4,8 series as they are based on the same hardware.

Tested locally on an RPM1521E.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • 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

Comment on lines +52 to +58
# The status CGI returns a list literal, e.g.
# ['RPM1521E','0.0','NULL','1','1','109.9',['1','0'],['0','1'],['0.0','0.0']]
# It contains several bracketed sub-lists; the second to last one holds the
# on/off status of each outlet.
groups = re.findall(r"\[[^\[\]]+\]", r.text)
socket_states = re.findall(r"\d+", groups[-2])
return int(socket_states[index - 1]) == 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like JSON... Is there a reason not to use json.loads instead of regex?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the driver to switch from regex to json.loads. Thanks for the review Jan!

Add power backend for the Minuteman RPM1521 series of
power switches(2,4,8 ports).

Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
@Emantor
Emantor requested a review from Bastian-Krause July 31, 2026 09:45
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.84211% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.9%. Comparing base (64723a5) to head (b7abeaf).
⚠️ Report is 22 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/power/rpm1521.py 36.8% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1934     +/-   ##
========================================
- Coverage    61.0%   60.9%   -0.1%     
========================================
  Files         182     183      +1     
  Lines       14881   14900     +19     
========================================
+ Hits         9083    9088      +5     
- Misses       5798    5812     +14     
Flag Coverage Δ
3.10 60.9% <36.8%> (-0.1%) ⬇️
3.11 60.9% <36.8%> (-0.1%) ⬇️
3.12 60.9% <36.8%> (-0.1%) ⬇️
3.13 60.9% <36.8%> (-0.1%) ⬇️
3.14 60.9% <36.8%> (-0.1%) ⬇️

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants