From c30e688113e317ff6aca8a63f16b202cbfff3820 Mon Sep 17 00:00:00 2001
From: Ruben Beltran del Rio <ruben@unlimited.pizza>
Date: Wed, 6 Jul 2022 22:49:06 +0200
Subject: Connect sensor to database

---
 src/lib/components/sensor.svelte | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/lib/components/sensor.svelte')

diff --git a/src/lib/components/sensor.svelte b/src/lib/components/sensor.svelte
index da968a3..e98b740 100644
--- a/src/lib/components/sensor.svelte
+++ b/src/lib/components/sensor.svelte
@@ -1,6 +1,7 @@
 <script>
   import { browser } from '$app/env';
   import { maxSize } from '$lib/config';
+  import { sensor } from '$lib/stores/widgets';
 
   export let x;
   export let y;
@@ -16,7 +17,7 @@
   const fetchItems = function fetchItems( left, top, right, bottom ) {
     clearTimeout(timer);
 		timer = setTimeout(() => {
-      console.log('fetching', left, top, right, bottom);
+      sensor.set({ left, top, right, bottom });
 		}, 50);
   }
 
-- 
cgit 

