From 035b95defbea8b6820ce47aa25127369cbe26507 Mon Sep 17 00:00:00 2001 From: ldiegoes Date: Sun, 30 Oct 2022 07:34:00 +0100 Subject: [PATCH] 0.1.0.2 --- octoprint_helloworld/__init__.py | 20 +++++++++++++++++++- setup.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/octoprint_helloworld/__init__.py b/octoprint_helloworld/__init__.py index a18e7f2..d6eaae7 100644 --- a/octoprint_helloworld/__init__.py +++ b/octoprint_helloworld/__init__.py @@ -21,4 +21,22 @@ def on_after_startup(self): self._logger.info("Hello World!") __plugin_pythoncompat__ = ">=3.7,<4" -__plugin_implementation__ = HelloWorldPlugin() +#__plugin_implementation__ = HelloWorldPlugin() + + +def __plugin_load__(): + if not is_octoprint_compatible(__required_octoprint_version__): + import logging + logger = logging.getLogger(__name__) + logger.error("OctoPrint version is not compatible ({version} required)" + .format(version=__required_octoprint_version__)) + return + + global __plugin_implementation__ + #__plugin_implementation__ = FilamentManagerPlugin() + __plugin_implementation__ = HelloWorldPlugin() + global __plugin_hooks__ + __plugin_hooks__ = { + "octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information, + "octoprint.comm.protocol.gcode.sent": __plugin_implementation__.filament_odometer + } diff --git a/setup.py b/setup.py index 49af47f..dbc99a8 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # plugin module plugin_name = "OctoPrint-Helloworld" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.1.0.1" +plugin_version = "0.1.0.2" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module plugin_description = """TODO"""