added set_all_channel method

reintroduced caching of stripes & controllers
added session cleanup handling
renamed --daemon to --detach for better understanding
added coloredlogs to make logs better readable and more appealing
This commit is contained in:
Giovanni Harting
2015-10-15 13:26:36 +02:00
parent 4c052b8edb
commit 01ba0a4d2c
4 changed files with 82 additions and 28 deletions

View File

@@ -76,6 +76,10 @@ class Controller(Base):
4095))
self.bus.write_word_data(self._address, LED0_ON_L + 4 * channel, 0)
def set_all_channel(self, val):
self.bus.write_word_data(self._address, ALLLED_OFF_L, int(val * 4095))
self.bus.write_word_data(self._address, ALLLED_ON_L, 0)
@staticmethod
def gamma_correct(gamma, val, maxval):
corrected = int(pow(float(val) / float(maxval), float(gamma)) * float(maxval) + 0.5)