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
Conversation
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): |
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.
I'm not sure if it (logically) makes sense for PWMSoftwareFallback
to be a subclass of SPIWarning
? 🤷♂️
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.
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' |
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.
It seems that the documentation being pointed to doesn't mention PiGpio at all? Maybe this PR should also update the associated documentation?
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.
A note was added to the Servo docstring in this PR :)
#780