hotfix for the delta temp to switch over from listing to sampling the measurements
This commit is contained in:
parent
1e34530ef3
commit
d03b4c6158
1 changed files with 5 additions and 8 deletions
|
|
@ -104,28 +104,25 @@ export default function GateDeltaTempGraph(props: Props){
|
|||
*/
|
||||
useEffect(()=>{
|
||||
//get the measurements for the temp component
|
||||
componentAPI.listUnitMeasurements(
|
||||
componentAPI.sampleUnitMeasurements(
|
||||
deviceID,
|
||||
tempComponent.key(),
|
||||
start.toISOString(),
|
||||
end.toISOString(),
|
||||
500,
|
||||
0,
|
||||
"timestamp",
|
||||
500
|
||||
).then(resp => {
|
||||
console.log(resp)
|
||||
if(resp.data.measurements){
|
||||
let tempCompMeasurements = resp.data.measurements.map(um => UnitMeasurement.any(um, user));
|
||||
//if there is an ambient component, then treat the temp component like a single sensor and not a chain, and use the ambient measurements as the inlet
|
||||
if(ambient){
|
||||
//need to then load the measurements for the ambient component
|
||||
componentAPI.listUnitMeasurements(
|
||||
componentAPI.sampleUnitMeasurements(
|
||||
deviceID,
|
||||
ambient.key(),
|
||||
start.toISOString(),
|
||||
end.toISOString(),
|
||||
500,
|
||||
0,
|
||||
"timestamp",
|
||||
500
|
||||
).then(resp => {
|
||||
let ambientMeasurements = resp.data.measurements.map(um => UnitMeasurement.any(um, user));
|
||||
//now loop through each of them to 'combine' them into a single array
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue