diff --git a/.github/workflows/release_gh.yml b/.github/workflows/release_gh.yml index b8aa8d6..9acec60 100644 --- a/.github/workflows/release_gh.yml +++ b/.github/workflows/release_gh.yml @@ -16,3 +16,4 @@ jobs: uses: adafruit/workflows-circuitpython-libs/release-gh@main with: github-token: ${{ secrets.GITHUB_TOKEN }} + upload-url: ${{ github.event.release.upload_url }} diff --git a/.gitignore b/.gitignore index 544ec4a..db3d538 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ _build # Virtual environment-specific files .env +.venv # MacOS-specific files *.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e5fccc..70ade69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,21 +4,21 @@ repos: - repo: https://github.com/python/black - rev: 22.3.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/fsfe/reuse-tool - rev: v0.14.0 + rev: v1.1.2 hooks: - id: reuse - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.4.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v2.15.5 + rev: v2.17.4 hooks: - id: pylint name: pylint (library code) diff --git a/adafruit_as7341.py b/adafruit_as7341.py index 75800a4..65e9535 100644 --- a/adafruit_as7341.py +++ b/adafruit_as7341.py @@ -352,7 +352,6 @@ class AS7341: # pylint:disable=too-many-instance-attributes, no-member def __init__( self, i2c_bus: busio.I2C, address: int = _AS7341_I2CADDR_DEFAULT ) -> None: - self.i2c_device = i2c_device.I2CDevice(i2c_bus, address) if not self._device_id in [_AS7341_DEVICE_ID]: raise RuntimeError("Failed to find an AS7341 sensor - check your wiring!") @@ -454,7 +453,6 @@ def _wait_for_data(self, timeout: float = 1.0) -> None: sleep(0.001) def _write_register(self, addr: int, data: int) -> None: - self._buffer[0] = addr self._buffer[1] = data @@ -512,7 +510,7 @@ def _configure_f5_f8(self) -> None: def flicker_detected(self) -> Optional[int]: """The flicker frequency detected in Hertz""" if not self._flicker_detection_1k_configured: - AttributeError( + raise AttributeError( "Flicker detection must be enabled to access `flicker_detected`" ) flicker_status = self._fd_status diff --git a/examples/as7341_flicker_detection.py b/examples/as7341_flicker_detection.py index 38cac7d..fa249a9 100644 --- a/examples/as7341_flicker_detection.py +++ b/examples/as7341_flicker_detection.py @@ -10,7 +10,6 @@ sensor.flicker_detection_enabled = True while True: - flicker_detected = sensor.flicker_detected if flicker_detected: print("Detected a %d Hz flicker" % flicker_detected) diff --git a/examples/as7341_simpletest.py b/examples/as7341_simpletest.py index 52f012d..b6fed31 100644 --- a/examples/as7341_simpletest.py +++ b/examples/as7341_simpletest.py @@ -15,7 +15,6 @@ def bar_graph(read_value): while True: - print("F1 - 415nm/Violet %s" % bar_graph(sensor.channel_415nm)) print("F2 - 445nm//Indigo %s" % bar_graph(sensor.channel_445nm)) print("F3 - 480nm//Blue %s" % bar_graph(sensor.channel_480nm))