From c93bfd15bfefeecab5ea4098f165fba290babc10 Mon Sep 17 00:00:00 2001 From: James Turton Date: Wed, 4 Nov 2020 19:05:19 +0100 Subject: [PATCH] Updated `CmndDimmerStep()`. --- tasmota/xdrv_04_light.ino | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 17cc46e171f7..11fd178fbc97 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -2912,18 +2912,15 @@ void CmndDimmerStep(void) // DimmerStep - Show current dimmer step as used by Dimmer +/- // DimmerStep 1..50 - Set dimmer step if (XdrvMailbox.data_len > 0) { - uint32_t parm[1]; - parm[0] = Settings.dimmer_step; - ParseParameters(1, parm); - if (parm[0] < 1) { - Settings.dimmer_step = 1; - } else if (parm[0] > 50) { - Settings.dimmer_step = 50; + if (XdrvMailbox.payload < 1) { + Settings.dimmer_step = 1; + } else if (XdrvMailbox.payload > 50) { + Settings.dimmer_step = 50; } else { - Settings.dimmer_step = parm[0]; + Settings.dimmer_step = XdrvMailbox.payload; } } - Response_P(PSTR("{\"" D_CMND_DIMMER_STEP "\":%d}"), Settings.dimmer_step); + ResponseCmndNumber(Settings.dimmer_step); } void CmndLedTable(void)