mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
tern off data procedure
This commit is contained in:
@ -245,30 +245,30 @@ export class DeviceStatusFirebaseService {
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
addDeviceStatusDto.productType === ProductType.CPS ||
|
||||
addDeviceStatusDto.productType === ProductType.WPS
|
||||
) {
|
||||
const occupancyCodes = new Set([PresenceSensorEnum.PRESENCE_STATE]);
|
||||
// if (
|
||||
// addDeviceStatusDto.productType === ProductType.CPS ||
|
||||
// addDeviceStatusDto.productType === ProductType.WPS
|
||||
// ) {
|
||||
// const occupancyCodes = new Set([PresenceSensorEnum.PRESENCE_STATE]);
|
||||
|
||||
const occupancyStatus = addDeviceStatusDto?.log?.properties?.find(
|
||||
(status) => occupancyCodes.has(status.code),
|
||||
);
|
||||
// const occupancyStatus = addDeviceStatusDto?.log?.properties?.find(
|
||||
// (status) => occupancyCodes.has(status.code),
|
||||
// );
|
||||
|
||||
if (occupancyStatus) {
|
||||
await this.occupancyService.updateOccupancySensorHistoricalData(
|
||||
addDeviceStatusDto.deviceUuid,
|
||||
);
|
||||
await this.occupancyService.updateOccupancySensorHistoricalDurationData(
|
||||
addDeviceStatusDto.deviceUuid,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (addDeviceStatusDto.productType === ProductType.AQI) {
|
||||
await this.aqiDataService.updateAQISensorHistoricalData(
|
||||
addDeviceStatusDto.deviceUuid,
|
||||
);
|
||||
}
|
||||
// if (occupancyStatus) {
|
||||
// await this.occupancyService.updateOccupancySensorHistoricalData(
|
||||
// addDeviceStatusDto.deviceUuid,
|
||||
// );
|
||||
// await this.occupancyService.updateOccupancySensorHistoricalDurationData(
|
||||
// addDeviceStatusDto.deviceUuid,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// if (addDeviceStatusDto.productType === ProductType.AQI) {
|
||||
// await this.aqiDataService.updateAQISensorHistoricalData(
|
||||
// addDeviceStatusDto.deviceUuid,
|
||||
// );
|
||||
// }
|
||||
// Return the updated data
|
||||
const snapshot: DataSnapshot = await get(dataRef);
|
||||
return snapshot.val();
|
||||
|
Reference in New Issue
Block a user