@ -161,7 +161,8 @@ LEDControl_::focusHook (const char *command) {
enum {
enum {
SETALL ,
SETALL ,
MODE ,
MODE ,
AT
AT ,
THEME ,
} subCommand ;
} subCommand ;
if ( strncmp_P ( command , PSTR ( " led. " ) , 4 ) ! = 0 )
if ( strncmp_P ( command , PSTR ( " led. " ) , 4 ) ! = 0 )
@ -172,6 +173,8 @@ LEDControl_::focusHook (const char *command) {
subCommand = SETALL ;
subCommand = SETALL ;
else if ( strcmp_P ( command + 4 , PSTR ( " mode " ) ) = = 0 )
else if ( strcmp_P ( command + 4 , PSTR ( " mode " ) ) = = 0 )
subCommand = MODE ;
subCommand = MODE ;
else if ( strcmp_P ( command + 4 , PSTR ( " theme " ) ) = = 0 )
subCommand = THEME ;
else
else
return false ;
return false ;
@ -226,6 +229,32 @@ LEDControl_::focusHook (const char *command) {
}
}
break ;
break ;
}
}
case THEME :
{
if ( Serial . peek ( ) = = ' \n ' ) {
for ( uint8_t idx = 0 ; idx < LED_COUNT ; idx + + ) {
cRGB c = LEDControl . led_get_crgb_at ( idx ) ;
Focus . printColor ( c ) ;
Focus . printSpace ( ) ;
}
Serial . println ( ) ;
break ;
}
uint8_t idx = 0 ;
while ( idx < LED_COUNT & & Serial . peek ( ) ! = ' \n ' ) {
cRGB color ;
color . r = Serial . parseInt ( ) ;
color . g = Serial . parseInt ( ) ;
color . b = Serial . parseInt ( ) ;
LEDControl . led_set_crgb_at ( idx , color ) ;
idx + + ;
}
break ;
}
}
}
return true ;
return true ;