Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dcc_ex_py/Turnouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def delete_turnout(self, id: int) -> None:
self.controller.send_command(f"<T {id}>")
self.turnouts.pop(id, None)

def get_turnout(self, id: int) -> Turnout:
"""Gets a turnout from the command station.

:param id: The id of the turnout to get.
"""
self.controller.send_command(f"<JT {id}>")

self.turnouts[id] = Turnout(self, id)
return self.turnouts[id]

def refresh_turnouts(self) -> None:
"""Asks the command station to give us information on all defined turnouts.
"""
Expand Down