Interface LightController
-
- All Implemented Interfaces:
public interface LightController
Interface for controlling a light. This is used by KobotLight to abstract the actual hardware implementation.
The exec, flash, and transition functions are specifically called out since they will usually involve some background tasking to work with this system.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
set(LightCommand command)
Set the state of the light. Unit
exec(String effect)
Execute an effect in some sort of completable manner. Unit
flash(Integer flash)
Flash the light (on/off) using this period (seconds). Unit
transition(LightCommand command)
Transition from the current state to a new state. abstract LightState
current()
Get the state of the light. abstract String
getControllerIcon()
abstract List<String>
getLightEffects()
-
-
Method Detail
-
set
abstract Unit set(LightCommand command)
Set the state of the light.
-
exec
Unit exec(String effect)
Execute an effect in some sort of completable manner. Note this must be cancellable by any subsequent commands.
-
flash
Unit flash(Integer flash)
Flash the light (on/off) using this period (seconds). Continues flashing until another command is received.
NOTE HA is only currently sending either 10 or 2 to signal fast/slow.
-
transition
Unit transition(LightCommand command)
Transition from the current state to a new state. Because this can include color and brightness changes, the whole parsed command is necessary to complete this function.
-
current
abstract LightState current()
Get the state of the light.
-
getControllerIcon
abstract String getControllerIcon()
-
getLightEffects
abstract List<String> getLightEffects()
-
-
-
-