Smart Lamp is a smart IOT device that can be programmed using HTTP/MQTT protocols. Functionalities include:
- Setting RGB lights to shuffle
- Automatic turn on/off depending on proximity and light sensors
- Remote turning on/off
- Reading mode
- Remote intensity of light
AsyncAPI and OpenAPI specification files are provided. To access swagger documentation, please
start the application, and navigate to /docs
.
- Python3
- Pip
- MQTT broker, preferably a local one
- FastAPI
- pydantic
- numpy
- fastapi_mqtt
All of the required packages are provided in requirements.txt
. You can install those using:
pip install -r requirements.txt
For MQTT installation please refer to the steps specific to your operating system.
First of all, create an MQTT user:password pair, using the following credentials: test:test
.
The application can be ran using uvicorn.
uvicorn app:app --reload
Tests can be ran after starting the application, using the following command:
python tests.py
If no errors are present, then the tests ran succesfully.
Please refer to the Swagger documentation page.