summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2016-07-15 21:29:38 +1200
committerFlorian Baumann <derflob@derflob.de>2016-07-15 21:29:38 +1200
commit1fa7a81a1e50132b8bdfcc18a94fdd7f46afa1a2 (patch)
tree2d9d4b001edb87dbb3149ef8a216178d1dea9672
parent2c4795fd8b24842cbf2a514d63d0a70e840e9bc3 (diff)
downloadxmpp-1fa7a81a1e50132b8bdfcc18a94fdd7f46afa1a2.tar.gz
xmpp-1fa7a81a1e50132b8bdfcc18a94fdd7f46afa1a2.tar.bz2
more info on cmd status machine
-rw-r--r--__init__.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/__init__.py b/__init__.py
index 520c726..e519cf4 100644
--- a/__init__.py
+++ b/__init__.py
@@ -194,10 +194,21 @@ class OctoXMPP(EventHandlerPlugin, SettingsPlugin):
return "\n".join(lines)
def _status_machine(self):
- if (self._printer.is_closed_or_error()):
- return "Machine state:\nNot Connected/Error"
+ lines = ["Machine state:"]
+ state = self._printer.get_current_data()
+ (con, port, baud, profile) = self._printer.get_current_connection()
+ if (port):
+ lines.append("Connected to {} ({}) via {} at {}".format(
+ profile['name'], profile['model'], port, baud))
+
+ lines.append("State: {}".format(self._printer.get_state_string()))
else:
- return "Machine state:\n{}".format(self._printer.get_state_string())
+ lines.append("Not connected.")
+
+ if (state['currentZ']):
+ lines.append("Current Z position: {}".format(state['currentZ']))
+
+ return "\n".join(lines)
def _status_state(self):
return "{}".format(self._printer.get_current_data())