Closed vdbpeter closed 5 years ago
For ones like this, I usually use a single method with a boolean arg, eg.
def power_on(self, on=True):
self._write(_SHUTDOWN, 0 if on else 1)
Later, when I'm reading a power_on()
, I find it more clear what's going on than seeing a normal()
.
Yes- your construct is more elegant! :-)
The Maxim Max7219 Datasheet has some good use cases in the "Shutdown Mode" paragraph.