simplyprint: add power device fallback
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
3424f1b3e2
commit
413e3b2f4f
|
@ -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 "]
|
||||
|
|
Loading…
Reference in New Issue