updated the component and device api's to have as be a parameter for the function

This commit is contained in:
csawatzky 2025-04-22 14:33:19 -06:00
parent c617ebf868
commit b62c7dbe5c
39 changed files with 346 additions and 651 deletions

View file

@ -90,7 +90,7 @@ export default function ObjectHeaterCharts(props: Props) {
const now = moment();
const theme = useTheme();
const [mutationData, setMutationData] = useState<MutationData[]>([]);
const [{ user }] = useGlobalState();
const [{ user, as }] = useGlobalState();
const themeType = useThemeType();
const classes = useStyles();
const [mutationsLoading, setMutationsLoading] = useState(false);
@ -165,7 +165,7 @@ export default function ObjectHeaterCharts(props: Props) {
setTempOnly(tempOnly);
setHeater(heater);
deviceAPI
.listJSONMeasurements(dev.id(), measurementsFor, start, end, 0, 0, "asc", "timestamp")
.listJSONMeasurements(dev.id(), measurementsFor, start, end, 0, 0, "asc", "timestamp", as)
.then(resp => {
resp.data.components.forEach(comp => {
if (comp.componentId === tempHum?.key()) {
@ -192,7 +192,7 @@ export default function ObjectHeaterCharts(props: Props) {
}
});
});
}, [device, deviceAPI, start, end]); //eslint-disable-line react-hooks/exhaustive-deps
}, [device, deviceAPI, start, end, as]); //eslint-disable-line react-hooks/exhaustive-deps
const updateDateRange = (newStartDate: any, newEndDate: any, live: boolean) => {
setStart(newStartDate);