kuzzleio / kuzzle-device-manager

IoT Devices & Assets Management providing digital twins, payload decoding, normalized measures, provisioning. Multi-Tenant ready for white labelled and B2B2C applications.
https://docs.kuzzle.io/official-plugins/device-manager/1
Apache License 2.0
14 stars 7 forks source link

feat: add actions to get last measures on digital twins #363

Closed Kuruyia closed 2 months ago

Kuruyia commented 2 months ago

What does this PR do ?

This adds the following actions to the device-manager:assets and device-manager/devices controllers:

Those new actions use the measures collection in order to extract those data.

This is in preparation for the removal of the measures and lastMeasuredAt 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

Kuruyia commented 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.