correctly fetch energy management data using spaceUuid.

This commit is contained in:
Faris Armoush
2025-06-04 15:09:40 +03:00
parent ad8e06ac40
commit 0c6e4fed80
3 changed files with 3 additions and 26 deletions
@@ -10,7 +10,7 @@ class GetEnergyConsumptionPerDeviceParam {
Map<String, dynamic> toJson() => {
'monthDate':
'${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}',
if (spaceId == null || spaceId == null) 'spaceUuid': spaceId,
if (spaceId != null) 'spaceUuid': spaceId,
'groupByDevice': true,
};
}
@@ -11,7 +11,7 @@ class GetTotalEnergyConsumptionParam {
return {
'monthDate':
'${monthDate?.year}-${monthDate?.month.toString().padLeft(2, '0')}',
if (spaceId == null || spaceId == null) 'spaceUuid': spaceId,
if (spaceId != null) 'spaceUuid': spaceId,
'groupByDevice': false,
};
}