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
Remove unescaped line termination characters from string literals if needed #61
Conversation
Thanks for adding this :) Please add a test case for the printer behaviour. Alternatively just share the raw data returned by the sleeping printer with this unescaped newline |
Here is the raw data (with a few values obfuscated) with the unescaped newline:
|
Should have said. when the printer is "Sleeping" the status1 always appears to be |
For me that same behaviour. Only see these errors when using the printer |
@nielstron any chance this PR could be approved? |
Yes totally. There should be a new testcase though based on the raw data you shared. I can have a look if I can add it myself. |
Yes please, 🙏 |
superseded by #62 |
Thanks. Looking forward for the HA Release with this fix 😊 |
If the printer isn't sleeping then the
status1
field frequently contains unescaped new line characters which causes thedemjson3
to generate an exception.This PR attempts to escape these new line characters if the initial parsing fails before trying to reparse the json.