Closed Kuruyia closed 2 months ago
Shouldn't we be able to request for the lastMeasuredAt for a particular data slot (measure name) ?
This is supposed to replace the lastMeasuredAt
that's in the asset/device documents, so I don't think this is the place to implement that.
Furthermore, you can get the lastMeasuredAt
of a specific measure using the already existing getMeasures
action.
What does this PR do ?
This adds the following actions to the
device-manager:assets
anddevice-manager/devices
controllers:getLastMeasuredAt
: returns the timestamp of the last measure of an asset/devicemGetLastMeasuredAt
: same as the previous action, for multiple assets/devicesgetLastMeasures
: returns the measures of an asset/device, in the same format as they are currently stored in the asset/device documentsmGetLastMeasures
: same as the previous action, for multiple assets/devicesThose new actions use the measures collection in order to extract those data.
This is in preparation for the removal of the
measures
andlastMeasuredAt
fields in the documents of the assets and devices collections.Other changes
A dedicated
DigitalTwinMeasures
type has been added to describe the contents of an object that contains the measures of an asset/device.Boyscout
Cleaned up and fixed some potentially flaky tests.
KZLPRD-438