Deactivate plot in sauna

Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
This commit is contained in:
Thomas Klaehn 2024-07-04 07:04:52 +02:00
parent d26f92a0f1
commit d3b5b7d9ba
3 changed files with 9 additions and 15 deletions

View File

@ -13,9 +13,6 @@
const PRECISION = 1;
export async function create(legend_label, legend_unit, duration) {
console.log(legend_label);
console.log(legend_unit);
console.log(duration);
data_label = legend_label;
unit = legend_unit;
last_for_seconds = duration;

View File

@ -15,9 +15,6 @@
fetch(backend_url)
.then(response => response.json())
.then(data => {
console.log(year)
console.log(data)
console.log(data.Years[year])
total_distance_value = data.Years[year].total_distance.value
total_distance_unit = data.Years[year].total_distance.unit
year_result_value = data.Years[year].year_result.value

View File

@ -1,6 +1,6 @@
<script>
import { onMount } from "../../../node_modules/svelte/internal";
import Plot from "$lib/Uplot.svelte"
// import Plot from "$lib/Uplot.svelte"
import icon from "$lib/images/sauna.svg"
let backend_url = "https://home.blackfinn.de/api/sauna";
@ -18,9 +18,9 @@
temperature_unit = data.unit
temperature_value = data.value
time = data.time.slice(11, 19)
if(plot) {
plot.add_data(temperature_value);
}
// if(plot) {
// plot.add_data(temperature_value);
// }
updated = JSON.parse(data.valid);
}).catch(error => {
console.log(error);
@ -33,9 +33,9 @@
}, 1000)
onMount(async () => {
if(plot) {
plot.create("Temperature", "°C", 4 * 60 * 60 /* 4h */);
}
// if(plot) {
// plot.create("Temperature", "°C", 4 * 60 * 60 /* 4h */);
// }
get_temperature();
});
</script>
@ -53,8 +53,8 @@
{#if updated}
<div>{time} Uhr:</div>
<h1>{temperature_value} {temperature_unit}</h1>
<div><Plot/></div>
<!-- <div><Plot/></div> -->
{/if}
</section>
<Plot bind:this={plot}/>
<!-- <Plot bind:this={plot}/> -->