-
Notifications
You must be signed in to change notification settings - Fork 232
[RDY] Topic/onewire #6
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
Conversation
1 similar comment
labgrid/protocol/OneWireProtocol.py
Outdated
| import abc | ||
|
|
||
|
|
||
| class OneWireProtocol(abc.ABC): |
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.
At the protocol level, this should be more generic. Maybe call it DigitalOutput instead?
labgrid/driver/onewiredriver.py
Outdated
|
|
||
| @target_factory.reg_driver | ||
| @attr.s | ||
| class OneWireDriver(Driver): |
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.
Corresponding to the change to the Protocol, this should be a OneWirePIODriver, implementing the DigitalOutput protocol.
labgrid/driver/powerdriver.py
Outdated
|
|
||
| @target_factory.reg_driver | ||
| @attr.s | ||
| class OneWirePowerDriver(Driver, PowerProtocol): |
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.
This would be called DigitalOutputPowerDriver.
labgrid/resource/onewireport.py
Outdated
| @attr.s | ||
| class OneWirePort(Resource): | ||
| portname = attr.ib(validator=attr.validators.instance_of(str)) | ||
| url = attr.ib(validator=attr.validators.instance_of(str)) |
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.
This should be called OneWirePIO and have host and path properties. Also add a docstring giving an example path.
35a3e22 to
1417ad0
Compare
1 similar comment
5c0dd91 to
7984b0d
Compare
facdfa7 to
204c33a
Compare
|
This should be ready for review now, removing WIP. |
labgrid/driver/powerdriver.py
Outdated
| @target_factory.reg_driver | ||
| @attr.s | ||
| class DigitalOutputPowerDriver(Driver, PowerProtocol): | ||
| """NetworkPowerDriver - Driver using a networked power switch to control a target's power""" |
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.
Please update the docstring.
labgrid/driver/powerdriver.py
Outdated
| @attr.s | ||
| class DigitalOutputPowerDriver(Driver, PowerProtocol): | ||
| """NetworkPowerDriver - Driver using a networked power switch to control a target's power""" | ||
| bindings = {"onewire": OneWirePIODriver, } |
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.
Shouldn't this bind to a DigitalOutputProtocol? Maybe use "output" as the name.
|
|
||
| @target_factory.reg_resource | ||
| @attr.s | ||
| class OneWirePIO(Resource): |
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.
Add a docstring with example host/port values.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
remote/client: support token with template RemotePlace
Add onewire support to labgrid, needs a running onewire server at the moment.
WIP: