From 99b97afc7de1ed16ddc7db29ab6354bd6ea3dfb7 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 3 Apr 2024 10:44:04 -0400 Subject: [PATCH] simplyprint: fix layer detect divide by zero Signed-off-by: Eric Callahan --- moonraker/components/simplyprint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moonraker/components/simplyprint.py b/moonraker/components/simplyprint.py index 58fd91f..6d7d91c 100644 --- a/moonraker/components/simplyprint.py +++ b/moonraker/components/simplyprint.py @@ -1289,9 +1289,9 @@ class LayerDetect: def start(self, metadata: Dict[str, Any]) -> None: self.reset() - lh: Optional[float] = metadata.get("layer_height") - flh: Optional[float] = metadata.get("first_layer_height", lh) - if lh is not None and flh is not None: + lh: float = metadata.get("layer_height", 0) + flh: float = metadata.get("first_layer_height", lh) + if lh > 0.000001 and flh > 0.000001: self._active = True self._layer_height = lh self._fl_height = flh