summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2016-07-16 08:36:50 +1200
committerFlorian Baumann <derflob@derflob.de>2016-07-16 08:36:50 +1200
commit0bffca4795c9902d05695014e915fbcd713c0bb5 (patch)
treebc4051c591fc9b035cb93e2ee5eed186ee76e264
parente928488ca67fabdc15e9d3ba0bfd71e66363c26c (diff)
downloadxmpp-0bffca4795c9902d05695014e915fbcd713c0bb5.tar.gz
xmpp-0bffca4795c9902d05695014e915fbcd713c0bb5.tar.bz2
cmd home <xyze>|all
-rw-r--r--__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py
index 7ad7227..c850ab5 100644
--- a/__init__.py
+++ b/__init__.py
@@ -274,6 +274,19 @@ class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
def _job_abort(self):
return self._job_cancel()
+ def _cmd_home(self, msg, *axis):
+ axes = list(filter(lambda a: a in ('all', ) + self._printer.valid_axes, axis))
+ if (len(axes) == 0):
+ reply = "Specify one or more axes (x y z e) or 'all' to home."
+ elif (len(axes) > 0 and 'all' in axes):
+ axes = ['x', 'y', 'z', 'e']
+ reply = "Homing all axes..."
+ else:
+ reply = "Homing axes {}...".format(", ".join(axes))
+
+ self._printer.home(axes)
+ msg.reply(body=reply).send()
+
__plugin_name__ = "OctoXMPP"
__plugin_version__ = "0.2.0"