PR improvments

This commit is contained in:
raf-dev1
2025-06-24 08:39:30 +03:00
parent 069a8e16db
commit 65b8ecf672
2 changed files with 1 additions and 103 deletions
@@ -253,15 +253,10 @@ class SmartDoorBloc extends Bloc<SmartDoorEvent, SmartDoorState> {
}
void _updateLock(UpdateLockEvent event, Emitter<SmartDoorState> emit) async {
// emit(LoadingNewSate(smartDoorModel: deviceStatus));
final oldValue = deviceStatus.normalOpenSwitch;
deviceStatus = deviceStatus.copyWith(normalOpenSwitch: !oldValue);
emit(UpdateState(smartDoorModel: deviceStatus));
try {
// final response = await DevicesAPI.controlDevice(
// DeviceControlModel(deviceId: deviceId, code: 'normal_open_switch', value: !event.value),
// deviceId);
final response = await DevicesAPI.openDoorLock(deviceId);
if (!response) {