File tree Expand file tree Collapse file tree
shared-bindings/supervisor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,16 +76,15 @@ STATIC mp_obj_t supervisor_disable_autoreload(void) {
7676MP_DEFINE_CONST_FUN_OBJ_0 (supervisor_disable_autoreload_obj , supervisor_disable_autoreload );
7777
7878//| def set_rgb_status_brightness(brightness: int) -> None:
79- //| """Set brightness of status neopixel from 0-255
80- //| `set_rgb_status_brightness` is called."""
79+ //| """Set brightness of status RGB LED from 0-255. This will take effect
80+ //| after the current code finishes and the status LED is used to show
81+ //| the finish state."""
8182//| ...
8283//|
8384STATIC mp_obj_t supervisor_set_rgb_status_brightness (mp_obj_t lvl ) {
8485 // This must be int. If cast to uint8_t first, will never raise a ValueError.
8586 int brightness_int = mp_obj_get_int (lvl );
86- if (brightness_int < 0 || brightness_int > 255 ) {
87- mp_raise_ValueError (translate ("Brightness must be between 0 and 255" ));
88- }
87+ mp_arg_validate_int_range (brightness_int , 0 , 255 , MP_QSTR_brightness );
8988 set_status_brightness ((uint8_t )brightness_int );
9089 return mp_const_none ;
9190}
You can’t perform that action at this time.
0 commit comments