From 18b403bb56a38a26002873d0013564d0fa2c89cb Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Fri, 30 Aug 2019 07:18:54 +0300 Subject: [PATCH] lights: update kelvin constants --- code/espurna/config/general.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index be71422d..93df61b4 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -1148,11 +1148,27 @@ #define LIGHT_MAX_BRIGHTNESS 255 // Maximum brightness value #endif -#define LIGHT_MIN_KELVIN 1000 -#define LIGHT_MAX_KELVIN 40000 +// Default mireds & kelvin to the Philips Hue limits +// https://developers.meethue.com/documentation/core-concepts +// +// Home Assistant also uses these, see Light::min_mireds, Light::max_mireds +// https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/__init__.py + +#ifndef LIGHT_MIN_KELVIN +#define LIGHT_MIN_KELVIN 2000 +#endif + +#ifndef LIGHT_MAX_KELVIN +#define LIGHT_MAX_KELVIN 6536 +#endif + +#ifndef LIGHT_MIN_MIREDS +#define LIGHT_MIN_MIREDS 153 +#endif -#define LIGHT_MIN_MIREDS 153 // Default to the Philips Hue value that HA also use. -#define LIGHT_MAX_MIREDS 500 // https://developers.meethue.com/documentation/core-concepts +#ifndef LIGHT_MAX_MIREDS +#define LIGHT_MAX_MIREDS 500 +#endif #ifndef LIGHT_STEP #define LIGHT_STEP 32 // Step size