More formatting
This commit is contained in:
parent
eb9ee4fa2e
commit
f345f11144
@ -1,15 +1,11 @@
|
|||||||
import busio
|
import busio
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
from supervisor import ticks_ms
|
from supervisor import ticks_ms
|
||||||
|
|
||||||
import adafruit_displayio_ssd1306
|
import adafruit_displayio_ssd1306
|
||||||
import displayio
|
import displayio
|
||||||
import terminalio
|
import terminalio
|
||||||
from adafruit_display_text import label
|
from adafruit_display_text import label
|
||||||
|
|
||||||
from kmk.kmktime import check_deadline
|
from kmk.kmktime import check_deadline
|
||||||
|
|
||||||
from kmk.extensions import Extension
|
from kmk.extensions import Extension
|
||||||
from kmk.handlers.stock import passthrough as handler_passthrough
|
from kmk.handlers.stock import passthrough as handler_passthrough
|
||||||
from kmk.keys import make_key
|
from kmk.keys import make_key
|
||||||
@ -194,10 +190,10 @@ class Oled(Extension):
|
|||||||
else 0.1
|
else 0.1
|
||||||
)
|
)
|
||||||
self._brightness = self._display.brightness # Save current brightness
|
self._brightness = self._display.brightness # Save current brightness
|
||||||
|
|
||||||
def timer_time_reset(self):
|
def timer_time_reset(self):
|
||||||
self._timer_start = ticks_ms()
|
self._timer_start = ticks_ms()
|
||||||
|
|
||||||
def dim(self):
|
def dim(self):
|
||||||
if not check_deadline(ticks_ms(), self._timer_start, self._off_time_ms):
|
if not check_deadline(ticks_ms(), self._timer_start, self._off_time_ms):
|
||||||
self._go_dark = True
|
self._go_dark = True
|
||||||
@ -206,4 +202,4 @@ class Oled(Extension):
|
|||||||
self._display.brightness = 0.2
|
self._display.brightness = 0.2
|
||||||
else:
|
else:
|
||||||
self._display.brightness = (self._brightness)
|
self._display.brightness = (self._brightness)
|
||||||
self._go_dark = False
|
self._go_dark = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user