From e79a9e92077160434524d7558f3d8174cc41755d Mon Sep 17 00:00:00 2001 From: Bob Clough Date: Wed, 19 Jun 2024 12:28:25 +0100 Subject: [PATCH] Fixes to allow the linting stage to pass --- modules/firmware_apps/patterninhibit.py | 2 +- modules/lib/flash_spi.py | 2 +- modules/scratchpad.py | 1 - modules/system/patterndisplay/app.py | 12 ++++++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/firmware_apps/patterninhibit.py b/modules/firmware_apps/patterninhibit.py index 07eb854..0352a5c 100644 --- a/modules/firmware_apps/patterninhibit.py +++ b/modules/firmware_apps/patterninhibit.py @@ -3,7 +3,7 @@ from events.input import Buttons, BUTTON_TYPES from system.eventbus import eventbus -from system.patterndisplay.events import * +from system.patterndisplay.events import PatternEnable,PatternDisable from tildagonos import tildagonos diff --git a/modules/lib/flash_spi.py b/modules/lib/flash_spi.py index d746d59..31d6287 100644 --- a/modules/lib/flash_spi.py +++ b/modules/lib/flash_spi.py @@ -44,7 +44,7 @@ def __init__( super().__init__(block_size, len(cspins), size * 1024, sec_size) # Select the correct command set - if (cmd5 is None and size <= 4096) or (cmd5 == False): + if (cmd5 is None and size <= 4096) or (not cmd5): self._cmds = _CMDS3BA self._cmdlen = 4 else: diff --git a/modules/scratchpad.py b/modules/scratchpad.py index 1fa04a0..715067d 100644 --- a/modules/scratchpad.py +++ b/modules/scratchpad.py @@ -1,5 +1,4 @@ from system.notification.app import NotificationService -from tildagonos import tildagonos from system.scheduler import scheduler as sc from system.hexpansion.app import HexpansionManagerApp diff --git a/modules/system/patterndisplay/app.py b/modules/system/patterndisplay/app.py index c66131e..9699b56 100644 --- a/modules/system/patterndisplay/app.py +++ b/modules/system/patterndisplay/app.py @@ -2,7 +2,7 @@ from tildagonos import tildagonos import settings import asyncio -from system.patterndisplay.events import * +from system.patterndisplay.events import PatternEnable, PatternDisable, PatternReload from system.eventbus import eventbus @@ -23,7 +23,7 @@ def load_pattern(self): _pmodule = __import__(_patternpath, globals(), locals(), [_patternclass]) _pclass = getattr(_pmodule, _patternclass) self._p = _pclass() - except: + except ModuleNotFoundError: raise ImportError(f"Pattern {self.pattern} not found!") async def _enable(self, event: PatternEnable): @@ -40,13 +40,13 @@ async def background_task(self): brightness = settings.get("pattern_brightness", 0.1) next_frame = self._p.next() if self.enabled: - for l in range(12): + for led in range(12): if brightness < 1.0: - tildagonos.leds[l + 1] = tuple( - int(i * brightness) for i in next_frame[l] + tildagonos.leds[led + 1] = tuple( + int(i * brightness) for i in next_frame[led] ) else: - tildagonos.leds[l + 1] = next_frame[l] + tildagonos.leds[led + 1] = next_frame[led] tildagonos.leds.write() if not self._p.fps: break