From 413e3b2f4fd9bba52b64095027d1ae606bcd7a67 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Mon, 8 Aug 2022 19:42:14 -0400 Subject: [PATCH] simplyprint: add power device fallback Signed-off-by: Eric Callahan --- moonraker/components/simplyprint.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/moonraker/components/simplyprint.py b/moonraker/components/simplyprint.py index 7bf5f44..fd5272b 100644 --- a/moonraker/components/simplyprint.py +++ b/moonraker/components/simplyprint.py @@ -126,6 +126,12 @@ class SimplyPrint(Subscribable): "Section [simplyprint], option 'power_device': Unable " f"to locate configuration for power device {power_id}" ) + else: + power_pfx = config.get_prefix_sections("power ") + if len(power_pfx) == 1: + name = power_pfx[0][6:] + if "printer" in name.lower(): + self.power_id = name self.filament_sensor: str = "" fsensor = config.get("filament_sensor", None) fs_prefixes = ["filament_switch_sensor ", "filament_motion_sensor "]