def light_dim(level): if level <= 0 or level >= 6: return "Invalid Brightness" strip.off() strings.off() strings.on(level) # brightness = get_brightness() # string1.fadeIn(b) return f'DIM {level}'
def allOff(): strip.off() string1.off() string2.off()
import time from lightpi.hardware import strip, string1, string2 DELAY_SEC = 0.3 # Test the RGB Strip strip.red() time.sleep(DELAY_SEC) strip.green() time.sleep(DELAY_SEC) strip.blue() time.sleep(DELAY_SEC) strip.off() # Test the LED Strings string1.on() time.sleep(DELAY_SEC) string1.off() time.sleep(DELAY_SEC) string2.on() time.sleep(DELAY_SEC) string2.off() ################################################################################ # Helper Methods ################################################################################ def allOn(): strip.white()
def light_off(): strip.off() strings.off() return 'OFF'
def light_on(): strip.off() strings.on() return "ON"