Skip to content

Commit c28a40c

Browse files
committed
fix: using the fix of parameters respecting default values
1 parent 92c0310 commit c28a40c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/examples/traffic_light_nested_machine.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def __init__(self, seconds_to_turn_state=5, seconds_running=20):
4040
def on_timer(self, event: str, source: State, target: State):
4141
print(f".. Running {event} from {source.id} to {target.id}")
4242

43-
def reset_elapsed(self, event: str, time):
43+
def reset_elapsed(self, event: str, time: int = 0):
4444
print(f"entering reset_elapsed from {event} with {time}")
45-
self.last_turn = time if time else 0
45+
self.last_turn = time
4646

4747
@timer.cond
4848
def time_is_over(self, time):
@@ -62,3 +62,4 @@ def run_forever(self):
6262

6363

6464
sm = NestedTrafficLightMachine()
65+
sm.send("anything")

0 commit comments

Comments
 (0)