MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _adjust_brightness

Method _adjust_brightness

pager/pager_menu.py:158–164  ·  view source on GitHub ↗

Adjust screen brightness. direction: +1 or -1.

(self, direction)

Source from the content-addressed store, hash-verified

156 pass
157
158 def _adjust_brightness(self, direction):
159 """Adjust screen brightness. direction: +1 or -1."""
160 cur = self.gfx.get_brightness()
161 max_br = self.gfx.get_max_brightness()
162 new = max(1, min(max_br, cur + direction))
163 if new != cur:
164 self.gfx.set_brightness(new)
165
166 def _wait_button(self):
167 """Wait for a button press using thread-safe event queue.

Callers 1

_wait_buttonMethod · 0.95

Calls 3

get_brightnessMethod · 0.45
get_max_brightnessMethod · 0.45
set_brightnessMethod · 0.45

Tested by

no test coverage detected