paramSetSingle method
Implementation
Future<bool> paramSetSingle({
required CommandDataSource dataSource,
required int cloudId,
required Object value,
String? dataSourceUid,
}) async {
final isValidValueType =
ParamSetSingleBleCommandTx.isSupportedValueType(value);
assert(
isValidValueType,
'PARAM_SET_SINGLE value must be int, double, bool, or String.',
);
if (cloudId < 0 || !isValidValueType) {
return false;
}
final response = await sendCommand<ParamSetSingleReply>(
ParamSetSingleBleCommandTx(
dataSource: dataSource,
cloudId: cloudId,
value: value,
dataSourceUid: dataSourceUid,
),
);
if (response == null || response.hasErrors) {
return false;
}
return true;
}