missionpinball / mpf

Mission Pinball Framework: Open source software to run a real pinball machine.
http://missionpinball.org
MIT License
217 stars 143 forks source link

BCP messages for 'timed_switch' devices faulty or missing #1845

Open arthurkehrwald opened 4 weeks ago

arthurkehrwald commented 4 weeks ago

MPF version: 0.57.2

The initial state that MPF sends for timed_switch devices after monitoring is started by the media controller using the command monitor_start?category=device contains the following JSON parameter:

{
    "type": "timed_switch",
    "name": "flipper_cradle",
    "changes": false,
    "state": {
        "active_switches": "set()"
    }
}

The active_switches attribute seems to be the result of casting an empty Python set to string. I can't find documentation on what it is supposed to be, but I assume it is meant to be a comma separated list, or ideally a JSON array of the switches that belong to the device and are active.

MPF also does not send updates for timed_switch devices when one of the switches is closed for the specified duration.