set_all_locos_lights
Turns all locomotive lights on or off in one call, operating on every locomotive currently acquired. Use for bulk lighting control without naming each loco.
Instructions
Turn ON/OFF EVERY light-related function of EVERY currently-acquired locomotive at once.
Args: state: True to turn every light-related function on for every locomotive, False to turn them all off.
Call for "turn on/off all the lights of all the locos"/"allume/ éteins toutes les lumières de toutes les locos" — locomotives in bulk, no single one named. Never loop set_loco_lights/set_function yourself — this loops server-side in one call, over every locomotive this session has acquired.
Same scope limitation as emergency_stop_all: only reaches locomotives THIS session has acquired a throttle for. A locomotive driven only from a JMRI panel or another session is untouched. Nothing acquired yet returns {"locomotives": []}, not an error.
For ONE named locomotive use set_loco_lights. For layout/scenery lighting (JMRI Light objects, no locomotive involved), use set_layout_lights instead — never this tool.
Returns {"locomotives": []} — attempted independently, one failure doesn't block the others.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes |