add default color for public lamps
Signed-off-by: dragonchaser <christian@boltares.de>
This commit is contained in:
@@ -88,6 +88,7 @@ const std::map<String, void*> blackList = {
|
|||||||
// WARNING: IF THIS LIST CONTAINS > 0 VALUES, NO OTHER DEVICES WILL BE ALLOWED
|
// WARNING: IF THIS LIST CONTAINS > 0 VALUES, NO OTHER DEVICES WILL BE ALLOWED
|
||||||
// IF THIS LIST IS EMPTY IT WILL NOT BE USED
|
// IF THIS LIST IS EMPTY IT WILL NOT BE USED
|
||||||
static const std::map<String, void*> whiteList = {};
|
static const std::map<String, void*> whiteList = {};
|
||||||
|
#define LED_DEFAULT_COLOR_ON CRGB::DarkOrange
|
||||||
|
|
||||||
#elif DEVICE_TYPE == DEVICE_TYPE_PRIVATE_LAMP
|
#elif DEVICE_TYPE == DEVICE_TYPE_PRIVATE_LAMP
|
||||||
// This is a PRIVATE LAMP, restricted to a list of users
|
// This is a PRIVATE LAMP, restricted to a list of users
|
||||||
@@ -98,6 +99,7 @@ const std::map<String, void*> blackList = {
|
|||||||
static const std::map<String, void*> whiteList = {
|
static const std::map<String, void*> whiteList = {
|
||||||
{ "36E898", nullptr },
|
{ "36E898", nullptr },
|
||||||
};
|
};
|
||||||
|
#define LED_DEFAULT_COLOR_ON CRGB::Black
|
||||||
|
|
||||||
#elif DEVICE_TYPE == DEVICE_TYPE_AMULETT
|
#elif DEVICE_TYPE == DEVICE_TYPE_AMULETT
|
||||||
// This is an portable device, restricted to a list of users
|
// This is an portable device, restricted to a list of users
|
||||||
@@ -108,6 +110,7 @@ const std::map<String, void*> blackList = {
|
|||||||
static const std::map<String, void*> whiteList = {
|
static const std::map<String, void*> whiteList = {
|
||||||
{ "36E898", nullptr },
|
{ "36E898", nullptr },
|
||||||
};
|
};
|
||||||
|
#define LED_DEFAULT_COLOR_ON CRGB::Black
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error "Unknown DEVICE_TYPE"
|
#error "Unknown DEVICE_TYPE"
|
||||||
@@ -299,7 +302,7 @@ void UpdatePalette() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (colors.empty()) {
|
if (colors.empty()) {
|
||||||
fill_solid(pal.entries, LED_PALETTE_SIZE, CRGB::Black);
|
fill_solid(pal.entries, LED_PALETTE_SIZE, LED_DEFAULT_COLOR_ON);
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<LED_PALETTE_SIZE; i++) {
|
for (int i=0; i<LED_PALETTE_SIZE; i++) {
|
||||||
pal[i] = CRGB(StrToHex(colors[ i % deviceDatabase.size() ].c_str()));
|
pal[i] = CRGB(StrToHex(colors[ i % deviceDatabase.size() ].c_str()));
|
||||||
|
|||||||
Reference in New Issue
Block a user