resetFaultsApi function

Future<void> resetFaultsApi({
  1. required BuildContext context,
  2. required int id,
})

Reset (i.e. clear) the faults (i.e. shutdown alerts) on the generator with the given id, using the underlying backend API calls

Implementation

Future<void> resetFaultsApi({
  required BuildContext context,
  required int id,
}) async {
  final container = ProviderScope.containerOf(context, listen: false);

  final api = await container.read(energyManagementV3ApiProvider.future);
  final response = await api.kemApiV3DevicesIdAlertsResetPost(id: id);

  assertSuccessfulResponse(response);
}