Connected devices to widgets, and is currently making the necessary and correct api calls for everything to function properly.

This commit is contained in:
Faris Armoush
2025-05-14 15:35:22 +03:00
parent 7515b347ce
commit 0e61e52bf8
7 changed files with 66 additions and 23 deletions
@@ -20,6 +20,7 @@ abstract final class FetchOccupancyDataHelper {
}) {
if (communityId.isEmpty && spaceId.isEmpty) {
clearAllData(context);
return;
}
final datePickerState = context.read<AnalyticsDatePickerBloc>().state;
@@ -63,12 +64,17 @@ abstract final class FetchOccupancyDataHelper {
}) {
context.read<AnalyticsDevicesBloc>().add(
LoadAnalyticsDevicesEvent(
GetAnalyticsDevicesParam(
param: GetAnalyticsDevicesParam(
communityUuid: communityUuid,
spaceUuid: spaceUuid,
deviceTypes: ['WPS', 'CPS'],
requestType: AnalyticsDeviceRequestType.occupancy,
),
onSuccess: (device) {
context.read<RealtimeDeviceChangesBloc>()
..add(const RealtimeDeviceChangesClosed())
..add(RealtimeDeviceChangesStarted(device.uuid));
},
),
);
}