@@ -209,8 +209,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_wait_for_frame_obj, displayio_displa
209
209
//| .. attribute:: brightness
210
210
//|
211
211
//| The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When
212
- //| `auto_brightness` is True this value will change automatically and setting it will have no
213
- //| effect. To control the brightness, auto_brightness must be false .
212
+ //| `auto_brightness` is True, the value of `brightness` will change automatically.
213
+ //| If `brightness` is set, ` auto_brightness` will be disabled and will be set to False .
214
214
//|
215
215
STATIC mp_obj_t displayio_display_obj_get_brightness (mp_obj_t self_in ) {
216
216
displayio_display_obj_t * self = native_display (self_in );
@@ -224,6 +224,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_brightness_obj, displayio_displa
224
224
225
225
STATIC mp_obj_t displayio_display_obj_set_brightness (mp_obj_t self_in , mp_obj_t brightness ) {
226
226
displayio_display_obj_t * self = native_display (self_in );
227
+ common_hal_displayio_display_set_auto_brightness (self , false);
227
228
bool ok = common_hal_displayio_display_set_brightness (self , mp_obj_get_float (brightness ));
228
229
if (!ok ) {
229
230
mp_raise_RuntimeError (translate ("Brightness not adjustable" ));
@@ -241,7 +242,10 @@ const mp_obj_property_t displayio_display_brightness_obj = {
241
242
242
243
//| .. attribute:: auto_brightness
243
244
//|
244
- //| True when the display brightness is auto adjusted.
245
+ //| True when the display brightness is adjusted automatically, based on an ambient
246
+ //| light sensor or other method. Note that some displays may have this set to True by default,
247
+ //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False
248
+ //| if `brightness` is set manually.
245
249
//|
246
250
STATIC mp_obj_t displayio_display_obj_get_auto_brightness (mp_obj_t self_in ) {
247
251
displayio_display_obj_t * self = native_display (self_in );
0 commit comments