Skip to content

Commit

Permalink
DM: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed May 2, 2018
1 parent 39538ef commit fcb8599
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions adafruit_seesaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from micropython import const
from adafruit_bus_device.i2c_device import I2CDevice
import digitalio
import struct

_STATUS_BASE = const(0x00)
_GPIO_BASE = const(0x01)
Expand Down Expand Up @@ -200,7 +201,8 @@ def direction(self, value):
def value(self):
if self._direction == digitalio.Direction.OUTPUT:
return self._value
return self._seesaw.digital_read(self._pin)
else:
return self._seesaw.digital_read(self._pin)

@value.setter
def value(self, val):
Expand Down Expand Up @@ -229,7 +231,7 @@ def pull(self, mode):
raise ValueError("Pull Down currently not supported")
elif mode == digitalio.Pull.UP:
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT_PULLUP)
elif mode is None:
elif mode == None:
self._seesaw.pin_mode(self._pin, self._seesaw.INPUT)
else:
raise ValueError("Out of range")
Expand Down Expand Up @@ -421,8 +423,10 @@ def set_GPIO_interrupts(self, pins, enabled):
else:
self.write(_GPIO_BASE, _GPIO_INTENCLR, cmd)

def get_neopixel(self, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_order=None):
return SeesawNeopixel(self, pin, n)
def get_neopixel(self, pin, n, bpp=3, brightness=1.0, auto_write=True,
pixel_order=None):
return SeesawNeopixel(self, pin, n, bpp=bpp, brightness=brightness,
auto_write=auto_write, pixel_order=pixel_order)

def get_analog_in(self, pin):
return AnalogInput(self, pin)
Expand Down Expand Up @@ -579,7 +583,7 @@ def read8(self, reg_base, reg):
def read(self, reg_base, reg, buf, delay=.001):
self.write(reg_base, reg)
if self._drdy != None:
while self._drdy.value is False:
while self._drdy.value == False:
pass
else:
time.sleep(delay)
Expand All @@ -592,7 +596,7 @@ def write(self, reg_base, reg, buf=None):
full_buffer += buf

if self._drdy != None:
while self._drdy.value is False:
while self._drdy.value == False:
pass
with self.i2c_device as i2c:
i2c.write(full_buffer)
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = ["adafruit_bus_device", "micropython", "digitalio"]
autodoc_mock_imports = ["adafruit_bus_device", "micropython", "digitalio", "struct"]

intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

Expand Down

0 comments on commit fcb8599

Please sign in to comment.