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:
parent
0b9d545c6f
commit
6c3c579e6e
@ -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,7 +82,8 @@ class SplashScreenPanel(ScreenPanel):
|
||||
def firmware_restart(self, widget):
|
||||
self._screen._ws.klippy.restart_firmware()
|
||||
|
||||
def power_on(self, widget, device):
|
||||
def power_on(self, widget, devices):
|
||||
for device in devices:
|
||||
self._screen._ws.klippy.power_device_on(device)
|
||||
|
||||
def restart(self, widget):
|
||||
|
Loading…
x
Reference in New Issue
Block a user