Add lastHeartBeat for compatibility
MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -1207,8 +1207,9 @@ export default class ChargingStationService {
onlyRecordCount: filteredRequest.OnlyRecordCount
},
[
+ // TODO: To remove the 'lastHeartBeat' when new version of Mobile App will be released (> V1.3.22)
'id', 'inactive', 'connectorsStatus', 'connectorsConsumption', 'public', 'firmwareVersion', 'chargePointVendor', 'chargePointModel',
- 'ocppVersion', 'ocppProtocol', 'lastSeen', 'firmwareUpdateStatus', 'coordinates', 'issuer', 'voltage',
+ 'ocppVersion', 'ocppProtocol', 'lastSeen', 'lastHeartBeat', 'firmwareUpdateStatus', 'coordinates', 'issuer', 'voltage',
'siteAreaID', 'siteArea.id', 'siteArea.name', 'siteArea.siteID', 'siteArea.site.name',
'connectors.connectorId', 'connectors.status', 'connectors.type', 'connectors.power', 'connectors.errorCode',
'connectors.currentTotalConsumptionWh', 'connectors.currentInstantWatts', 'connectors.currentStateOfCharge',

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -330,6 +330,12 @@ export default class ChargingStationStorage {
asField: 'siteArea.site', oneToOneCardinality: true
});
}
+ // TODO: To remove the 'lastHeartBeat' when new version of Mobile App will be released (> V1.3.22)
+ aggregation.push({
+ '$addFields': {
+ 'lastHeartBeat': '$lastSeen'
+ }
+ });
// Change ID
DatabaseUtils.pushRenameDatabaseID(aggregation);
// Convert siteID back to string after having queried the site

Add lastHeartBeat for compatibility