-
Notifications
You must be signed in to change notification settings - Fork 174
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
base: master
Are you sure you want to change the base?
Conversation
0fe4b8c
to
3aad0b4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1280 +/- ##
======================================
Coverage 62.2% 62.2%
======================================
Files 164 164
Lines 12191 12207 +16
======================================
+ Hits 7584 7599 +15
- Misses 4607 4608 +1 ☔ 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
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
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 <[email protected]>
6377626
to
c9228a9
Compare
Any more comments on this, @jluebbe and @Bastian-Krause? |
Description
When 6425df9 switched from
pykush
toykushcmd
, support for the YKUSH 3 and YKUSH XS was lost. Restore support for those boards by passing theboard_name
argument toykushcmd
. Theboard_name
is determined by listing the attached YKUSH boards by model.Checklist