import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=3";
export async function airquality(interval: Interval) {
const location = "brooklyn navy yard";
const data = await easyAQI({ location });
if (!interval.lastRunAt) {
console.email(
`You will now get Air Quality alerts for ${location} if it's unhealthy. It is now ${data.aqi} which is ${data.severity}.`,
`AQI Alerts for ${location} setup!`,
);
}
if (data.severity.includes("Unhealthy")) {
console.email(
"Air Quality: " + data.severity,
`AQI in ${location} is ${data.aqi}`,
);
}
}