Closed PeterKenyon closed 8 years ago
You are correct! This is my mistake. This will execute, but will reassign the function to the state value. Well spotted, I'll fix it asap.
Just to demonstrate the error:
>>> class Node():
... power = 0
... def power(self):
... self.power = 5
... return self.power
...
>>> n = Node()
>>> n.power()
5
>>> n.power()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
I saw you have changed this to use a backing variable power_on but doesn't that require it to be initialised somewhere, (also for backlight),
They're both initialised in the st7735.py#L64. So when you inherit your class from TFT, your class will inherit those too.
oh OK, just keeping you on your toes ;-)
how does the power method work, shurely this isn't what was intended. line 100 says self.power = state BUT self.power is the name of the method bizarre??