Merge pull request #15954 from dgwynne/Speed2Cancel

add `Speed2 !` to cancel pending one-shot speed setting
This commit is contained in:
Theo Arends 2022-07-10 10:46:05 +02:00 committed by GitHub
commit 53a36c1fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3130,6 +3130,14 @@ void CmndFade(void)
void CmndSpeed(void)
{
if (2 == XdrvMailbox.index) {
// Speed2 ! cancels use of Speed2 in the future
if ((1 == XdrvMailbox.data_len) && ('!' == XdrvMailbox.data[0])) {
Light.fade_once_enabled = false;
Light.speed_once_enabled = false;
ResponseCmndDone();
return;
}
// Speed2 setting will be used only once, then revert to fade/speed
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 40)) {
Light.fade_once_enabled = true;