useSensorManager
This hooks combines the useSubscribeById
to get live data, and the getDeviceHistory
to get historical data. The data from both sources is merged into one array.
Parameters
id
: theacp_id
of the device to subscribe tostart
: the start time of the history to getend
: the end time of the history to get
Returns
The hook returns the following:
data
: the history of the device + the live dataloading
: whether the request is loadingerror
: any error that occurredconnectionStatus
: WS connection statusmessageHistory
: live data only