From 109424fc50f3d3f1c392f6e231212611c0dffdbc Mon Sep 17 00:00:00 2001 From: Raymond Bourges Date: Fri, 2 Jan 2026 15:46:35 +0100 Subject: [PATCH] =?UTF-8?q?FIX=20:=20vitesse=201ere=20r=C3=A9cup=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 +++++--- utils/webrepl_setup.py | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 utils/webrepl_setup.py diff --git a/main.py b/main.py index 71541f3..e03c6f9 100644 --- a/main.py +++ b/main.py @@ -79,17 +79,19 @@ class Cloud: def net_up(self): if not self.wifi.isconnected(): + print("Connexion au WIFI...") self.wifi.active(True) self.wifi.connect("Livebox-BDC6", "KFQSn7PDCMSgPpM2Ws") while not self.wifi.isconnected(): print(".") + time.sleep(0.2) def zoe(self) -> int: try: + self.net_up() self.maintenant = time.ticks_ms() - if time.ticks_diff(self.maintenant, self.dernier_appel_zoe) > self.ttl: + if self.derniere_val_zoe == 0 or time.ticks_diff(self.maintenant, self.dernier_appel_zoe) > self.ttl: self.dernier_appel_zoe = self.maintenant - self.net_up() debug("appel sensor.zoe_batterie") response = urequests.get("https://ha-demo.arbi.fr/api/states/sensor.zoe_batterie", headers=self.headers) data = response.json() @@ -102,10 +104,10 @@ class Cloud: def HC(self) -> bool: try: + self.net_up() self.maintenant = time.ticks_ms() if time.ticks_diff(self.maintenant, self.dernier_appel_HC) > self.ttl: self.dernier_appel_HC = self.maintenant - self.net_up() debug("appel sensor.compteur_linky_ptec") response = urequests.get("https://ha-demo.arbi.fr/api/states/sensor.compteur_linky_ptec", headers=self.headers) data = response.json() diff --git a/utils/webrepl_setup.py b/utils/webrepl_setup.py deleted file mode 100644 index d5e6dfc..0000000 --- a/utils/webrepl_setup.py +++ /dev/null @@ -1 +0,0 @@ -import webrepl_setup \ No newline at end of file