mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 10:06:19 +00:00
@ -16,12 +16,10 @@ class GateWayBloc extends Bloc<GateWayEvent, GateWayState> {
|
||||
on<GateWayFactoryReset>(_onFactoryReset);
|
||||
}
|
||||
|
||||
FutureOr<void> _getGatWayById(
|
||||
GatWayById event, Emitter<GateWayState> emit) async {
|
||||
FutureOr<void> _getGatWayById(GatWayById event, Emitter<GateWayState> emit) async {
|
||||
emit(GatewayLoadingState());
|
||||
try {
|
||||
final devicesList =
|
||||
await DevicesManagementApi.getDevicesByGatewayId(event.getWayId);
|
||||
List<DeviceModel> devicesList = await DevicesManagementApi.getDevicesByGatewayId(event.getWayId);
|
||||
|
||||
emit(UpdateGatewayState(list: devicesList));
|
||||
} catch (e) {
|
||||
@ -30,8 +28,7 @@ class GateWayBloc extends Bloc<GateWayEvent, GateWayState> {
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _onFactoryReset(
|
||||
GateWayFactoryReset event, Emitter<GateWayState> emit) async {
|
||||
FutureOr<void> _onFactoryReset(GateWayFactoryReset event, Emitter<GateWayState> emit) async {
|
||||
emit(GatewayLoadingState());
|
||||
try {
|
||||
final response = await DevicesManagementApi().factoryReset(
|
||||
|
Reference in New Issue
Block a user