-
-
Notifications
You must be signed in to change notification settings - Fork 238
driver/powerdriver: ykushpower: board_name support #1280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver/powerdriver: ykushpower: board_name support #1280
Conversation
0fe4b8c to
3aad0b4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1280 +/- ##
======================================
Coverage 45.1% 45.2%
======================================
Files 173 173
Lines 13712 13721 +9
======================================
+ Hits 6188 6203 +15
+ Misses 7524 7518 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Isn't it possible to detect the model automatically (i.e. using the USB VID/PID) instead of requiring manual configuration by the user? How did this work previously? @edersondisouza? |
The user manuals for the YKUSH XS, YKUSH, and YKUSH3 state the products have the same VID but different PIDs. Therefore, I believe it is possible to detect the model automatically. Would you advise changing
$ python3.8 pykush.py -l
listing YKUSH family devices
found a YKUSH XS release 2 device with serial number YKU2768
system device path 1-8.2:1.0, vendor id 0x04d8, product id 0xf0cd
the device has 1 downstream port
Checking running power state, port 1 : UP
found a YKUSH3 release 1 device with serial number Y3N10673
system device path 1-4.4:1.0, vendor id 0x04d8, product id 0xf11b
the device is running a v1.0 firmware and has 3 downstream ports
downstream running power states, port 1 to 3: UP, UP, UP
$ ./bin/ykushcmd -l
Attached YKUSH Boards:
No YKUSH boards found.
$ ./bin/ykushcmd ykush3 -l
Attached YKUSH3 Boards:
1. Board found with serial number: Y3N10673
$ ./bin/ykushcmd ykushxs -l
Attached YKUSH XS Boards:
1. Board found with serial number: YKU2768 |
|
Ouch, this is really inconvenient =/ Wonder if trying to get USB PID will work nice with the remote instance. Maybe require pykush and use the command line tool (not the module, so it's easy to support remote instance)? An ugly hack would be to try to chain three calls to ykushcmd and use it, like Or fix ykushcmd itself... =/ |
3aad0b4 to
411a818
Compare
|
Fixing Otherwise, you could make YKUSHPowerPort would match USB HID devices by the given serial. In the Driver, you could then use the USB vendor/model IDs to generate the correct board name for The additional resource properties would break backwards compatibility, but the current state is broken anyway. :/ |
411a818 to
d542490
Compare
I found a way to not break backward compatibility. Use |
d542490 to
3c63857
Compare
3c63857 to
48bd190
Compare
edersondisouza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice workaround! Minor nit: on commit message the phrase "Added tests for YKUSHPowerPort and YKUSHPowerPort.' seems wrong - maybe you meant YKUSHPowerDriver for the second YKUSHPowerPort?
Yes, thanks for catching that. |
48bd190 to
6377626
Compare
6377626 to
c9228a9
Compare
|
Any more comments on this, @jluebbe and @Bastian-Krause? |
c9228a9 to
d2c8bad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force-pushed: rebased, fixed remote support for the model detection
When 6425df9 switched from pykush to ykushcmd, support for the YKUSH 3 and YKUSH XS was lost. Restore support for those boards by passing the board_name argument to ykushcmd. The board_name is determined by listing the attached YKUSH boards by model. Added tests for YKUSHPowerPort and YKUSHPowerDriver. Signed-off-by: Paul Vittorino <paul.vittorino@garmin.com> [bst: rebased, added self.port.command_prefix to model detection for remote access, dropped redundant/unrelated test_import_backend_poe_mib] Signed-off-by: Bastian Krause <bst@pengutronix.de>
d2c8bad to
6952f14
Compare
|
Force-pushed: dropped unrelated copy-pasted |
Description
When 6425df9 switched from
pykushtoykushcmd, support for the YKUSH 3 and YKUSH XS was lost. Restore support for those boards by passing theboard_nameargument toykushcmd. Theboard_nameis determined by listing the attached YKUSH boards by model.Checklist