Skip to content

Conversation

@Bastian-Krause
Copy link
Member

Description
When using the siglent power backend with the NetworkPowerDriver, this error occurs:

  self = NetworkPowerDriver(target=Target(name='Test', env=None), name='power', state=<BindingState.active: 2>, delay=2.0)

      @Driver.check_active
      @step()
      def off(self):
  >       self.backend.power_set(self._host, self._port, self.port.index, False)
  E       TypeError: power_set() takes 3 positional arguments but 4 were given

  labgrid/driver/powerdriver.py:219: TypeError

The siglent backend does not follow the function signatures expected by the NetworkPowerDriver, because it's missing the port parameter. Fix that by adding the port parameter and making sure that it's None, just like other backends do (apc, rest, sentry, simplerest, tplink).

Note: I have no Siglent device here to actually test this. I stumbled upon this while trying to add a test for another power-related change.

/cc @esben

Checklist

  • Tests for the feature
  • CHANGES.rst has been updated
  • PR has been tested

Fixes #717

…workPowerDriver

When using the siglent power backend with the NetworkPowerDriver, this
error occurs:

  self = NetworkPowerDriver(target=Target(name='Test', env=None), name='power', state=<BindingState.active: 2>, delay=2.0)

      @Driver.check_active
      @step()
      def off(self):
  >       self.backend.power_set(self._host, self._port, self.port.index, False)
  E       TypeError: power_set() takes 3 positional arguments but 4 were given

  labgrid/driver/powerdriver.py:219: TypeError

The siglent backend does not follow the function signatures expected by
the NetworkPowerDriver, because it's missing the port parameter. Fix that
by adding the port parameter and making sure that it's None, just like
other backends do (apc, rest, sentry, simplerest, tplink).

Fixes: da0a81d ("driver/power: add support for Siglent SPD3000X series power supplies")
Signed-off-by: Bastian Krause <bst@pengutronix.de>
@Bastian-Krause Bastian-Krause added fix pick to stable Needs a pick to the latest stable branch labels Aug 3, 2022
@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #960 (82ca4ab) into master (dffc61d) will decrease coverage by 0.0%.
The diff coverage is 50.0%.

@@           Coverage Diff            @@
##           master    #960     +/-   ##
========================================
- Coverage    57.1%   57.1%   -0.1%     
========================================
  Files         150     150             
  Lines       11199   11201      +2     
========================================
  Hits         6402    6402             
- Misses       4797    4799      +2     
Impacted Files Coverage Δ
labgrid/driver/power/siglent.py 17.6% <50.0%> (-2.4%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dffc61d...82ca4ab. Read the comment docs.

@jluebbe jluebbe merged commit f30264b into labgrid-project:master Aug 22, 2022
@Bastian-Krause Bastian-Krause deleted the bst/siglent branch August 22, 2022 18:39
@Bastian-Krause Bastian-Krause removed the pick to stable Needs a pick to the latest stable branch label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants