updateSingleLed method

void updateSingleLed(
  1. int deviceId,
  2. int ledID,
  3. Color color
)

Sets the color of the given LED for the given deviceId.

Implementation

void updateSingleLed(int deviceId, int ledID, Color color) {
  if (deviceId >= _controllerCount) {
    throw Exception('Device index out of range!');
  }
  final bb = BytesBuilder();
  final ledIndexBytes = ledID.toBytes();
  bb.add(ledIndexBytes);
  final colorBytes = color.toBytes();
  bb.add(colorBytes);
  _send(
    CommandId.updateSingleLed,
    bb.toBytes(),
    deviceId: deviceId,
  );
}