temperature: merge nested ifs

This commit is contained in:
alfrix 2022-10-14 10:18:42 -03:00
parent 723662074e
commit e208873e46

View File

@ -211,8 +211,7 @@ class TemperaturePanel(ScreenPanel):
self.hide_numpad() self.hide_numpad()
def select_heater(self, widget, device): def select_heater(self, widget, device):
if self.active_heater is None: if self.active_heater is None and self.devices[device]["can_target"]:
if self.devices[device]["can_target"]:
if device in self.active_heaters: if device in self.active_heaters:
self.active_heaters.pop(self.active_heaters.index(device)) self.active_heaters.pop(self.active_heaters.index(device))
self.devices[device]['name'].get_style_context().remove_class("button_active") self.devices[device]['name'].get_style_context().remove_class("button_active")