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); await this.deviceStatusLogRepository.save(newLogs);
if (addDeviceStatusDto.productType === ProductType.PC) { // if (addDeviceStatusDto.productType === ProductType.PC) {
const energyCodes = new Set([ // const energyCodes = new Set([
PowerClampEnergyEnum.ENERGY_CONSUMED, // PowerClampEnergyEnum.ENERGY_CONSUMED,
PowerClampEnergyEnum.ENERGY_CONSUMED_A, // PowerClampEnergyEnum.ENERGY_CONSUMED_A,
PowerClampEnergyEnum.ENERGY_CONSUMED_B, // PowerClampEnergyEnum.ENERGY_CONSUMED_B,
PowerClampEnergyEnum.ENERGY_CONSUMED_C, // PowerClampEnergyEnum.ENERGY_CONSUMED_C,
]); // ]);
const energyStatus = addDeviceStatusDto?.log?.properties?.find((status) => // const energyStatus = addDeviceStatusDto?.log?.properties?.find((status) =>
energyCodes.has(status.code), // energyCodes.has(status.code),
); // );
if (energyStatus) { // if (energyStatus) {
await this.powerClampService.updateEnergyConsumedHistoricalData( // await this.powerClampService.updateEnergyConsumedHistoricalData(
addDeviceStatusDto.deviceUuid, // addDeviceStatusDto.deviceUuid,
); // );
} // }
} // }
// if ( // if (
// addDeviceStatusDto.productType === ProductType.CPS || // addDeviceStatusDto.productType === ProductType.CPS ||