|
@ -989,8 +989,15 @@ void _lightInitCommands() { |
|
|
|
|
|
|
|
|
terminalRegisterCommand(F("BRIGHTNESS"), [](Embedis* e) { |
|
|
terminalRegisterCommand(F("BRIGHTNESS"), [](Embedis* e) { |
|
|
if (e->argc > 1) { |
|
|
if (e->argc > 1) { |
|
|
lightBrightness(String(e->argv[1]).toInt()); |
|
|
|
|
|
lightUpdate(true, true); |
|
|
|
|
|
|
|
|
const String value(e->argv[1]); |
|
|
|
|
|
if( value.length() > 0 ) { |
|
|
|
|
|
if( value[0] == '+' || value[0] == '-' ) { |
|
|
|
|
|
lightBrightness(lightBrightness()+String(e->argv[1]).toInt()); |
|
|
|
|
|
} else { |
|
|
|
|
|
lightBrightness(String(e->argv[1]).toInt()); |
|
|
|
|
|
} |
|
|
|
|
|
lightUpdate(true, true); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
DEBUG_MSG_P(PSTR("Brightness: %d\n"), lightBrightness()); |
|
|
DEBUG_MSG_P(PSTR("Brightness: %d\n"), lightBrightness()); |
|
|
terminalOK(); |
|
|
terminalOK(); |
|
@ -1032,9 +1039,17 @@ void _lightInitCommands() { |
|
|
|
|
|
|
|
|
terminalRegisterCommand(F("MIRED"), [](Embedis* e) { |
|
|
terminalRegisterCommand(F("MIRED"), [](Embedis* e) { |
|
|
if (e->argc > 1) { |
|
|
if (e->argc > 1) { |
|
|
String color = String("M") + String(e->argv[1]); |
|
|
|
|
|
lightColor(color.c_str()); |
|
|
|
|
|
lightUpdate(true, true); |
|
|
|
|
|
|
|
|
const String value(e->argv[1]); |
|
|
|
|
|
String color = String("M"); |
|
|
|
|
|
if( value.length() > 0 ) { |
|
|
|
|
|
if( value[0] == '+' || value[0] == '-' ) { |
|
|
|
|
|
color += String(_light_mireds + String(e->argv[1]).toInt()); |
|
|
|
|
|
} else { |
|
|
|
|
|
color += String(e->argv[1]); |
|
|
|
|
|
} |
|
|
|
|
|
lightColor(color.c_str()); |
|
|
|
|
|
lightUpdate(true, true); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
DEBUG_MSG_P(PSTR("Color: %s\n"), lightColor().c_str()); |
|
|
DEBUG_MSG_P(PSTR("Color: %s\n"), lightColor().c_str()); |
|
|
terminalOK(); |
|
|
terminalOK(); |
|
|