From 2faa46989ed782c1b147a08aa2403239752da61e Mon Sep 17 00:00:00 2001 From: piekstra Date: Fri, 30 Jan 2026 18:09:58 -0500 Subject: [PATCH] Add community templates and contribution guidelines --- .github/ISSUE_TEMPLATE/bug_report.md | 52 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 28 ++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 19 +++++++ CONTRIBUTING.md | 63 +++++++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b53b18d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,52 @@ +--- +name: Bug report +about: Report a bug or unexpected behavior +title: '' +labels: bug +assignees: '' +--- + +## Description + + + +## Device info + +- **Device model**: +- **Device firmware version** (if known): + +## Environment + +- **Python version**: +- **tplink-cloud-api version**: +- **OS**: + +## Steps to reproduce + +1. +2. +3. + +## Expected behavior + + + +## Actual behavior + + + +## Code snippet + +```python +# Minimal code to reproduce the issue +``` + +## Error output + +``` +# Any error messages or stack traces +``` + +## Additional context + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..fdd4f38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,28 @@ +--- +name: Feature request +about: Suggest a new feature or enhancement +title: '' +labels: enhancement +assignees: '' +--- + +## Description + + + +## Use case + + + +## Proposed solution + + + +## Device support + + +- **Device model**: + +## Additional context + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1f3446c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +## Summary + + + +## Changes + + + +## Test plan + + +- [ ] Ran `pytest --verbose` locally +- [ ] Tested with a real TP-Link device (if applicable) + +## Checklist + +- [ ] Code follows existing patterns in the codebase +- [ ] Added/updated tests for new functionality (if applicable) +- [ ] README updated (if applicable) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4467b36 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,63 @@ +# Contributing to tplink-cloud-api + +Thanks for your interest in contributing! This document outlines how to get started. + +## Development setup + +1. Clone the repository: + ```bash + git clone https://github.com/piekstra/tplink-cloud-api.git + cd tplink-cloud-api + ``` + +2. Create a virtual environment: + ```bash + python3 -m venv venv + source venv/bin/activate # On Windows: venv\Scripts\activate + ``` + +3. Install dependencies: + ```bash + pip install -r requirements.txt + pip install -e . + ``` + +## Running tests + +This project uses `wiremock` to mock the TP-Link API for testing. + +1. Start the wiremock service: + ```bash + docker compose up -d + ``` + +2. Run the tests: + ```bash + pytest --verbose + ``` + +See the [Testing section](README.md#testing) in the README for details on environment configuration. + +## Submitting changes + +1. Fork the repository +2. Create a feature branch (`git checkout -b my-feature`) +3. Make your changes +4. Run tests to ensure they pass +5. Commit your changes with a descriptive message +6. Push to your fork and open a pull request + +## Adding support for new devices + +If you'd like to add support for a new TP-Link device: + +1. Open an issue first to discuss the device and its capabilities +2. If you have the device, capture the API responses it produces (device info, sys info, etc.) +3. Add wiremock mappings in `tests/wiremock/mappings/` for the new device +4. Implement the device class following existing patterns +5. Add tests for the new device +6. Update the README with the new device in the compatibility list + +## Questions? + +Feel free to open an issue if you have questions or need help getting started.