diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 958c7879b..89badfbe1 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -914,7 +914,7 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len) snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s}"), mqtt_data); } else if (CMND_PWMFREQUENCY == command_code) { - if ((1 == payload) || ((payload >= 100) && (payload <= 4000))) { + if ((1 == payload) || ((payload >= PWM_MIN) && (payload <= PWM_MAX))) { Settings.pwm_frequency = (1 == payload) ? PWM_FREQ : payload; analogWriteFreq(Settings.pwm_frequency); // Default is 1000 (core_esp8266_wiring_pwm.c) }