From 0874c212dcb7bb1215978b2b9cce3c8bbe2bdda1 Mon Sep 17 00:00:00 2001 From: Jonathan Roth Date: Thu, 27 Nov 2025 08:48:03 +0100 Subject: [PATCH] fix enable button stop function --- pymhcgui.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pymhcgui.py b/pymhcgui.py index 7395d05..d10a8a1 100644 --- a/pymhcgui.py +++ b/pymhcgui.py @@ -19,7 +19,7 @@ def toggle_heating_state(heating_button): port = 4623 # Port du serveur btcolor = heating_button.cget("bg") - current_state = 0 if btcolor == "gray" else 0 + current_state = 0 if btcolor == "gray" else 1 # Si la chauffe est active (vert), envoyer la commande "stop" if current_state == 1: @@ -32,7 +32,6 @@ def toggle_heating_state(heating_button): command = "start" heating_button.config(bg="green", text="Chauffe active") - # Créer la commande à envoyer au serveur with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((server_ip, port))