Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions wled00/hue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@

#ifndef WLED_DISABLE_HUESYNC

// Hue bridge sync runtime state - private to this file, nothing outside hue.cpp
// needs any of it (previously these were WLED_GLOBAL, a leftover from when all
// state lived in one big extern block regardless of who actually used it).
static float hueXLast = 0, hueYLast = 0;
static uint16_t hueHueLast = 0, hueCtLast = 0;
static byte hueSatLast = 0, hueBriLast = 0;
static unsigned long hueLastRequestSent = 0;
static bool hueAuthRequired = false;
static bool hueReceived = false;
static bool hueNewKey = false;
static AsyncClient *hueClient = nullptr;

void handleHue()
{
if (hueReceived)
Expand Down
13 changes: 3 additions & 10 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,9 @@ WLED_GLOBAL bool showWelcomePage _INIT(false);
#ifndef WLED_DISABLE_HUESYNC
WLED_GLOBAL byte hueError _INIT(HUE_ERROR_INACTIVE);
// WLED_GLOBAL uint16_t hueFailCount _INIT(0);
WLED_GLOBAL float hueXLast _INIT(0), hueYLast _INIT(0);
WLED_GLOBAL uint16_t hueHueLast _INIT(0), hueCtLast _INIT(0);
WLED_GLOBAL byte hueSatLast _INIT(0), hueBriLast _INIT(0);
WLED_GLOBAL unsigned long hueLastRequestSent _INIT(0);
WLED_GLOBAL bool hueAuthRequired _INIT(false);
WLED_GLOBAL bool hueReceived _INIT(false);
WLED_GLOBAL bool hueStoreAllowed _INIT(false), hueNewKey _INIT(false);
// hueXLast/hueYLast/hueHueLast/hueCtLast/hueSatLast/hueBriLast/hueLastRequestSent/
// hueAuthRequired/hueReceived/hueNewKey/hueClient are private to hue.cpp - see there.
WLED_GLOBAL bool hueStoreAllowed _INIT(false);
#endif

// countdown
Expand Down Expand Up @@ -794,9 +790,6 @@ WLED_GLOBAL AsyncWebServer server _INIT_N(((80, {0, WLED_REQUEST_MAX_QUEUE, WLED
#ifdef WLED_ENABLE_WEBSOCKETS
WLED_GLOBAL AsyncWebSocket ws _INIT_N((("/ws")));
#endif
#ifndef WLED_DISABLE_HUESYNC
WLED_GLOBAL AsyncClient *hueClient _INIT(NULL);
#endif
WLED_GLOBAL AsyncWebHandler *editHandler _INIT(nullptr);

// udp interface objects
Expand Down
Loading