Skip to content
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

Standardizing PowerSupply #131

Open
WasabiFan opened this issue Dec 9, 2015 · 2 comments
Open

Standardizing PowerSupply #131

WasabiFan opened this issue Dec 9, 2015 · 2 comments

Comments

@WasabiFan
Copy link
Member

Looking through the python library, I can't quite tell what the standard behavior in the PowerSupply is (it takes a port parameter, and it seems like if the port is specified it might try to read from a nonexistent attribute... but I'm not sure). Whatever the case, I am pretty sure that our docs are now wrong:

Uses the built-in legoev3-battery if none is specified.

Should we completely remove this line from the docs? Or add a platform-specific version of this class which defaults to the current platform's power supply? Or maybe just use a wildcard by default for the device name so that it selects the first device it finds?

I'd vote for the last one, but open to suggestions (both based on opinions and current implementation).

@dlech
Copy link
Member

dlech commented Dec 9, 2015

Rather than making platform specific power supplies, I would suggest utilizing the scope attribute (same as the POWER_SUPPLY_SCOPE property) to find the "System" power supply.

@ddemidov
Copy link
Member

ddemidov commented Dec 9, 2015

it takes a port parameter, and it seems like if the port is specified it might try to read from a nonexistent attribute

This is a leftover of mass-conversion to pure python I guess. We should change PowerSupply's constructor to a custom one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants