Files
monitor-im-flur/src/api/homeAssistant.ts
Arif Hasanic 5f5f0c46fe
All checks were successful
CI / build (push) Successful in 13s
CI / lint (push) Successful in 7s
CI / build-and-push-docker (push) Successful in 12s
try fix cors issues
2025-08-29 15:57:21 +02:00

32 lines
984 B
TypeScript

const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI3N2JmOTk1ODI3MzA0ZWIzOWYwNThjMzQ4YTY3ZDJkYyIsImlhdCI6MTc1NjQ3NTM4OSwiZXhwIjoyMDcxODM1Mzg5fQ.TZZ4SUGlERuIVrhzC_wfCN-qS1wSAKNN9uMMDjkqOgA";
async function fetchTentHumidity() {
const url =
`https://home.rivercry.com/api/states/sensor.third_reality_inc_3rths0224z_luftfeuchtigkeit_2`;
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
return data.state;
}
async function fetchTentTemperature() {
const url = `https://home.rivercry.com/api/states/sensor.third_reality_inc_3rths0224z_temperatur_2`;
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
return data.state;
}
export { fetchTentHumidity, fetchTentTemperature };