pimoroni / st7789-python

Python library to control an ST7789 240x240 1.3" TFT LCD display.
MIT License
198 stars 53 forks source link

st7789/__init__.py suggestion for two small changes #22

Open PaulskPt opened 2 years ago

PaulskPt commented 2 years ago

No problem encountered. Just a suggestion for two small changes. It is too few to arrange a PR. That is why I do my suggestion in this way. When I was looking into this st7789 module my eye 'fell' onto the following: in st7789/init.py, inside the class ST7789, function init(), Current situation: a) function reset() is called even when a reset pin has not been provided. Suggestion: move the call to self.reset() inside the if statement block so that a call to self.reset() only occurs when a reset pin is provided; b) suggestion to change the 'if rst is not None:' into 'if self._rst is not None:' as is done inside the reset() function while in line 129 is stated: 'self._rst = rst' . See the composed image.

pimoroni_st7789-python_suggested_change

Gadgetoid commented 2 years ago

These make sense! Thank you.

A PR would still be accepted if you'd like to make the contribution, otherwise I'll try and batch this change in before the next release.