-
Notifications
You must be signed in to change notification settings - Fork 66
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
Implement named variables. #674
Implement named variables. #674
Conversation
Please bear with me until I review your (very impressive) PRs; I want to release the current firmware master with proper implementation of the md5sum feature and a related Agent version first so that the chance of users bricking their UHKs would decrease dramatically. |
That looks very interesting. What it lacks - high quality documentation and tutorials. |
@kareltucek Would you please write example commands for the points mentioned? I'm asking because I find this PR quite overwhelming, and examples I can easily test would help a lot. Going forward, please try to submit smaller PRs. That way, I can review them much faster without getting my brain melted :) |
Edited the leading post. |
This is impressive; I like the new syntax. My biggest question is: how is compatibility with existing macros kept? Or simply not, and users would have to rewrite all their macros once they install this firmware? |
In this PR, most old syntax is preserved but throws deprecation warnings accompanied by migration instructions. But yes, users are expected to rewrite their macros. I expect to remove the deprecated syntaxes in the next major release. |
The macro engine accepts |
Good point, fixed, although the name is not too long, by far. Actually, asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd is still valid length. |
I suggest changing
|
|
|
Am I correct that this is a slightly breaking change because single-digit keyIds don't work as they used to? |
Yes. |
Then, after merging this PR, I'll bump the major smart macro version and, as a result, the major firmware version. I'm unsure whether I should bump the major smart macro and firmware version again after you eventually remove the added deprecation warnings, but I think I shouldn't. |
Well, there were similar minor violations of compatibility in the past upon which you did not raise the major number. For instance, switching leds.fadeTimeout from minutes to seconds. Given this, I don't think that you are strictly obliged to bump the major number just because of that relatively minor change in the keyid semantics. I think it makes sense to bump the major versions just once for a feature, no matter whether you do it now, or upon removal of the deprecated stuff. In any case, other things should be done before the next major release, so please don't release major version straight after merging. |
Great points! What do you want to do before bumping the major version? |
|
This is actually missing time, e.g. Added error when this happens. Other two bugs are fixed. |
This PR seems complete. Do you still have anything to fix? I assume you'll fix #674 (comment) in separate PRs. |
This is complete unless you can find other problems. I will fix the other things in separate PRs. |
Please resolve the conflict, and I'll merge it. |
Done. |
Changes:
setVar
command and$
syntax. E.g.:+
,-
,*
,/
,%
,min(...)
,max(...)
) and boolean conditions (<
,<=
,>
,>=
,==
,!=
,!
,&&
,||
). E.g.:if (EXPRESSION)
command. E.g.:\
escapes. E.g.:validateUserConfig
command, mainly for development purposes.setLedTxt
now accepts numeric expressions. E.g.:$<name>
syntax just as variables. E.g.:#
,%
and@
syntaxies.ifRegEq
,ifNotRegEq
,ifRegGt
,ifRegLt
,setReg
,addReg
,subReg
,mulReg
commandswriteExpr
andsetStatusPart
commands.consume*
operators. This has probably introduced some new bugs. Please, let us know on github or on our forum if you encounter any.Closes #614, closes #620, closes #630.
Sorry for the PR length 😅. Originally it was split into multiple commits, until I realized that I had forgotten to commit new files... ...which has led me to squash the branch to prevent inconsistent states on the branch.