sendCommand method

Future<void> sendCommand(
  1. DeviceCommand command, {
  2. bool instant = false,
})

Implementation

Future<void> sendCommand(
  DeviceCommand command, {
  bool instant = false,
}) async {
  if (_active == true) {
    if (instant == true && _channel != null) {
      _channel!.sink.add(command.toJson());
    } else {
      _commandQueue.add(command);

      await _sendCommands();
    }
  }
}