labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
332 stars 174 forks source link

driver/power/gude.py: Usage of powe switches with more than 8 ports #174

Closed SmithChart closed 6 years ago

SmithChart commented 6 years ago

I am trying to use a Gude expert Power 8080 with labgrid. This device has 24 ports.

The current gude.py limits the number of ports to 8. Question is:

Option 1 opens the possibility to try to access ports that do not on a device. Option 2 leads to copied code with just a changed assertion.

As far as I can see there is no way I can pass the number of existing ports to the actual driver.

SmithChart commented 6 years ago

Talking to @jluebbe we decided to patch the default driver to support up to 24 ports. This would make it possible to use one driver for both types of devices. If a port > 8 would have been used on an 8-port device the user would probably notice that the power switch does not work as intended.

Looking closer the interfaces look alike but are not the same. Since I did not want the driver to probe the type on every action I created a new driver for the 24-port devices: https://github.com/labgrid-project/labgrid/pull/178