Conversation
|
I'm not so sure if we should keep the old command. |
I say keep it for one release, users will see it's deprecated, remove in the release after. DRY is nice, but confusing users by disappearing commands instead of deprecating is also bad. |
| int dc_frac = (int)((dc - dc_int) * 10.0f + 0.5f); | ||
| sprintf(reply, "> %d.%d%%", dc_int, dc_frac); | ||
| } else if (memcmp(config, "af", 2) == 0) { | ||
| sprintf(reply, "> %s (deprecated, use 'get dutycycle')", StrHelper::ftoa(_prefs->airtime_factor)); |
| float actual = 100.0f / (_prefs->airtime_factor + 1.0f); | ||
| int a_int = (int)actual; | ||
| int a_frac = (int)((actual - a_int) * 10.0f + 0.5f); | ||
| sprintf(reply, "OK - %d.%d%% (deprecated, use 'set dutycycle')", a_int, a_frac); |
4c31f8d to
94e6f0c
Compare
We translate to af internally, it's easier to store and doesn't break stored prefs. Made get/set af command show deprecated, but it still works fine.
94e6f0c to
f633843
Compare
Keep yes, very much. Soft transition is always best. |
|
We could call it an |
Co-authored-by: ViezeVingertjes <michael.overhorst@gmail.com>
Allow users to simply set dutycycle percentage instead of having to deal with converting to airtime factor.
Old command still works but shows it's deprecated in favor of dutycycle command. We store internally all the same - this avoids breaking any prefs and works well enough internally.
Build it HERE