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

Warn users when using default pin factory for Servos and Distance Sensors, close #780 #781

Merged
merged 3 commits into from Sep 17, 2019

Conversation

SofiiaKosovan
Copy link
Contributor

@SofiiaKosovan SofiiaKosovan commented Jul 13, 2019

@bennuttall
Copy link
Member

Thank you @SofiiaKosovan!

Assigning to @waveform80 to review this

"Warning raised when falling back to the software implementation"
"Warning raised when falling back to the SPI software implementation"

class PWMSoftwareFallback(SPIWarning):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it (logically) makes sense for PWMSoftwareFallback to be a subclass of SPIWarning ? 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

if PiGPIOFactory is None or not isinstance(self.pin_factory, PiGPIOFactory):
warnings.warn(PWMSoftwareFallback(
'To reduce servo jitter, use the pigpio pin factory.'
'See https://gpiozero.readthedocs.io/en/stable/api_output.html#servo for more info'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the documentation being pointed to doesn't mention PiGpio at all? Maybe this PR should also update the associated documentation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note was added to the Servo docstring in this PR :)

@bennuttall bennuttall merged commit bae9e1d into gpiozero:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants