mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 21:37:55 +00:00
PR improvments
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user