Update to no longer use data store for this
This commit is contained in:
parent
3a31fd1762
commit
5bd17e1e32
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "temperato",
|
"name": "temperato",
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"module": "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() {
|
async function temperatoTick() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(ENDPOINT, {
|
const response = await fetch(ENDPOINT);
|
||||||
headers: {
|
|
||||||
'authorization': process.env.AUTH,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const data: any = await response.json();
|
const data: any = await response.json();
|
||||||
|
|
||||||
if (data.temperature < SET_POINT && data.temperature >= EARLY_WARNING) {
|
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