secure_layout
Ends a model railroad session by stopping all locomotives, turning off all layout lights, and releasing throttles to secure the layout.
Instructions
Put the whole layout into a known safe resting state — the end-of-session "I'm done for today" command.
Args: release_throttles: True (default) to also release every locomotive's throttle at the end. False to stop/light-off every locomotive but keep throttles acquired.
Call for "I'm done for today, secure the layout"/"sécurise le layout"/"on arrête pour aujourd'hui" — a broad end-of-session request naming the layout as a whole, not one locomotive. Never chain stop/set_loco_lights/set_layout_lights/release_throttle yourself, this runs the full sequence server-side in one call.
Runs in order: 1) every acquired locomotive smoothly stopped (ramped, not abrupt), faced forward, lights off — same as park_locomotive, independently per locomotive; 2) every layout light (JMRI Light objects) turned off — same as set_layout_lights(False); 3) if release_throttles is True (default), every throttle released.
NOT power_off_all (cuts DCC track power itself, unconditionally, including locomotives never acquired here — more drastic, never touches power) and NOT emergency_stop_all (motion-only, no lights/release). Only reaches locomotives THIS session has acquired.
Returns {"locomotives": [<per-locomotive stop/lights/release result>...], "layout_lights": }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| release_throttles | No |