[py][cmd2] Fix opmodes merge (#8473)

Looks like a build failure got lost in the landing order of python
commands and the big opmode change. This makes it compile again, based
on the java / C++ changes from the opmode PR.
This commit is contained in:
PJ Reiniger
2025-12-13 15:11:29 -05:00
committed by GitHub
parent dacded37e5
commit ea71bdfba6
2 changed files with 3 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ import hal
from typing_extensions import Self
from wpilib import (
RobotBase,
RobotState,
DriverStation,
TimedRobot,
Watchdog,
reportWarning,
@@ -191,7 +191,7 @@ class CommandScheduler(Sendable):
if self.isScheduled(command):
return
if RobotState.isDisabled() and not command.runsWhenDisabled():
if DriverStation.isDisabled() and not command.runsWhenDisabled():
return
requirements = command.getRequirements()
@@ -249,7 +249,7 @@ class CommandScheduler(Sendable):
self._watchdog.addEpoch("buttons.run()")
self._inRunLoop = True
isDisabled = RobotState.isDisabled()
isDisabled = DriverStation.isDisabled()
# Run scheduled commands, remove finished commands.
for command in self._scheduledCommands.copy():

View File

@@ -7,7 +7,6 @@ if TYPE_CHECKING:
from .util import *
import pytest
from wpilib import RobotState
def test_robotDisabledCommandCancel(scheduler: commands2.CommandScheduler):