Support multiple power devices. (#350)

Enable multiple devices to power on when turning on printer. Devices starting with "Printer" will turn on
This commit is contained in:
d8ahazard authored and GitHub committed 2021-12-24 09:31:01 -05:00
1 parent 0b9d545c6f
commit 6c3c579e6e
1 file changed
+4 -3
+4 -3
View File
@@ -71,7 +71,7 @@ class SplashScreenPanel(ScreenPanel):
logging.debug("Power devices: %s" % devices)
if len(devices) > 0:
logging.debug("Adding power button")
self.labels['power'].connect("clicked", self.power_on, devices[0])
self.labels['power'].connect("clicked", self.power_on, devices)
self.labels['actions'].add(self.labels['power'])
self.labels['actions'].add(self.labels['restart'])
@@ -82,8 +82,9 @@ class SplashScreenPanel(ScreenPanel):
def firmware_restart(self, widget):
self._screen._ws.klippy.restart_firmware()
def power_on(self, widget, device):
self._screen._ws.klippy.power_device_on(device)
def power_on(self, widget, devices):
for device in devices:
self._screen._ws.klippy.power_device_on(device)
def restart(self, widget):
self._screen._ws.klippy.restart()