From: brentru Date: Tue, 21 May 2024 17:32:19 +0000 (-0400) Subject: pylinten X-Git-Tag: 8.39.2^2~7 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/3d15d80420f6f61a17bf7e9c00a97863b4d96bb3 pylinten --- diff --git a/examples/generic_aio.py b/examples/generic_aio.py index 8504a7a..8e6c9c1 100644 --- a/examples/generic_aio.py +++ b/examples/generic_aio.py @@ -1,10 +1,11 @@ +# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries +# +# SPDX-License-Identifier: MIT import pytest import board import analogio # Analog Outputs - - def test_Ax_OUTPUT(): """Test analog output pin functionality.""" assert board.board_id == "GENERIC_AGNOSTIC_BOARD" diff --git a/examples/generic_dio.py b/examples/generic_dio.py index 98fde58..feb1f5b 100644 --- a/examples/generic_dio.py +++ b/examples/generic_dio.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries +# +# SPDX-License-Identifier: MIT import pytest import board import digitalio diff --git a/examples/generic_i2c.py b/examples/generic_i2c.py index 2884d5f..61ca8f0 100644 --- a/examples/generic_i2c.py +++ b/examples/generic_i2c.py @@ -1,8 +1,10 @@ +# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries +# +# SPDX-License-Identifier: MIT import pytest import busio from board import * - def test_i2c_scan_random(): i2c = busio.I2C(SCL, SDA) i2c.try_lock() diff --git a/src/adafruit_blinka/microcontroller/generic_agnostic_board/pin.py b/src/adafruit_blinka/microcontroller/generic_agnostic_board/pin.py index c527759..47d9754 100644 --- a/src/adafruit_blinka/microcontroller/generic_agnostic_board/pin.py +++ b/src/adafruit_blinka/microcontroller/generic_agnostic_board/pin.py @@ -71,6 +71,8 @@ class Pin: PULL_UP = 1 PULL_DOWN = 2 + # pylint: disable=no-self-use + def return_toggle(self): """Returns the pin's expected value, toggling between True and False""" toggle_state = not self.previous_value @@ -150,10 +152,10 @@ class Pin: self.current_value = self.pin_behavior.get(self.id)() # is pin a pull up and pin is LOW? - if self._pull == Pin.PULL_UP and self.current_value == False: + if self._pull == Pin.PULL_UP and self.current_value is False: self.current_value = False # is pin a pull down and pin is HIGH? - if self._pull == Pin.PULL_DOWN and self.current_value == True: + if self._pull == Pin.PULL_DOWN and self.current_value is True: self.current_value = False return self.current_value