measure method

Future<ScpStatusMeasure> measure(
  1. String deviceId,
  2. String action
)

Implementation

Future<ScpStatusMeasure> measure(String deviceId, String action) async {
  log('do measure for device: $deviceId');
  final ScpStatusMeasure measureResponseStatus =
      await ScpMessageSender.sendMeasure(
          knownDevices.firstWhere((element) => element.deviceId == deviceId),
          action);
  if (measureResponseStatus.status == ScpStatus.RESULT_SUCCESS) {
    log('Successfully send measure $action to $deviceId');
    return measureResponseStatus;
  } else {
    log('Failed to send measure $action to $deviceId');
    return measureResponseStatus;
  }
}