mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 18:04:54 +00:00
finished added battery to water leak
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user