animationNames = [] for (_, name, _) in pkgutil.iter_modules([Path('/home/pi/LEDWebsite/src/animations')]): animations.append(import_module('animations.' + name, package=__name__)) for i in dir(animations[len(animations) - 1]): attribute = getattr(animations[len(animations) - 1], i) for i in dir(animations[len(animations) - 1]): attribute = getattr(animations[len(animations) - 1], i) if inspect.isclass(attribute): setattr(sys.modules[__name__], name, attribute) # Set up the preferences class preferences = Preferences() # Define the number of pixels for the LED Strip numPixels = preferences.get_setup_preferences('num-pixels') # Initializes the LED strip pixels = neopixel.NeoPixel( board.D18, numPixels, brightness=preferences.get_setup_preferences('brightness'), auto_write=False, pixel_order=neopixel.GRB) def getAnimationOptions(): global thread return thread.getOptions()