新增设置猫眼工作模式接口

新增设置自动亮屏接口及逻辑
新增设置亮屏持续时间接口及逻辑
新增逗留警告接口及逻辑处理
新增设置异常警告接口及逻辑处理
This commit is contained in:
Daisy 2024-03-27 17:40:31 +08:00
parent 1ffe7d228e
commit 611ff5ee08
11 changed files with 425 additions and 162 deletions

View File

@ -26,16 +26,16 @@ class XSConstantMacro {
// "110412"
// "110408"
// "110410"
static int keyStatusNormalUse = 110401; // 使
static int keyStatusWaitReceive = 110402; //
static int keyStatusNormalUse = 110401; // 使
static int keyStatusWaitReceive = 110402; //
static int keyStatusWaitIneffective = 110403; //
static int keyStatusFrozen = 110405; //
static int keyStatusExpired = 110412; //
static int keyStatusDeleted = 110408; //
static int keyStatusReset = 110410; //
static int keyStatusFrozen = 110405; //
static int keyStatusExpired = 110412; //
static int keyStatusDeleted = 110408; //
static int keyStatusReset = 110410; //
static String getKeyStatusStr(int keyStatus){
switch(keyStatus){
static String getKeyStatusStr(int keyStatus) {
switch (keyStatus) {
case 110401:
return "正常使用";
case 110402:
@ -54,10 +54,17 @@ class XSConstantMacro {
return "未知";
}
}
// lockEventType 0-10-20-30-40-
static int lockEventTypeAll = 0;
static int lockEventTypeOpenDoor = 10;
static int lockEventTypeAbnormal = 20;
static int lockEventTypeDoorbell = 30;
static int lockEventTypeVideo = 40;
//
static int catEyeWorkModePowerSaving = 1; //
static int catEyeWorkModeStayCapture = 2; //
static int catEyeWorkModeRealTimeMonitoring = 3; //
static int catEyeWorkModeCustom = 4; //
}

View File

@ -1,7 +1,53 @@
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'catEyeSet_state.dart';
class CatEyeSetLogic extends BaseGetXController {
final CatEyeSetState state = CatEyeSetState();
//
void updateAutoLightScreenConfig() async {
var entity = await ApiRepository.to.updateAutoLightScreenConfig(
lockId: state.lockSetInfoData.value.lockId!,
autoLightScreen: state.isAutoBright.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateLightScreenTimeConfig() async {
var entity = await ApiRepository.to.updateLightScreenTimeConfig(
lockId: state.lockSetInfoData.value.lockId!,
autoLightScreenTime:
int.parse(state.selectBrightDuration.value.replaceAll('', '')),
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateStayWarnConfig() async {
var entity = await ApiRepository.to.updateStayWarnConfig(
lockId: state.lockSetInfoData.value.lockId!,
stayWarn: state.isStayWarning.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateAbnormalWarnConfig() async {
var entity = await ApiRepository.to.updateAbnormalWarnConfig(
lockId: state.lockSetInfoData.value.lockId!,
abnormalWarn: state.isExceptionWarning.value == true ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
}

View File

@ -33,12 +33,18 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
children: [
CommonItem(
leftTitel: '猫眼工作模式',
rightTitle: "",
rightTitle: state.selectCatEyeWorkMode.value,
allHeight: 70.h,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.catEyeWorkModePage);
Get.toNamed(Routers.catEyeWorkModePage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
})?.then((value) {
if (value != null) {
state.selectCatEyeWorkMode.value = value;
}
});
}),
Obx(() => CommonItem(
leftTitel: '自动亮屏',
@ -94,15 +100,26 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
onChanged: (value) {
switch (clickIndex) {
case 1: //
state.isAutoBright.value = value;
{
state.isAutoBright.value = value;
logic.updateAutoLightScreenConfig();
}
break;
case 2: //
state.isStayWarning.value = value;
{
state.isStayWarning.value = value;
logic.updateStayWarnConfig();
}
break;
case 3: //
state.isExceptionWarning.value = value;
{
state.isExceptionWarning.value = value;
logic.updateAbnormalWarnConfig();
}
break;
default:
print('clickIndex is not match');
break;
}
},
);
@ -120,6 +137,7 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
chooseCallback: (value) {
state.selectBrightDuration.value =
state.brightDurationTimeList[value];
logic.updateLightScreenTimeConfig();
},
);
});

View File

@ -1,4 +1,5 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class CatEyeSetState {
var brightDurationTimeList = ['10秒', '15秒', '20秒'].obs;
@ -6,4 +7,11 @@ class CatEyeSetState {
var isAutoBright = false.obs; //
var isStayWarning = false.obs; //
var isExceptionWarning = false.obs; //
var lockSetInfoData = LockSetInfoData().obs;
var selectCatEyeWorkMode = ''.obs; //
CatEyeSetState() {
Map map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"];
}
}

View File

@ -0,0 +1,27 @@
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class CatEyeWorkModeLogic extends BaseGetXController {
final CatEyeWorkModeState state = CatEyeWorkModeState();
//
void updateCatEyeModeConfig() async {
var entity = await ApiRepository.to.updateCatEyeModeConfig(
lockId: state.lockSetInfoData.value.lockId!,
catEyeConfig: {
'catEyeMode': state.selectCatEyeWorkMode.value,
'catEyeModeConfig': {
'recordMode': state.recordMode.value,
'recordStartTime': state.recordStartTime.value,
'recordEndTime': state.recordEndTime.value,
'detectionDistance': state.detectionDistance.value,
'realTimeMode': state.realTimeMode.value,
}
},
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
}

View File

@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
@ -14,8 +16,8 @@ class CatEyeWorkModePage extends StatefulWidget {
}
class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
bool isCheck = false;
List boolList = [true, false, false, false];
final logic = Get.put(CatEyeWorkModeLogic());
final state = Get.find<CatEyeWorkModeLogic>().state;
@override
Widget build(BuildContext context) {
@ -30,44 +32,34 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
SizedBox(
height: 30.h,
),
_buildTipsView(
'省电模式:\n',
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下满电可使用7-8个月',
0,
boolList[0]),
_buildTipsView('省电模式:\n',
'适合门口较为安全的环境。\n仅发生特定事件才录像,并可查看实时画面。\n一般情况下满电可使用7-8个月', 0),
SizedBox(
height: 30.h,
),
_buildTipsView('逗留抓拍模式:\n',
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下满电可使用5~6个月。', 1),
SizedBox(
height: 30.h,
),
_buildTipsView('实时监控模式:\n',
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下满电可使用2~4个月。', 2),
SizedBox(
height: 30.h,
),
_buildTipsView(
'逗留抓拍模式:\n',
'有人逗留或发生特定事件才录像,可随时查看\n实时画面。\n一般情况下满电可使用5~6个月。',
1,
boolList[1]),
SizedBox(
height: 30.h,
),
_buildTipsView(
'实时监控模式:\n',
'适合门口人员复杂、较不安全的环境。\n有人出现就录像,可随时查看实时画面。\n一般情况下满电可使用2~4个月。',
2,
boolList[2]),
SizedBox(
height: 30.h,
),
_buildTipsView('自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。',
3, boolList[3])
'自定义模式:\n', '根据您家门口实际情况设置录像和实时画面功能。\n可使用时长由具体设置决定。', 3)
],
));
}
Widget _buildTipsView(
String titleStr, String subTitle, int clickIndex, bool isClick) {
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
return GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: isClick
color: state.boolList.value[clickIndex]
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor,
borderRadius: BorderRadius.circular(10.0),
@ -77,7 +69,7 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
isClick
state.boolList.value[clickIndex]
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
@ -89,7 +81,8 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(titleStr, subTitle, isClick),
child: _buildRichText(
titleStr, subTitle, state.boolList.value[clickIndex]),
),
SizedBox(
width: 10.w,
@ -128,11 +121,30 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
),
onTap: () {
setState(() {
for (int i = 0; i < boolList.length; i++) {
for (int i = 0; i < state.boolList.value.length; i++) {
if (clickIndex == i) {
boolList[clickIndex] = true;
state.boolList.value[clickIndex] = true;
switch (clickIndex) {
case 0:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModePowerSaving;
break;
case 1:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeStayCapture;
break;
case 2:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeRealTimeMonitoring;
break;
case 3:
state.selectCatEyeWorkMode.value =
XSConstantMacro.catEyeWorkModeCustom;
break;
}
logic.updateCatEyeModeConfig();
} else {
boolList[i] = false;
state.boolList.value[i] = false;
}
}
});

View File

@ -0,0 +1,20 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class CatEyeWorkModeState {
var lockSetInfoData = LockSetInfoData().obs;
var selectCatEyeWorkMode = 0.obs; //
var boolList = [true, false, false, false].obs;
var recordMode = 0.obs; // 0 1
//recordStartTime与recordEndTime参数
var recordStartTime = 0.obs; // 1709715049775,
var recordEndTime = 0.obs; //1709715049775,
var recordTime = 0.obs; //
var detectionDistance = 0.obs; //
var realTimeMode = 0.obs; // 0 1
CatEyeWorkModeState() {
Map map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"];
}
}

View File

@ -299,7 +299,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
//
Obx(() => Visibility(
visible: state.lockFeature.value.passageMode == 1 ? true : false,
// visible: true,
// visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
@ -380,7 +380,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.catEyeSetPage);
Get.toNamed(Routers.catEyeSetPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
})),
// Obx(() =>
//

View File

@ -176,4 +176,7 @@ abstract class Api {
final String deletMessageURL = '/notifications/delete'; //
final String getVersionURL = '/app/getVersion'; //
final String updateCatEyeConfigURL =
'/lockSetting/updateCatEyeConfig'; //
}

View File

@ -220,22 +220,20 @@ class ApiProvider extends BaseProvider {
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
Future<Response> lockRecordList(
{
required String endDate,
required String keyId,
required String keyStatus,
required String lockId,
required String operatorUid,
required String pageNo,
required String pageSize,
required String startDate,
required String recordType,
required String searchStr,
required String timezoneRawOffSet,
required String keyboardPwdId,
required String cardId,
required String fingerprintId
}) =>
{required String endDate,
required String keyId,
required String keyStatus,
required String lockId,
required String operatorUid,
required String pageNo,
required String pageSize,
required String startDate,
required String recordType,
required String searchStr,
required String timezoneRawOffSet,
required String keyboardPwdId,
required String cardId,
required String fingerprintId}) =>
post(
keyOperationRecordURL.toUrl,
jsonEncode({
@ -358,9 +356,15 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> deletOwnerKeyInfo(String lockId, String keyId, int includeUnderlings) => post(
deleteElectronicKeyURL.toUrl,
jsonEncode({'lockId': lockId, 'keyId': keyId, 'includeUnderlings': includeUnderlings}));
Future<Response> deletOwnerKeyInfo(
String lockId, String keyId, int includeUnderlings) =>
post(
deleteElectronicKeyURL.toUrl,
jsonEncode({
'lockId': lockId,
'keyId': keyId,
'includeUnderlings': includeUnderlings
}));
//
Future<Response> checkLoginPassword(String password) => post(
@ -527,13 +531,12 @@ class ApiProvider extends BaseProvider {
'remoteEnable': remoteEnable
}));
Future<Response> expireLockList(String pageNo, String pageSize) =>
post(
expireLockListURL.toUrl,
jsonEncode({
'pageNo': pageNo,
'pageSize': pageSize,
}));
Future<Response> expireLockList(String pageNo, String pageSize) => post(
expireLockListURL.toUrl,
jsonEncode({
'pageNo': pageNo,
'pageSize': pageSize,
}));
Future<Response> deleteKeyboardPwd(
String lockId, String keyboardPwdId, int deleteType) =>
@ -971,9 +974,9 @@ class ApiProvider extends BaseProvider {
String isCoerced,
String startDate,
List weekDay,
int fingerRight,
int startTime,
int endTime,
int fingerRight,
int startTime,
int endTime,
) =>
post(
addFingerprintURL.toUrl,
@ -1002,9 +1005,9 @@ class ApiProvider extends BaseProvider {
String isCoerced,
String fingerprintName,
String changeType,
int startTime,
int endTime,
int fingerprintType) =>
int startTime,
int endTime,
int fingerprintType) =>
post(
editFingerprintURL.toUrl,
jsonEncode({
@ -1164,9 +1167,9 @@ class ApiProvider extends BaseProvider {
String startDate,
String isCoerced,
List weekDay,
int startTime,
int endTime,
int cardRight,
int startTime,
int endTime,
int cardRight,
) =>
post(
addICCardURL.toUrl,
@ -1187,17 +1190,18 @@ class ApiProvider extends BaseProvider {
// ICCard
Future<Response> editICCardData(
String lockId,
String cardId,
String cardName,
String startDate,
String endDate,
String isCoerced,
List weekDay,
String changeType,
int startTime,
int endTime,
int cardType,) =>
String lockId,
String cardId,
String cardName,
String startDate,
String endDate,
String isCoerced,
List weekDay,
String changeType,
int startTime,
int endTime,
int cardType,
) =>
post(
editICCardURL.toUrl,
jsonEncode({
@ -1568,12 +1572,58 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> getVersionData(String brandName, String currentVersion) => post(
getVersionURL.toUrl,
Future<Response> getVersionData(String brandName, String currentVersion) =>
post(
getVersionURL.toUrl,
jsonEncode({
'brandName': brandName,
'currentVersion': currentVersion,
}));
//
Future<Response> updateCatEyeModeConfig(int lockId, Map catEyeConfig) => post(
updateCatEyeConfigURL.toUrl,
jsonEncode({
'brandName': brandName,
'currentVersion': currentVersion,
'lockId': lockId,
'catEyeConfig': catEyeConfig,
}));
//
Future<Response> updateAutoLightScreenConfig(
int lockId, int autoLightScreen) =>
post(
updateCatEyeConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'autoLightScreen': autoLightScreen,
}));
//
Future<Response> updateLightScreenTimeConfig(
int lockId, int autoLightScreenTime) =>
post(
updateCatEyeConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'autoLightScreenTime': autoLightScreenTime,
}));
//
Future<Response> updateStayWarnConfig(int lockId, int stayWarn) => post(
updateCatEyeConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'stayWarn': stayWarn,
}));
//
Future<Response> updateAbnormalWarnConfig(int lockId, int abnormalWarn) =>
post(
updateCatEyeConfigURL.toUrl,
jsonEncode({
'lockId': lockId,
'abnormalWarn': abnormalWarn,
}));
}
extension ExtensionString on String {

View File

@ -191,37 +191,35 @@ class ApiRepository {
//-
Future<KeyOperationRecordEntity> lockRecordList(
{
required String endDate,
required String keyId,
required String keyStatus,
required String lockId,
required String operatorUid,
required String pageNo,
required String pageSize,
required String startDate,
required String recordType,
required String searchStr,
required String timezoneRawOffSet,
required String keyboardPwdId,
required String cardId,
required String fingerprintId
}) async {
{required String endDate,
required String keyId,
required String keyStatus,
required String lockId,
required String operatorUid,
required String pageNo,
required String pageSize,
required String startDate,
required String recordType,
required String searchStr,
required String timezoneRawOffSet,
required String keyboardPwdId,
required String cardId,
required String fingerprintId}) async {
final res = await apiProvider.lockRecordList(
endDate:endDate,
keyId:keyId,
keyStatus:keyStatus,
lockId:lockId,
operatorUid:operatorUid,
pageNo:pageNo,
pageSize:pageSize,
startDate:startDate,
recordType:recordType,
searchStr:searchStr,
timezoneRawOffSet:timezoneRawOffSet,
keyboardPwdId:keyboardPwdId,
cardId:cardId,
fingerprintId:fingerprintId);
endDate: endDate,
keyId: keyId,
keyStatus: keyStatus,
lockId: lockId,
operatorUid: operatorUid,
pageNo: pageNo,
pageSize: pageSize,
startDate: startDate,
recordType: recordType,
searchStr: searchStr,
timezoneRawOffSet: timezoneRawOffSet,
keyboardPwdId: keyboardPwdId,
cardId: cardId,
fingerprintId: fingerprintId);
return KeyOperationRecordEntity.fromJson(res.body);
}
@ -384,8 +382,11 @@ class ApiRepository {
//
Future<LockListInfoEntity> deletOwnerKeyData(
{required String lockId, required String keyId, required int includeUnderlings}) async {
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId, includeUnderlings);
{required String lockId,
required String keyId,
required int includeUnderlings}) async {
final res =
await apiProvider.deletOwnerKeyInfo(lockId, keyId, includeUnderlings);
return LockListInfoEntity.fromJson(res.body);
}
@ -545,7 +546,8 @@ class ApiRepository {
}
//
Future<ExpireLockListEntity> expireLockList(String pageNo, String pageSize) async {
Future<ExpireLockListEntity> expireLockList(
String pageNo, String pageSize) async {
final res = await apiProvider.expireLockList(pageNo, pageSize);
return ExpireLockListEntity.fromJson(res.body);
}
@ -1148,18 +1150,28 @@ class ApiRepository {
//
Future<LoginEntity> editFingerprintsData(
{required String fingerprintId,
required String lockId,
required List weekDay,
required String startDate,
required String endDate,
required String isCoerced,
required String fingerprintName,
required String changeType,
required int startTime,
required int endTime,
required int fingerprintType}) async {
final res = await apiProvider.editFingerprintsData(fingerprintId, lockId,
weekDay, startDate, endDate, isCoerced, fingerprintName, changeType, startTime, endTime, fingerprintType);
required String lockId,
required List weekDay,
required String startDate,
required String endDate,
required String isCoerced,
required String fingerprintName,
required String changeType,
required int startTime,
required int endTime,
required int fingerprintType}) async {
final res = await apiProvider.editFingerprintsData(
fingerprintId,
lockId,
weekDay,
startDate,
endDate,
isCoerced,
fingerprintName,
changeType,
startTime,
endTime,
fingerprintType);
return LoginEntity.fromJson(res.body);
}
@ -1316,26 +1328,48 @@ class ApiRepository {
required int endTime,
required int cardRight,
}) async {
final res = await apiProvider.addICCardData(lockId, endDate, cardName,
cardNumber, cardType, addType, startDate, isCoerced, weekDay, startTime, endTime, cardRight);
final res = await apiProvider.addICCardData(
lockId,
endDate,
cardName,
cardNumber,
cardType,
addType,
startDate,
isCoerced,
weekDay,
startTime,
endTime,
cardRight);
return AddICCardEntity.fromJson(res.body);
}
// IC卡
Future<LoginEntity> editICCardData(
{required String lockId,
required String cardId,
required String cardName,
required String startDate,
required String endDate,
required String isCoerced,
required List weekDay,
required String changeType,
required int startTime,
required int endTime,
required int cardType,}) async {
final res = await apiProvider.editICCardData(lockId, cardId, cardName,
startDate, endDate, isCoerced, weekDay, changeType, startTime, endTime, cardType);
Future<LoginEntity> editICCardData({
required String lockId,
required String cardId,
required String cardName,
required String startDate,
required String endDate,
required String isCoerced,
required List weekDay,
required String changeType,
required int startTime,
required int endTime,
required int cardType,
}) async {
final res = await apiProvider.editICCardData(
lockId,
cardId,
cardName,
startDate,
endDate,
isCoerced,
weekDay,
changeType,
startTime,
endTime,
cardType);
return LoginEntity.fromJson(res.body);
}
@ -1586,11 +1620,47 @@ class ApiRepository {
}
//
Future<VersionUndateEntity> getVersionData({
required String brandName,
required String currentVersion
}) async {
Future<VersionUndateEntity> getVersionData(
{required String brandName, required String currentVersion}) async {
final res = await apiProvider.getVersionData(brandName, currentVersion);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateCatEyeModeConfig(
{required int lockId, required Map catEyeConfig}) async {
final res = await apiProvider.updateCatEyeModeConfig(lockId, catEyeConfig);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateAutoLightScreenConfig(
{required int lockId, required int autoLightScreen}) async {
final res =
await apiProvider.updateAutoLightScreenConfig(lockId, autoLightScreen);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateLightScreenTimeConfig(
{required int lockId, required int autoLightScreenTime}) async {
final res = await apiProvider.updateLightScreenTimeConfig(
lockId, autoLightScreenTime);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateStayWarnConfig(
{required int lockId, required int stayWarn}) async {
final res = await apiProvider.updateStayWarnConfig(lockId, stayWarn);
return VersionUndateEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> updateAbnormalWarnConfig(
{required int lockId, required int abnormalWarn}) async {
final res =
await apiProvider.updateAbnormalWarnConfig(lockId, abnormalWarn);
return VersionUndateEntity.fromJson(res.body);
}
}