hotfix for the delta temp to switch over from listing to sampling the measurements

This commit is contained in:
csawatzky 2026-03-04 13:26:52 -06:00
parent 1e34530ef3
commit d03b4c6158

View file

@ -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