Comments (2)
just looking at the code it seems that reading the input put could use a bit better splitting, you could use a regex match that does
/([HTSLP])([0-9]+)?:([0-9]{1,2}.[0-9]{2}|ON|OFF)/g
Then you can read $1, if $2 is required to find out which one and $3 for the value
https://regex101.com/r/c0Zbg3/1
Then you could easily check your functions to include a Spool number in the call based on $2 and not have to have 4 duplication functions, and the amount of spools would be able to change from 1+
It would simplify the code and allow more variance
from octoprint-filamentstorage.
Please submit a PR and I will review and approve. I'm not a Python developer, so I know there are things that could be improved.
from octoprint-filamentstorage.
Related Issues (5)
- More Details? HOT 1
- Err: NO SERIAL PORTS FOUND! HOT 1
- Python 3.6 HOT 15
- Print pauses even if both checkboxes on unchecked HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octoprint-filamentstorage.