Beispiel #1
0
 def applyEffect(self, effect: Effect) -> None:
     self._copyEffect(effect)
     settings = self.effect.getSettings()
     if type(effect) == Off:
         settings.setParam(3, BYTE(0))
     elif type(effect) == Static:
         settings.setParam(3, BYTE(1))
     elif type(effect) == Cycle:
         settings.setParam(3, BYTE(2))
     elif type(effect) == Breathing:
         settings.setParam(3, BYTE(3))
     settings.setId(self._getId())
Beispiel #2
0
 def resetIds(self) -> None:
     self.settings.setId(BYTE(0x0B))
     self.settings.setParam(3, BYTE(0x05))
Beispiel #3
0
 def value(self, profile: int) -> BYTE:
     validate_range(profile, 0, 1)
     return BYTE(Brightness.profiles[profile][self.level])
Beispiel #4
0
 def value(self, profile: int) -> BYTE:
     validate_range(profile, 0, 4)
     return BYTE(Speed.profiles[profile][self.level])
Beispiel #5
0
 def _getId(self) -> BYTE:
     return BYTE(0x05)