From 4dbc9881662d3b867dcafadfdf667f56b3a0a22c Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 27 Jan 2019 10:35:50 +0100 Subject: [PATCH] move start of repeatedtimer to after initalized --- octoprint_hd44780/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/octoprint_hd44780/__init__.py b/octoprint_hd44780/__init__.py index def2d3f..60d21ca 100644 --- a/octoprint_hd44780/__init__.py +++ b/octoprint_hd44780/__init__.py @@ -46,9 +46,6 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, self._lcd_updating = False - timer = RepeatedTimer(30, self._lcd_update()) - timer.start() - def on_settings_initialized(self): self._initialize_lcd() self._printer.register_callback(self) @@ -109,7 +106,8 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, self._line1 = printerstate.center(20) self.clear_lower_half() - self._lcd_update() + timer = RepeatedTimer(30, self._lcd_update()) + timer.start() def _lcd_update(self): if self._lcd_updating: