Update to no longer use data store for this
This commit is contained in:
parent
3a31fd1762
commit
5bd17e1e32
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "temperato",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"module": "src/index.ts",
|
||||
|
10
src/index.ts
10
src/index.ts
@ -37,13 +37,7 @@ let numberOfEarlyTicks = 0;
|
||||
|
||||
async function temperatoTick() {
|
||||
try {
|
||||
const response = await fetch(ENDPOINT, {
|
||||
headers: {
|
||||
'authorization': process.env.AUTH,
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const response = await fetch(ENDPOINT);
|
||||
const data: any = await response.json();
|
||||
|
||||
if (data.temperature < SET_POINT && data.temperature >= EARLY_WARNING) {
|
||||
@ -83,4 +77,4 @@ async function temperatoTick() {
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(() => temperatoTick(), SLEEP_TIMER);
|
||||
setInterval(() => temperatoTick(), SLEEP_TIMER);
|
||||
|
Loading…
Reference in New Issue
Block a user