Yeah I'd be all for extending the OSC mode to support lights & drivers, both for reading and setting. I was thinking ultimately OSC could also be used to read audit data, read & set operator settings, etc. Then you don't need a service mode.. you can use an app (mobile or desktop)!
We have some of this in MPF's OSC mode (read/write switches & lamps, read audit data) if any of that helps:https://github.com/missionpinball/mpf/blob/dev/mpf/plugins/osc.py
Also it would be cool for the desktop app to support colors for lights. If it's a traditional lamp, then it would be cool to set the color in the desktop app. Ideally this would be something that you'd set in the machine YAML file.. like a "color: ff0000" for lamps that the desktop app could read.. that way the data would be there for other future uses. Then also if this was used with RGB LEDs, the desktop app could show the proper color.
The the OSC interface could just use a "light" address, like /light/shootAgain and the data could be a string of the hex color. Reading that data would just be the color that the OSC Server sent. Writing it would just put the RGB hex color for LEDs, and if writing to a lamp it could be something like "off if 000000", "on if anything else"
Maybe we should start a new thread to discuss a formalization of the OSC interface? It would be great if MPF and pyprocgame used the same OSC addresses and data settings so apps like this worked for both. I'm planning (haven't started yet) to write a proper mobile app which uses OSC to communicate to an MPF machine, so if the OSC interface matches on both then it could be used for both (as well as this desktop app, obviously.)
@MOcean, I would volunteer to handle the OSC interface side of things for pyprocgame if you want to handle the desktop app. The only catch for me is today I'm wrapping up MPF 0.1.2 which will include all the DMD and display stuff, but then I'm out for a few days. I could get to it this weekend though.
In MPF you can add handlers to any device (kind of like switch handlers), so getting updates of light status changes to the OSC module is as simple as the OSC module registering handlers which are notified of changes to lights. I'm not sure how that would work in pyprocgame but I'm open to ideas? (I'm sure it's not a problem.. I just haven't thought about it yet.) I guess worst case we could monkey patch lamp methods? Is that even allowed in real programming?
Also receiving light data has the potential to be a lot of traffic. Well, all the messages are short and it's UDP, but if you have 60 lights and an active light show, you can imagine hundreds of updates per second. So I think we'd also want to make it so there are OSC addresses which can be used to configure what's sent? Like /config/enable-light-messages or something with the data being how many you want per sec?