The Tree API service program provides a RESTful API service for controlling our IoTree's APA102 LED strip and servo. You can find the Tree API service program in the chapter14/tree_api_service folder. It contains the following files:
- README.md: The full API documentation with examples for the Tree API service program.
- main.py: This is the program's main entry point.
- config.py: Program configuration.
- apa102.py: A Python class that integrates with the APA102 LED strip. The core of this code is very similar to the APA102 Python code we explored back in Chapter 8, Lights, Indicators, and Displaying Information, only now it is structured as a Python class, uses a thread to run light animations, plus has a few other small additions, such as code to make the LEDs blink.
- apa102_api.py: Flask-RESTful resource classes that provide the APA102 API. It draws upon the Flask-RESTful code and examples from Chapter 3, Networking...