From b89aa77bc9a149a53cb86c4c13c7a5afb920f0d7 Mon Sep 17 00:00:00 2001 From: Arksine Date: Wed, 17 Feb 2021 08:16:49 -0500 Subject: [PATCH] power: register websocket notification Change event prefix from "gpio_power" to "power". Signed-off-by: Eric Callahan --- moonraker/plugins/power.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moonraker/plugins/power.py b/moonraker/plugins/power.py index 3300134..b56a703 100644 --- a/moonraker/plugins/power.py +++ b/moonraker/plugins/power.py @@ -59,6 +59,7 @@ class PrinterPower: "set_device_power", self.set_device_power) self.server.register_event_handler( "server:klippy_shutdown", self._handle_klippy_shutdown) + self.server.register_notification("power:power_changed") IOLoop.current().spawn_callback( self._initalize_devices, list(self.devices.values())) @@ -119,7 +120,7 @@ class PrinterPower: if asyncio.iscoroutine(ret): await ret dev_info = device.get_device_info() - self.server.send_event("gpio_power:power_changed", dev_info) + self.server.send_event("power:power_changed", dev_info) device.run_power_changed_action() elif req == "status": ret = device.refresh_status()