ivanilves, thank you for writing this up and sharing the code & the video of the end result, it is a fun project!
As a thought experiment I've had a play to see what the state machine logic might look like if we try to replace the bool state variables with a set of explicit finite states, and to push the state transition logic into a pure function. Results are here: https://gist.github.com/fcostin/851c1b4d1e3cb75ba972408151f1...
It is more verbose, but one advantage of structuring it like this (that i've only partially succeeded at) is that state transitions only happen at most once per each call to advance_state. Might make it easier to read through and follow the logic. It also makes the state transition logic easy to unit test, since it is pure-functional instead of being mixed together with sensing and doing actions (unsure how much of a concern or possibility unit testing is with ino files, I've never done any arduino dev myself).
Not sure if this is anything like what SomeoneFromCA was thinking.
Thanks for your code, looks like this can help improving my state machine indeed. I'll try to apply that approach when I get my next slice of free time ;)
Sure, no problems, will give you feedback later, but here is one recommendation: combine group of booleans frequently used together in conditions into a new separate boolean variable. Say, for example, bool isMoving = (isOpening or isClosing).
For the last 6 month "lstags" evolved from a small utility to a full Golang API library, it survived complete re-shape and re-fit, and I hope at least some of you will find it useful!
HOW/WHY COULD ANYONE USE IT???
Well, for example, lstags could be used for filling local registries (or to "prewarm" caching registries) with images from quay.io and gcr.io, to speed up K8s cluster launches.
Also could be used to "prewarm" local Docker storage by pulling popular images in advance (so your "docker run" will not be wasting time on pulling things, it will just run!).
P.S.:
There is a terrible lack of V2 registry tools, so I decided to write my own (a mix of NIH and real necessity, yes!!!).
Any ideas are welcome (I am very open), if you know any useful Docker registry tools, please mention em here.
I am seeking for collaborations now, to not become yet another lonely Golang madman reinventing the wheel. ;)
The project has changed radically after it got a "xaval" connection manager. Before it was accepted more like a parody on sshuttle ;)
Now you can use it not only because you hate python, but also if you like simple and straightforward CLI tools that save your time.
Any feedback is welcome - we start to work on OS-specific releases and rewrite with a better language than bash, but any suggestions apart are also welcome.