Skip to content

Allow disabling continuous servos - #79

Merged
tannewt merged 1 commit into
adafruit:mainfrom
giri256:fix/continuous-servo-disable
Jul 27, 2026
Merged

Allow disabling continuous servos#79
tannewt merged 1 commit into
adafruit:mainfrom
giri256:fix/continuous-servo-disable

Conversation

@giri256

@giri256 giri256 commented Jul 26, 2026

Copy link
Copy Markdown

Fixes #74.

ContinuousServo already inherits the ability to disable PWM through fraction = None, but its throttle setter compares the value with numbers before checking for None. The getter also tries to perform arithmetic on None after the servo is disabled.

This handles None before range validation and returns None when reading the throttle of a disabled servo. The regression test covers disabling and enabling the servo again.

Tests:

  • pytest tests -q — 7 passed
  • Ruff formatting and lint checks passed

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@tannewt
tannewt merged commit dc0c88c into adafruit:main Jul 27, 2026
1 check passed
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 29, 2026
Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.11.9 from 3.11.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#127 from grgrant/Fix123
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#126 from grgrant/issue124

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 5.0.5 from 5.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#239 from giri256/fix/avoid-orphaned-final-character

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.5.0 from 3.4.20:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#79 from giri256/fix/continuous-servo-disable

Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.12.1 from 1.12.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Register#61 from giri256/docs/alarm-date-limits
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.

kit.continuous_servo[1].throttle = None doesn't work like kit.servo[1].angle = None

2 participants