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(()=>{
|
useEffect(()=>{
|
||||||
//get the measurements for the temp component
|
//get the measurements for the temp component
|
||||||
componentAPI.listUnitMeasurements(
|
componentAPI.sampleUnitMeasurements(
|
||||||
deviceID,
|
deviceID,
|
||||||
tempComponent.key(),
|
tempComponent.key(),
|
||||||
start.toISOString(),
|
start.toISOString(),
|
||||||
end.toISOString(),
|
end.toISOString(),
|
||||||
500,
|
500
|
||||||
0,
|
|
||||||
"timestamp",
|
|
||||||
).then(resp => {
|
).then(resp => {
|
||||||
|
console.log(resp)
|
||||||
if(resp.data.measurements){
|
if(resp.data.measurements){
|
||||||
let tempCompMeasurements = resp.data.measurements.map(um => UnitMeasurement.any(um, user));
|
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 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){
|
if(ambient){
|
||||||
//need to then load the measurements for the ambient component
|
//need to then load the measurements for the ambient component
|
||||||
componentAPI.listUnitMeasurements(
|
componentAPI.sampleUnitMeasurements(
|
||||||
deviceID,
|
deviceID,
|
||||||
ambient.key(),
|
ambient.key(),
|
||||||
start.toISOString(),
|
start.toISOString(),
|
||||||
end.toISOString(),
|
end.toISOString(),
|
||||||
500,
|
500
|
||||||
0,
|
|
||||||
"timestamp",
|
|
||||||
).then(resp => {
|
).then(resp => {
|
||||||
let ambientMeasurements = resp.data.measurements.map(um => UnitMeasurement.any(um, user));
|
let ambientMeasurements = resp.data.measurements.map(um => UnitMeasurement.any(um, user));
|
||||||
//now loop through each of them to 'combine' them into a single array
|
//now loop through each of them to 'combine' them into a single array
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue