From d1604c68d63e55b84c3411b933e9a2783ac9891e Mon Sep 17 00:00:00 2001
From: alfrix <alfredomonclus@gmail.com>
Date: Fri, 26 Aug 2022 09:46:31 -0300
Subject: [PATCH] temp: do not change preheat selections while in the numpad

it's possible to just use one selection list and unselect the rest,
but i think that there is some benefit in usability keeping the selections separated
---
 panels/temperature.py | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/panels/temperature.py b/panels/temperature.py
index 725fadbf..6834762b 100644
--- a/panels/temperature.py
+++ b/panels/temperature.py
@@ -222,17 +222,18 @@ class TemperaturePanel(ScreenPanel):
             self.hide_numpad()
 
     def select_heater(self, widget, device):
-        if self.devices[device]["can_target"]:
-            if device in self.active_heaters:
-                self.active_heaters.pop(self.active_heaters.index(device))
-                self.devices[device]['name'].get_style_context().remove_class("button_active")
-                self.devices[device]['select'].set_label(_("Select"))
-                logging.info(f"Deselecting {device}")
-                return
-            self.active_heaters.append(device)
-            self.devices[device]['name'].get_style_context().add_class("button_active")
-            self.devices[device]['select'].set_label(_("Deselect"))
-            logging.info(f"Seselecting {device}")
+        if self.active_heater is None:
+            if self.devices[device]["can_target"]:
+                if device in self.active_heaters:
+                    self.active_heaters.pop(self.active_heaters.index(device))
+                    self.devices[device]['name'].get_style_context().remove_class("button_active")
+                    self.devices[device]['select'].set_label(_("Select"))
+                    logging.info(f"Deselecting {device}")
+                    return
+                self.active_heaters.append(device)
+                self.devices[device]['name'].get_style_context().add_class("button_active")
+                self.devices[device]['select'].set_label(_("Deselect"))
+                logging.info(f"Seselecting {device}")
         return
 
     def set_temperature(self, widget, setting):