Skip to content

Commit 44df769

Browse files
committed
Merge branch 'main' of https://github.com/cwstryker/robotpy-commands-v2 into cwstryker/generic_types_test
2 parents cae5dc5 + 8c16d89 commit 44df769

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.gittrack

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[git-source-track]
22
upstream_root = ../allwpilib/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command
33
upstream_branch = main
4-
upstream_commit = 4595f84719759d71491e11e8df55d60ce2a6154c
5-
validation_root = commands2
4+
upstream_commit = 9206b47d6708cbae61506e962c633d722884a26f
5+
validation_root = commands2
6+

commands2/button/commandgenerichid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def button(self, button: int, loop: Optional[EventLoop] = None) -> Trigger:
3939
"""
4040
if loop is None:
4141
loop = CommandScheduler.getInstance().getDefaultButtonLoop()
42-
return Trigger(loop, lambda: self._hid.getRawButtonPressed(button))
42+
return Trigger(loop, lambda: self._hid.getRawButton(button))
4343

4444
def pov(
4545
self, angle: int, *, pov: int = 0, loop: Optional[EventLoop] = None

commands2/deferredcommand.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ def initSendable(self, builder: SendableBuilder):
5656
super().initSendable(builder)
5757
builder.addStringProperty(
5858
"deferred",
59-
lambda: "null"
60-
if self._command is self._null_command
61-
else self._command.getName(),
59+
lambda: (
60+
"null"
61+
if self._command is self._null_command
62+
else self._command.getName()
63+
),
6264
lambda _: None,
6365
)

commands2/sysid/sysidroutine.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# validated: 2024-01-20 DS 707cb061057f sysid/SysIdRoutine.java
2-
from dataclasses import dataclass
1+
# validated: 2024-01-26 DV 19c155647273 sysid/SysIdRoutine.java
2+
from dataclasses import dataclass, field
33
from enum import Enum
44

55
from wpilib.sysid import SysIdRoutineLog, State
@@ -78,10 +78,10 @@ class Mechanism:
7878
drive: Callable[[volts], None]
7979
log: Callable[[SysIdRoutineLog], None]
8080
subsystem: Subsystem
81-
name: Optional[str] = None
81+
name: str = None # type: ignore[assignment]
8282

8383
def __post_init__(self):
84-
if self.name == None:
84+
if self.name is None:
8585
self.name = self.subsystem.getName()
8686

8787
class Direction(Enum):
@@ -96,7 +96,7 @@ def __init__(self, config: Config, mechanism: Mechanism):
9696
:param config: Hardware-independent parameters for the SysId routine.
9797
:param mechanism: Hardware interface for the SysId routine.
9898
"""
99-
super().__init__(mechanism.subsystem.getName())
99+
super().__init__(mechanism.name)
100100
self.config = config
101101
self.mechanism = mechanism
102102
self.outputVolts = 0.0

tests/test_command_decorators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def test_beforeStarting(scheduler: commands2.CommandScheduler):
6464

6565

6666
@pytest.mark.skip
67-
def test_andThenLambda(scheduler: commands2.CommandScheduler):
68-
...
67+
def test_andThenLambda(scheduler: commands2.CommandScheduler): ...
6968

7069

7170
def test_andThen(scheduler: commands2.CommandScheduler):

0 commit comments

Comments
 (0)