aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/klippy.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-28 21:45:29 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-28 22:38:29 -0500
commit860fc3e91de9e17d869daaad08ebfcf9b07e270e (patch)
tree73b92f90a61ab6e31d12a24abab0e4bcc241d81c /klippy/klippy.py
parent2e03d84755f466adaad64ae0054eb461869d0529 (diff)
downloadkutter-860fc3e91de9e17d869daaad08ebfcf9b07e270e.tar.gz
kutter-860fc3e91de9e17d869daaad08ebfcf9b07e270e.tar.xz
kutter-860fc3e91de9e17d869daaad08ebfcf9b07e270e.zip
gcode: Add support for M115 command
Support querying the firmware type and version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/klippy.py')
-rw-r--r--klippy/klippy.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py
index f9f55de1..7af2e9b8 100644
--- a/klippy/klippy.py
+++ b/klippy/klippy.py
@@ -82,8 +82,9 @@ class ConfigLogger():
logging.info(data.strip())
class Printer:
- def __init__(self, conffile, input_fd, is_fileinput=False):
+ def __init__(self, conffile, input_fd, is_fileinput=False, version="?"):
self.conffile = conffile
+ self.software_version = version
self.reactor = reactor.Reactor()
self.gcode = gcode.GCodeParser(self, input_fd, is_fileinput)
self.stats_timer = self.reactor.register_timer(self.stats)
@@ -260,13 +261,14 @@ def main():
else:
logging.basicConfig(level=debuglevel)
logging.info("Starting Klippy...")
+ software_version = util.get_git_version()
if debugoutput is None:
- util.report_git_version()
+ logging.info("Git version: %s" % (repr(software_version),))
# Start firmware
while 1:
is_fileinput = debuginput is not None
- printer = Printer(conffile, input_fd, is_fileinput)
+ printer = Printer(conffile, input_fd, is_fileinput, software_version)
if debugoutput:
proto_dict = read_dictionary(options.read_dictionary)
printer.set_fileoutput(debugoutput, proto_dict)