summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2016-07-22 19:54:44 +1200
committerFlorian Baumann <derflob@derflob.de>2016-07-22 19:56:57 +1200
commit06036b7541943592615c7ca36bb4bdd55ae28a35 (patch)
tree81b951312b06ac0a1b19d23785439252d581cafd
parent5e41a33cdb4853996f8dc62f5e474fcebda4427f (diff)
downloadxmpp-master.tar.gz
xmpp-master.tar.bz2
Implement disconnect/connectHEADmaster
-rw-r--r--__init__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/__init__.py b/__init__.py
index a4c4c72..3bfa683 100644
--- a/__init__.py
+++ b/__init__.py
@@ -34,6 +34,7 @@ class xmpp_cmd():
return fn
+
class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
def initialize(self):
@@ -425,9 +426,21 @@ class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
else:
return self._cmd_help(msg, 'power')
+ @xmpp_cmd("connect")
+ def _cmd_connect(self, msg):
+ if (self._printer.connect()):
+ msg.reply(body="Connected!").send()
+ else:
+ msg.reply(body="Could not auto-connect!").send()
+
+ @xmpp_cmd("disconnect")
+ def _cmd_disconnect(self, msg):
+ self._printer.disconnect()
+ msg.reply(body="Disconnected...").send()
+
__plugin_name__ = "OctoXMPP"
-__plugin_version__ = "0.2.3"
+__plugin_version__ = "0.2.4"
__plugin_description__ = "Control OctoPrint via XMPP messages."
__plugin_implementation__ = OctoXMPP()