]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
pylinten
authorbrentru <brent@adafruit.com>
Tue, 21 May 2024 17:32:19 +0000 (13:32 -0400)
committerbrentru <brent@adafruit.com>
Tue, 21 May 2024 17:32:19 +0000 (13:32 -0400)
examples/generic_aio.py
examples/generic_dio.py
examples/generic_i2c.py
src/adafruit_blinka/microcontroller/generic_agnostic_board/pin.py

index 8504a7af5648f3f14eabecf19e7d5579c32059f4..8e6c9c12e0280a32ff90025cf9f3101b309bdf92 100644 (file)
@@ -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"
index 98fde5807f6a96cac368440f8dbfdeaf6303c4ce..feb1f5b64c586a76d41c264fd7a11e92649cbac4 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 import pytest
 import board
 import digitalio
index 2884d5f08087378e78f6dd6a597a3b5eea2a2df9..61ca8f03d6053dded6477bbf48afa744c788645c 100644 (file)
@@ -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()
index c52775926518aeed1e60e5ac1f3c4f135c55b7ce..47d97545661e59b0c05c2a09905b46565f99a956 100644 (file)
@@ -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