From 7fa53827fd33a3e167c32cb66efb90367d4f6327 Mon Sep 17 00:00:00 2001 From: Arti4ever <39329296+Arti4ever@users.noreply.github.com> Date: Sat, 2 Mar 2019 15:37:38 +0100 Subject: [PATCH] update_ui on client connection and page refresh. This to avoid wrong gpio status after page refresh. --- octoprint_enclosure/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index ae4ff88..63d094c 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -1253,6 +1253,9 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, if event == Events.CONNECTED: self.update_ui() + if event == Events.CLIENT_OPENED: + self.update_ui() + if event == Events.PRINT_RESUMED: self.start_filament_detection() @@ -1707,4 +1710,3 @@ def __plugin_load__(): "octoprint.comm.protocol.gcode.queuing": __plugin_implementation__.hook_gcode_queuing, "octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information } -