pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
575 stars 121 forks source link

eeprom.py SMBus needs to be closed #159

Open sleepydog3 opened 1 year ago

sleepydog3 commented 1 year ago

You need to close the SMBus in read_eeprom. Best place would be in a finally part of the try. See https://pypi.org/project/smbus2/ example

Gadgetoid commented 9 months ago

I'm not so sure this really matters, but if it does we'd need to be a little more careful about where the .close() goes since we should not assume that the user wants to close an SMBus object they've passed into the function.