diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index 877ee94..cbc7f4c 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -852,9 +852,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght } if (root.containsKey("brightness")) { - const char * brightness_json = root["brightness"]; - uint8_t b = (uint8_t) strtol((const char *) &brightness_json[0], NULL, 10); - brightness = constrain(b, 0, 255); + brightness = constrain((uint8_t) root["brightness"], 0, 255); //fix #224 mode = BRIGHTNESS; } diff --git a/Arduino/McLighting/version.h b/Arduino/McLighting/version.h index ff7b8d7..539d5b4 100644 --- a/Arduino/McLighting/version.h +++ b/Arduino/McLighting/version.h @@ -1 +1 @@ -#define SKETCH_VERSION "2.1.4" +#define SKETCH_VERSION "2.1.5" diff --git a/Arduino/McLighting/version_info.ino b/Arduino/McLighting/version_info.ino index bf0aa44..8795eba 100644 --- a/Arduino/McLighting/version_info.ino +++ b/Arduino/McLighting/version_info.ino @@ -17,4 +17,7 @@ * * 10 Jul 2018 v 2.1.4 * - Fixes measureJson() as pointed in #206 + * + * 2 Oct 2018 v 2.1.5 + * - Try fixing #224 HA brightness causes reboot */