summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2016-07-15 17:07:29 +1200
committerFlorian Baumann <derflob@derflob.de>2016-07-15 17:07:29 +1200
commit733530094ff4f72e5945219d5c47e85716355765 (patch)
tree8fdb269be87d390e028c2227cb64775786207f8c
parent1617db590a8f658f068f548f81ebf3f73e8ef69e (diff)
downloadxmpp-status_requests.tar.gz
xmpp-status_requests.tar.bz2
Disconnect XMPP when unloading pluginstatus_requests
-rw-r--r--__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py
index 1d4975f..76c4f05 100644
--- a/__init__.py
+++ b/__init__.py
@@ -36,6 +36,9 @@ class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
self._xmpp.connect()
self._xmpp.process(wait=True)
+ def unload(self):
+ self._xmpp.disconnect(wait=True)
+
def get_settings_defaults(self):
return {
'xmpp': {
@@ -183,3 +186,7 @@ __plugin_name__ = "OctoXMPP"
__plugin_version__ = "0.2.0"
__plugin_description__ = "Control OctoPrint via XMPP messages."
__plugin_implementation__ = OctoXMPP()
+
+def __plugin_unload__():
+ global __plugin_implementation__
+ __plugin_implementation__.unload()