public class Flags extends SIMPluginCallback
This plugin requires the following entries in the settings.
LIFX-Flags = Y LIFX-token = YourToken LIFX-flags-brightness = 1.0 LIFX-always-green = YTo obtain a token, go to https://cloud.lifx.com and login to your account. Then click on your name in the upper right corner of the screen and select "settings". Click on "Generate a new Token" and give it the name "SIMRacingApps" and click "Generate". Copy the token it generates and paste it in the SIMRacingApps settings.
NOTE: You must have the light(s) you want SIMRacingApps to use assigned to your cloud account using the LIFX app and assigned to the group "SRA-flags". There is an option in the app, under each light's settings, to add the light to the cloud and assign the group. This field is case sensitive, so type it exactly as you see here.
Constructor and Description |
---|
Flags(SIMPlugin SIMPlugin)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called when the SIMPlugin is destroyed.
|
boolean |
ProcessData(SIMPlugin SIMPlugin,
java.util.Map<java.lang.String,Data> data)
ProcessData is called from within the dedicated thread for this plug-in
every time there is data available in the queue it pops it off the queue and passes it to this method.
|
DataReady, Waiting
public Flags(SIMPlugin SIMPlugin) throws SIMPlugin.SIMPluginException
SIMPlugin
- An instance of the current SIM.SIMPlugin.SIMPluginException
- If there's a problem constructing your plug-in.public void destroy()
destroy
in class SIMPluginCallback
public boolean ProcessData(SIMPlugin SIMPlugin, java.util.Map<java.lang.String,Data> data)
//When calling the SIMPlugin from this method, you must synchronize on it first. It is not thread safe. Data d; synchronized (SIMPlugin) { //do not spend much time in here, we are blocking the main thread //Get the data and get out of the synchronized block d = SIMPlugin.getData("/Session/IsGreenFlag"); d = SIMPlugin.getSession().getIsGreenFlag(); } //do something with the data
ProcessData
in class SIMPluginCallback
SIMPlugin
- A reference to the SIMPlugin instance.data
- The Data objects added to the queue.