updateParamValue method

Future<void> updateParamValue(
  1. Map<String, dynamic> body, [
  2. bool forceDeviceCheck = false
])

Sets the device parameters.

If forceDeviceCheck is set to true the function will forcibly poll for the Rainmaker device regardless of whether it was previously discovered.

Throws a LocalControlUnavailable exception if the device address if not known.

Implementation

Future<void> updateParamValue(Map<String, dynamic> body,
    [bool forceDeviceCheck = false]) async {
  if (forceDeviceCheck) {
    final tmpIp = await _getDeviceIP();
    if (tmpIp != null) {
      _ipAndPort = tmpIp;
    }
  }

  if (_ipAndPort == null) {
    throw LocalControlUnavailable();
  }

  return _apiManager.updateParamValue(_ipAndPort!.baseUrl, body);
}