summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2016-07-16 08:37:43 +1200
committerFlorian Baumann <derflob@derflob.de>2016-07-16 08:37:43 +1200
commit7a663ae5ad8f4570af08664f01803265544d2d83 (patch)
tree6bf1340ea953c23d9e834fe2e24fd7e0677193de
parent0bffca4795c9902d05695014e915fbcd713c0bb5 (diff)
downloadxmpp-7a663ae5ad8f4570af08664f01803265544d2d83.tar.gz
xmpp-7a663ae5ad8f4570af08664f01803265544d2d83.tar.bz2
cmd temp <dev> <temperature>
-rw-r--r--__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/__init__.py b/__init__.py
index c850ab5..f8cf974 100644
--- a/__init__.py
+++ b/__init__.py
@@ -287,6 +287,16 @@ class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
self._printer.home(axes)
msg.reply(body=reply).send()
+ def _cmd_temp(self, msg, dev, temp):
+ if (not self._printer.valid_heater_regex.match(dev)):
+ reply = "Invalid heater name! It must match '{}'!".format(
+ self._printer.valid_heater_regex.pattern)
+ else:
+ reply = "Setting temperature of {} to {}".format(dev, temp)
+ self._printer.set_temperature(dev, float(temp))
+
+ msg.reply(body=reply).send()
+
__plugin_name__ = "OctoXMPP"
__plugin_version__ = "0.2.0"