Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for handling temperature G-code commands with float values #14

Closed
wants to merge 1 commit into from
Closed

Fix for handling temperature G-code commands with float values #14

wants to merge 1 commit into from

Conversation

asimonen
Copy link
Contributor

What does this PR do and why is it necessary?

In my configuration, Cura is generating temperature setting G-code lines with float values like this:
M140 S50.0

Those work fine with Octoprint and Klipper, but seem to cause issues with SmartPreheat:

...
  File "X/lib/python2.7/site-packages/octoprint_smartpreheat/__init__.py", line 100, in get_temps_from_file
    temp = int(tempMatch.group("value"))
ValueError: invalid literal for int() with base 10: '50.000000'

Removing the fraction part from the G-code file fixes the issue, but I think SmartPreheat should also be able to handle them as well.

How was it tested? How can it be tested by the reviewer?

I've used it for several prints in my x86 Ubuntu/Python 2 based Octoprint+Klipper setup.
To test, modify a G-code file and add the fraction part to M104/M140/M109/M190 commands.

@kantlivelong
Copy link
Owner

Thanks. Will merge ...eventually...

@kantlivelong kantlivelong added the bug Something isn't working label Dec 2, 2020
@kantlivelong
Copy link
Owner

Merged into devel via 89a27b8. Cheers 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants