xcCancelAllAlarmSubscribe method
取消所有报警订阅
deviceList 设备id数组
Implementation
xcCancelAllAlarmSubscribe({required List<String> deviceList}) async {
List snlist = deviceList.map((e) => {'sn': e}).toList();
Map<String, dynamic> requestMap = {
'msg': 'alarm_unsubscribe',
'snlist': snlist,
'all': '1'
};
String requestJs = json.encode(requestMap);
final originResponse = await _api.unsubscribeDevicesAlarmMessages(
requestJs, ApiSeq.instance.getSeq());
XCloudResponse response = XCloudResponse.fromOriginResponse(originResponse);
if (response.code < 0) {
return Future.error(XCloudAPIException(
code: response.code, commandId: originResponse.commandId));
}
return Future.value(response.code);
}