turn off some update data points

This commit is contained in:
faris Aljohari
2025-06-23 07:10:47 -06:00
parent d7eef5d03e
commit 04f64407e1

View File

@ -226,24 +226,24 @@ export class DeviceStatusFirebaseService {
});
await this.deviceStatusLogRepository.save(newLogs);
if (addDeviceStatusDto.productType === ProductType.PC) {
const energyCodes = new Set([
PowerClampEnergyEnum.ENERGY_CONSUMED,
PowerClampEnergyEnum.ENERGY_CONSUMED_A,
PowerClampEnergyEnum.ENERGY_CONSUMED_B,
PowerClampEnergyEnum.ENERGY_CONSUMED_C,
]);
// if (addDeviceStatusDto.productType === ProductType.PC) {
// const energyCodes = new Set([
// PowerClampEnergyEnum.ENERGY_CONSUMED,
// PowerClampEnergyEnum.ENERGY_CONSUMED_A,
// PowerClampEnergyEnum.ENERGY_CONSUMED_B,
// PowerClampEnergyEnum.ENERGY_CONSUMED_C,
// ]);
const energyStatus = addDeviceStatusDto?.log?.properties?.find((status) =>
energyCodes.has(status.code),
);
// const energyStatus = addDeviceStatusDto?.log?.properties?.find((status) =>
// energyCodes.has(status.code),
// );
if (energyStatus) {
await this.powerClampService.updateEnergyConsumedHistoricalData(
addDeviceStatusDto.deviceUuid,
);
}
}
// if (energyStatus) {
// await this.powerClampService.updateEnergyConsumedHistoricalData(
// addDeviceStatusDto.deviceUuid,
// );
// }
// }
// if (
// addDeviceStatusDto.productType === ProductType.CPS ||