finished added battery to water leak

This commit is contained in:
faris Aljohari
2024-10-04 14:10:43 -05:00
parent a311286430
commit 4c0bbd2849
2 changed files with 14 additions and 0 deletions

View File

@ -839,6 +839,19 @@ export class DeviceService {
battery = batteryStatus.value;
}
}
// Check if the device is a water leak sensor (WL)
if (device.productDevice.prodType === ProductType.WL) {
const doorSensorInstructionsStatus =
await this.getDevicesInstructionStatus(device.uuid);
const batteryStatus: any = doorSensorInstructionsStatus.status.find(
(status: any) => status.code === 'battery_percentage',
);
if (batteryStatus) {
battery = batteryStatus.value;
}
}
const spaceDevice = device?.spaceDevice;
const parentDevice = spaceDevice?.parent;
return {