Skip to content

Commit cd3f9a8

Browse files
committed
fix movement check call
1 parent eb31a88 commit cd3f9a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

adafruit_pybadger/pybadger_base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ def _create_badge_background(self) -> None:
164164
self.show(self._background_group)
165165

166166
if self._background_image_filename:
167-
file_handle = open(self._background_image_filename, "rb")
167+
file_handle = open( # pylint: disable=consider-using-with
168+
self._background_image_filename, "rb"
169+
)
168170
on_disk_bitmap = displayio.OnDiskBitmap(file_handle)
169171
background_image = displayio.TileGrid(
170172
on_disk_bitmap,
@@ -416,7 +418,7 @@ def auto_dim_display(self, delay: float = 5.0, movement_threshold: int = 10):
416418
pybadger.auto_dim_display(delay=10)
417419
"""
418420
current_time = time.monotonic()
419-
if self._check_for_movement(movement_threshold=movement_threshold:
421+
if self._check_for_movement(movement_threshold=movement_threshold):
420422
self.activity(current_time)
421423
if current_time - self._start_time > delay:
422424
self.display.brightness = 0.1
@@ -541,7 +543,7 @@ def show_business_card(
541543
business_card_label_groups.append(email_two_group)
542544

543545
business_card_splash = displayio.Group()
544-
image_file = open(image_name, "rb")
546+
image_file = open(image_name, "rb") # pylint: disable=consider-using-with
545547
on_disk_bitmap = displayio.OnDiskBitmap(image_file)
546548
face_image = displayio.TileGrid(
547549
on_disk_bitmap, pixel_shader=on_disk_bitmap.pixel_shader

0 commit comments

Comments
 (0)