xcDeviceSetLanguage method
设置设备语言 return 设置是否成功
Implementation
Future<bool> xcDeviceSetLanguage(
{required String deviceId, required String language}) async {
assert(deviceId.isNotEmpty);
const String commandName = 'SetLanguage';
final Map<String, dynamic> jsonMap = {
'Name': 'SetLanguage',
'SessionID': '0x00000002',
'SetLanguage': {'Language': language}
};
final String commandJs = json.encode(jsonMap);
final result = await _api.devSetSysConfig(deviceId, commandName, commandJs,
commandJs.length + 1, 1660, 15000, ApiSeq.instance.getSeq());
if (kDebugMode) {
XCloudResponse.fromOriginResponse(result);
}
if (result.param1 < 0) {
return Future.error(
XCloudAPIException(code: result.param1, commandId: result.commandId));
}
return Future.value(true);
}