xcDeviceSupportLanguage method

Future<List<String>> xcDeviceSupportLanguage({
  1. required String deviceId,
})

查询设备支持的语言列表 return eg:====> [ :nglish :impChinese :hineseEnglish :panish :

Implementation

Future<List<String>> xcDeviceSupportLanguage(
    {required String deviceId}) async {
  assert(deviceId.isNotEmpty);
  final OriginResponse result = await _api.devGetSysConfig(
      deviceId, 'MultiLanguage', 1360, 5000, ApiSeq.instance.getSeq());
  if (kDebugMode) {
    XCloudResponse.fromOriginResponse(result);
  }
  if (result.param1 < 0) {
    return Future.error(
        XCloudAPIException(code: result.param1, commandId: result.commandId));
  }

  if (result.byteStream == null) {
    return Future.value([]);
  }
  String byteString = XCloudResponse.byteToString(result.byteStream);

  MultiLanguage multiLanguage =
      MultiLanguage.fromJson(json.decode(byteString));
  return Future.value(multiLanguage.multiLanguage!);
}