Giter Site home page Giter Site logo

Comments (2)

TheSin- avatar TheSin- commented on June 12, 2024

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.

waltmoorhouse avatar waltmoorhouse commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.