Thanks for your interest in contributing! This document outlines how to get started.
-
Clone the repository:
git clone https://github.com/piekstra/tplink-cloud-api.git cd tplink-cloud-api -
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt pip install -e .
This project uses wiremock to mock the TP-Link API for testing.
-
Start the wiremock service:
docker compose up -d
-
Run the tests:
pytest --verbose
See the Testing section in the README for details on environment configuration.
- Fork the repository
- Create a feature branch (
git checkout -b my-feature) - Make your changes
- Run tests to ensure they pass
- Commit your changes with a descriptive message
- Push to your fork and open a pull request
If you'd like to add support for a new TP-Link device:
- Open an issue first to discuss the device and its capabilities
- If you have the device, capture the API responses it produces (device info, sys info, etc.)
- Add wiremock mappings in
tests/wiremock/mappings/for the new device - Implement the device class following existing patterns
- Add tests for the new device
- Update the README with the new device in the compatibility list
Feel free to open an issue if you have questions or need help getting started.