Skip to content

Commit 0e6cc38

Browse files
committed
stop double calling on_disable callbacks
1 parent 2c59aff commit 0e6cc38

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

magicbot/magiccomponent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def on_enable(self) -> None:
6060

6161
def on_disable(self) -> None:
6262
"""
63-
Called when the robot leaves autonomous, teleoperated or test mode
63+
Called when the robot enters disabled mode.
6464
"""
6565

6666
def execute(self) -> None:

magicbot/magicrobot.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ def autonomous(self) -> None:
413413
watchdog=self.watchdog,
414414
)
415415

416-
self._on_mode_disable_components()
417-
418416
def _disabled(self) -> None:
419417
"""
420418
This function is called in disabled mode. You should not
@@ -513,8 +511,6 @@ def _operatorControl(self) -> None:
513511
delay.wait()
514512
watchdog.reset()
515513

516-
self._on_mode_disable_components()
517-
518514
def _test(self) -> None:
519515
"""Called when the robot is in test mode"""
520516
watchdog = self.watchdog
@@ -562,8 +558,6 @@ def _test(self) -> None:
562558
wpilib.LiveWindow.setEnabled(False)
563559
# Shuffleboard.disableActuatorWidgets()
564560

565-
self._on_mode_disable_components()
566-
567561
def _on_mode_enable_components(self) -> None:
568562
# initialize things
569563
for _, component in self._components:

0 commit comments

Comments
 (0)