mirror of
https://github.com/bendtherules/mispair-demo.git
synced 2026-08-18 13:22:17 +00:00
11 lines
324 B
JavaScript
11 lines
324 B
JavaScript
async function fetchTemperature(zoneId) {
|
|
const res = await fetch(`/api/v1/zones/${zoneId}/primary/temperature`);
|
|
return res.json();
|
|
}
|
|
|
|
// Don't change this function signature
|
|
export async function attachChart(chartInstance, zoneId) {
|
|
const temp = await fetchTemperature(zoneId);
|
|
chartInstance.update(temp.value);
|
|
}
|