adafruit / Adafruit_CircuitPython_EMC2101

CircuitPython driver for EMC2101 brushless fan controller
MIT License
3 stars 9 forks source link

emc2101_enums import not working #31

Closed caternuson closed 1 year ago

caternuson commented 1 year ago

The import being done in the setter for spinup_drive doesn't seem to work as expected. The issue exists on both native CP and Blinka setups.

CircuitPython

Adafruit CircuitPython 8.2.2 on 2023-07-31; Adafruit QT Py RP2040 with rp2040
>>> import board
>>> from adafruit_emc2101 import EMC2101
>>> i2c = board.STEMMA_I2C()
>>> emc = EMC2101(i2c)
>>> emc.spinup_drive
3
>>> emc.spinup_drive = 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_emc2101/__init__.py", line 446, in spinup_drive
ImportError: no module named 'emc2101_enums'
>>> from adafruit_emc2101 import emc2101_enums
>>>

Blinka w/ RPI:

(blinka) pi@raspberrypi:~ $ python3
Python 3.9.2 (default, Mar 12 2021, 04:06:34) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> from adafruit_emc2101 import EMC2101
>>> i2c = board.I2C()
>>> emc = EMC2101(i2c)
>>> emv.spinup_drive
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'emv' is not defined
>>> emc.spinup_drive
3
>>> emc.spinup_drive = 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/blinka/lib/python3.9/site-packages/adafruit_emc2101/__init__.py", line 446, in spinup_drive
    from emc2101_enums import SpinupDrive
ModuleNotFoundError: No module named 'emc2101_enums'
>>> from adafruit_emc2101 import emc2101_enums
>>> 
FoamyGuy commented 1 year ago

resolved by #32