setDeviceSwitchStatus method

Future<Map<String, dynamic>> setDeviceSwitchStatus(
  1. String deviceSerial,
  2. String type,
  3. bool enable
)

Implementation

Future<Map<String, dynamic>> setDeviceSwitchStatus(
  String deviceSerial,
  String type, // e.g., "301"
  bool enable,
) async {
  // V3 API - POST request
  // Query params `type`, `enable`
  return _client.post(
    '/api/v3/device/switchStatus/set?type=$type&enable=${enable ? 1 : 0}',
    {'deviceSerial': deviceSerial},
  );
}