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())
def resetIds(self) -> None: self.settings.setId(BYTE(0x0B)) self.settings.setParam(3, BYTE(0x05))
def value(self, profile: int) -> BYTE: validate_range(profile, 0, 1) return BYTE(Brightness.profiles[profile][self.level])
def value(self, profile: int) -> BYTE: validate_range(profile, 0, 4) return BYTE(Speed.profiles[profile][self.level])
def _getId(self) -> BYTE: return BYTE(0x05)