playRingtone method

Future<Map<String, dynamic>> playRingtone(
  1. String deviceSerial,
  2. String voiceIndex, {
  3. String? volume,
})

Implementation

Future<Map<String, dynamic>> playRingtone(
  String deviceSerial,
  String voiceIndex, { // e.g., "200"-Beep, "201"-Alarm, "202"-Mute
  String? volume, // "1"-"100", defaults to "1"
}) async {
  String path = '/api/v3/device/audition?voiceIndex=$voiceIndex';
  if (volume != null) {
    path += '&volume=$volume';
  }
  return _client.post(path, {'deviceSerial': deviceSerial});
}