Skip to content

Move import to I2C only section #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion adafruit_pm25.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
# imports
import time
import struct
from adafruit_bus_device.i2c_device import I2CDevice
from digitalio import Direction

__version__ = "0.0.0-auto.0"
Expand Down Expand Up @@ -125,6 +124,10 @@ class PM25_I2C(PM25):
"""

def __init__(self, i2c_bus, reset_pin=None, address=0x12):
# fmt: off
from adafruit_bus_device.i2c_device import I2CDevice # pylint: disable=import-outside-toplevel
# fmt: on

if reset_pin:
# Reset device
reset_pin.direction = Direction.OUTPUT
Expand Down