-
Notifications
You must be signed in to change notification settings - Fork 1
AuraSDK Class
Fiercest edited this page Feb 29, 2020
·
2 revisions
The AuraSDK class is the main way of controlling your devices.
AuraSDK aura = new AuraSDK();
AuraSDK(boolean takeControl) // Creates an AuraSDK and takes control of the SDK or not based on the argument.
AuraSDK() // Creates an AuraSDK and automatically takes control, overload of `AuraSDK(true)`.
The Aura SDK requires to be gained control manually via the native method switchMode()
. The method GainControl()
in the AuraSDK class will do this.
When the SDK is finished being used (or the program is closing), the SDK must be released via the native method releaseControl(0)
. The method ReleaseControl()
in the AuraSDK class will do this. By default, the AuraSDK class will release control when the program shutdown via a shutdown hook.
You may also run RestartControl()
in the AuraSDK class to release, and then gain control of the SDK. It will only release if it is being controlled, and it will only gain control if it is not being controlled.
(See below control methods).
//Getter Methods
List<AuraRGBLight> getAllLights() // Gets a list of all lights zones for all devices.
List<AuraRGBLight> getAllLights(AuraDeviceType deviceType) // Gets a list of lights zones for all devices with the specified device type.
List<AuraSDKDevice> getDevices() // Gets a list of all devices.
List<AuraSDKDevice> getDevices(AuraDeviceType deviceType) // Gets a list of all devices of certain device type.
Map<AuraSDKDevice, List<AuraRGBLight>> getLightsWithDevice() // Gets a map of devices valued by a list of their available light zones.
//Functional Methods
void setAllColors(Color color) // Sets the color for all devices.
//Control Methods
void ReleaseControl() // Releases control of the SDK if it is being controlled.
void GainControl() // Gains control of the SDK if it is not being controlled.
void RestartControl() // Releases and then regains control of the SDK. Will only gain control if the SDK is not being controlled.