implement fading

This commit is contained in:
2016-04-27 21:24:55 +02:00
parent d9d2ccd9bf
commit 99dd1918fc
2 changed files with 66 additions and 0 deletions

View File

@@ -20,7 +20,15 @@ class DeviceLed : public Device {
int led_red = 0;
int led_green = 0;
int led_blue = 0;
bool fading = false;
int fade_from_red, fade_to_red;
int fade_from_green, fade_to_green;
int fade_from_blue, fade_to_blue;
unsigned long fade_start = 0;
unsigned long fade_end = 0;
float progress_last = 0;
bool ledOnHandler(String value);
bool ledColorHandler(String message);
bool ledFadeHandler(String message);
HomieNode ledNode{"led", "rgb"};
};