From 781522d4b606288ab351d1e1918d16c3f15efb51 Mon Sep 17 00:00:00 2001 From: mohammad Date: Thu, 26 Sep 2024 16:36:23 +0300 Subject: [PATCH] fixes --- .../bloc/water_heater_bloc/water_heater_bloc.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart b/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart index e1c55ca..1d4c80c 100644 --- a/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart +++ b/lib/features/devices/bloc/water_heater_bloc/water_heater_bloc.dart @@ -381,14 +381,13 @@ class WaterHeaterBloc extends Bloc { groupTwoGangList.map((device) => device.deviceId).toList(); final response = await DevicesAPI.deviceController( code: 'switch_1', - devicesUuid: allDeviceIds, + devicesUuid: [event.deviceId], value: !event.value, ); - emit(UpdateGroupState( twoGangList: groupTwoGangList, allSwitches: allSwitchesValue)); if (!response['success']) { - // add(InitialEvent(groupScreen: twoGangGroup)); + add(InitialWizardEvent()); } } catch (_) { // add(InitialEvent(groupScreen: twoGangGroup)); @@ -470,12 +469,12 @@ class WaterHeaterBloc extends Bloc { // Check if either response is unsuccessful, then reset to initial state if (!response1['success'] || !response2['success']) { await Future.delayed(const Duration(milliseconds: 500)); - // add(const InitialEvent(groupScreen: true)); + add(InitialWizardEvent()); } } catch (_) { // In case of an error, delay and reset the screen to initial state await Future.delayed(const Duration(milliseconds: 500)); - // add(const InitialEvent(groupScreen: true)); + add(InitialWizardEvent()); } } @@ -512,12 +511,12 @@ class WaterHeaterBloc extends Bloc { // Check if either response is unsuccessful, then reset to initial state if (!response1['success'] || !response2['success']) { await Future.delayed(const Duration(milliseconds: 500)); - // add(const InitialEvent(groupScreen: true)); + add(InitialWizardEvent()); } } catch (_) { // In case of an error, delay and reset the screen to initial state await Future.delayed(const Duration(milliseconds: 500)); - // add(const InitialEvent(groupScreen: true)); + add(InitialWizardEvent()); } } }