mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 10:35:10 +00:00
fixes
This commit is contained in:
@ -381,14 +381,13 @@ class WaterHeaterBloc extends Bloc<WaterHeaterEvent, WaterHeaterState> {
|
|||||||
groupTwoGangList.map((device) => device.deviceId).toList();
|
groupTwoGangList.map((device) => device.deviceId).toList();
|
||||||
final response = await DevicesAPI.deviceController(
|
final response = await DevicesAPI.deviceController(
|
||||||
code: 'switch_1',
|
code: 'switch_1',
|
||||||
devicesUuid: allDeviceIds,
|
devicesUuid: [event.deviceId],
|
||||||
value: !event.value,
|
value: !event.value,
|
||||||
);
|
);
|
||||||
|
|
||||||
emit(UpdateGroupState(
|
emit(UpdateGroupState(
|
||||||
twoGangList: groupTwoGangList, allSwitches: allSwitchesValue));
|
twoGangList: groupTwoGangList, allSwitches: allSwitchesValue));
|
||||||
if (!response['success']) {
|
if (!response['success']) {
|
||||||
// add(InitialEvent(groupScreen: twoGangGroup));
|
add(InitialWizardEvent());
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// add(InitialEvent(groupScreen: twoGangGroup));
|
// add(InitialEvent(groupScreen: twoGangGroup));
|
||||||
@ -470,12 +469,12 @@ class WaterHeaterBloc extends Bloc<WaterHeaterEvent, WaterHeaterState> {
|
|||||||
// Check if either response is unsuccessful, then reset to initial state
|
// Check if either response is unsuccessful, then reset to initial state
|
||||||
if (!response1['success'] || !response2['success']) {
|
if (!response1['success'] || !response2['success']) {
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
// add(const InitialEvent(groupScreen: true));
|
add(InitialWizardEvent());
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// In case of an error, delay and reset the screen to initial state
|
// In case of an error, delay and reset the screen to initial state
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
// add(const InitialEvent(groupScreen: true));
|
add(InitialWizardEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,12 +511,12 @@ class WaterHeaterBloc extends Bloc<WaterHeaterEvent, WaterHeaterState> {
|
|||||||
// Check if either response is unsuccessful, then reset to initial state
|
// Check if either response is unsuccessful, then reset to initial state
|
||||||
if (!response1['success'] || !response2['success']) {
|
if (!response1['success'] || !response2['success']) {
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
// add(const InitialEvent(groupScreen: true));
|
add(InitialWizardEvent());
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// In case of an error, delay and reset the screen to initial state
|
// In case of an error, delay and reset the screen to initial state
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
// add(const InitialEvent(groupScreen: true));
|
add(InitialWizardEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user