Repository navigation
Conversation
| return states[0] == b'ON' | ||
|
|
||
| def _request(self, value=None): | ||
| from telnetlib3 import Telnet # optional dependency |
There was a problem hiding this comment.
Please remove the comment, it does not do anything here.
| class WTIPowerDriver(Driver, PowerResetMixin, PowerProtocol): | ||
| """Control one outlet on an eight-outlet WTI switch. | ||
|
|
||
| Bind a NetworkPowerPort with model 'wti'. Disable command confirmations |
There was a problem hiding this comment.
The comment says this binds only with a wti model, but there is no code here to restrict that.
Either way, using NetworkPowerPort is probably not the correct choice here, the NetworkPowerDriver will fail to bind to it because no wti backend exists. So this either needs its own resource or needs to be turned into a backend for the NetworkPowerPort.
There was a problem hiding this comment.
Just saw that after reviewing, I agree with @Emantor on converting this to a backend for NetworkPowerPort 👍
|
Thanks, updated the pull request with your review. |
ozan956
left a comment
There was a problem hiding this comment.
Have you considered implementing this as a NetworkPowerPort backend (labgrid/driver/power/wti.py, like netio_kshell)? That would give labgrid-client power support, proxy forwarding, and docs/tests for free. Credentials could go in the host url (e.g. telnet://:supersecret@host:23), as other backends do (e.g. rpm1521). Is there anything a backend can't do here, apart from the timeout?
| "PyVISA-py>=0.5.2", | ||
| ] | ||
| snmp = ["pysnmp>=7.1.20"] | ||
| telnet = ["telnetlib3>=4.0.0,<5"] |
There was a problem hiding this comment.
A comment that explains why this is being capped would be nice.
| "PyVISA-py>=0.5.2", | ||
| ] | ||
| snmp = ["pysnmp>=7.1.20"] | ||
| telnet = ["telnetlib3>=4.0.0,<5"] |
There was a problem hiding this comment.
CI installs .[dev] only, and telnet isn't part of it, so tests had skipped unfortunately.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2068 +/- ##
========================================
+ Coverage 66.1% 66.2% +0.1%
========================================
Files 194 195 +1
Lines 16204 16261 +57
========================================
+ Hits 10723 10780 +57
Misses 5481 5481
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
ozan956
left a comment
There was a problem hiding this comment.
Thanks for the rework, @ffainelli! 🙌
Moving this to a NetworkPowerPort backend fit much better with the rest of labgrid, and the code is a lot cleaner now 👍
Maybe the changes on powerdriver.py can have its own commit (if you want).
It would also be great to add a release note, since this adds a new backend. We recently switched to reno (https://docs.openstack.org/reno/latest/), and the workflow is described in the development docs (https://labgrid.readthedocs.io/en/latest/development.html#workflow).
Signed-off-by: Florian Fainelli f.fainelli@gmail.com