summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()