🦎 Gecko IoT Client
A modern, asynchronous Python client library for Gecko IoT devices with AWS IoT integration. Control and monitor your Gecko-powered spas, hot tubs, and pool equipment with ease.
✨ Features
- 🌐 AWS IoT Integration: Secure MQTT communication via AWS IoT Core
- 🏊 Multi-Zone Control: Temperature, lighting, and flow zone management
- 📡 Real-time Updates: Event-driven state synchronization
- 🔄 Async/Await Support: Modern Python async programming patterns
- 🛡️ Type Safety: Full type hints and mypy compatibility
- 📊 Comprehensive Logging: Detailed debug and monitoring capabilities
- 🧪 Well Tested: Extensive test suite with code coverage
- 📖 Rich Documentation: Auto-generated API docs and examples
🚀 Quick Start
Installation
pip install gecko-iot-client
Basic Usage
import asyncio
from gecko_iot_client import GeckoIotClient
from gecko_iot_client.transporters.mqtt import MqttTransporter
async def main():
# Create MQTT transporter with your AWS IoT endpoint
transporter = MqttTransporter(
endpoint="wss://your-endpoint.iot.region.amazonaws.com/mqtt",
device_id="your-device-id"
)
# Initialize client
client = GeckoIotClient(idd="your-device-id", transporter=transporter)
async with client:
# Get all temperature control zones
temp_zones = client.get_zones_by_type(ZoneType.TEMPERATURE_CONTROL_ZONE)
for zone in temp_zones:
print(f"Zone {zone.name}: {zone.temperature}°C (target: {zone.target_temperature}°C)")
# Control lighting
lighting_zones = client.get_zones_by_type(ZoneType.LIGHTING_ZONE)
if lighting_zones:
light = lighting_zones[0]
await light.activate() # Turn on
await light.set_color(255, 0, 0) # Set to red
if __name__ == "__main__":
asyncio.run(main())
🏗️ Architecture
Zone Types
The client supports three main zone types:
- 🌡️ Temperature Control Zones: Heater and temperature management
- 💡 Lighting Zones: LED lighting control with color support
- 🌊 Flow Zones: Pump and circulation control
Event System
def on_temperature_change(zone, old_temp, new_temp):
print(f"Temperature changed from {old_temp}°C to {new_temp}°C")
client.register_zone_callbacks(lambda zone_name: on_temperature_change)
📁 Project Structure
gecko-iot-client/
├── .github/workflows/ # CI/CD pipelines
├── gecko_iot_client/ # Main package
│ ├── src/ # Source code
│ │ └── gecko_iot_client/
│ │ ├── models/ # Data models and zone types
│ │ └── transporters/ # Communication layers
│ ├── tests/ # Test suite
│ ├── docs/ # Sphinx documentation
│ └── examples/ # Usage examples
└── README.md # This file
🛠️ Development
Prerequisites
- Python 3.13+
- Poetry (recommended) or pip
Setup
# Clone the repository
git clone https://github.com/geckoal/gecko-iot-client.git
cd gecko-iot-client
# Install dependencies
cd gecko_iot_client
pip install -e ".[dev,docs]"
# Run tests
pytest tests/ --cov=gecko_iot_client
# Format code
black src/ tests/
isort src/ tests/
# Build documentation
sphinx-build docs/source docs/build/html
# Generate changelog from git history
./scripts/generate-changelog.sh
# or using the Python entry point
gecko-build-changelog
Running Examples
# Run the demo script
python gecko_iot_client/examples/demo.py
📚 Documentation
- 📖 Full Documentation - Complete API reference and guides
- 🎯 Quick Start Guide - Get up and running fast
- 🔧 Configuration - Setup and configuration options
- 💡 Examples - Code examples and use cases
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
pytest) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📊 Testing & Quality
- ✅ Automated Testing: GitHub Actions run tests on every push and PR
- 📈 Code Coverage: Monitored via SonarCloud with detailed quality reports
- 🔍 Code Quality: SonarCloud analysis with Black, isort, and flake8 for consistent style
- 📝 Documentation: Auto-generated and deployed on every release
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
🏷️ Versioning Strategy
This project follows Semantic Versioning (SemVer) combined with PEP 440 for Python compatibility.
Version Format
MAJOR.MINOR.PATCH[-PRERELEASE]
- MAJOR: Breaking changes (incompatible API changes)
- MINOR: New features (backward-compatible functionality)
- PATCH: Bug fixes (backward-compatible fixes)
Git Tag Format
All releases use the v prefix in git tags:
# Release versions
v1.0.0 # Major release
v1.1.0 # Minor release
v1.1.1 # Patch release
# Pre-release versions
v1.0.0-alpha.1 # Alpha release
v1.0.0-beta.1 # Beta release
v1.0.0-rc.1 # Release candidate
Release Lifecycle
| Stage | Git Tag Example | PyPI Version | Purpose |
|---|---|---|---|
| Alpha | v0.1.0-alpha.1 |
0.1.0a1 |
Early development, internal testing |
| Beta | v0.1.0-beta.1 |
0.1.0b1 |
Feature complete, external testing |
| Release Candidate | v0.1.0-rc.1 |
0.1.0rc1 |
Final validation before release |
| Stable Release | v0.1.0 |
0.1.0 |
Production ready |
| Patch Release | v0.1.1 |
0.1.1 |
Bug fixes only |
| Minor Release | v0.2.0 |
0.2.0 |
New features, backward compatible |
| Major Release | v1.0.0 |
1.0.0 |
Breaking changes |
Version Detection
Versions are automatically determined from git tags using setuptools-scm:
import gecko_iot_client
print(gecko_iot_client.__version__) # e.g., "0.1.0a2.post1"
Version Components:
0.1.0a2- Alpha version 2 of release 0.1.0.post1- 1 commit after the tagged release+dirty- Local uncommitted changes (development builds)
Release Process
- Development happens on the
developbranch - Tagging creates releases:
git tag v0.1.0-alpha.3 && git push origin v0.1.0-alpha.3 - GitHub Actions automatically builds and publishes to PyPI
- Documentation is automatically updated and deployed
🏷️ Version History
See CHANGELOG.md for a detailed version history.
Made with ❤️ by the Gecko Team Powering the future of spa control
Metadata
Release files for gecko-iot-client 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gecko_iot_client-1.0.3.tar.gz | 106.9 kB | Without provenance | Details for gecko_iot_client-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gecko_iot_client-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for gecko_iot_client-1.0.3-py3-none-any.whl |
Total release size: 175.6 kB
Release files / gecko_iot_client-1.0.3.tar.gz
| Download URL | gecko_iot_client-1.0.3.tar.gz |
|---|---|
| Size | 106.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18bbb5da60ba0312a70106987ba7484eabab0c954a45fde2bfe038bc61608985
|
|
BLAKE2b-256 checksum How to use checksums |
c0a016851be9882ef50ea5710e441588cbeeb7f99fe9c3d39ab84cec4b1d73ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / gecko_iot_client-1.0.3-py3-none-any.whl
| Download URL | gecko_iot_client-1.0.3-py3-none-any.whl |
|---|---|
| Size | 68.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3b5a402f1f5e746740400c031501040c45d5fe12aa28e8d73b40c057a9fe680
|
|
BLAKE2b-256 checksum How to use checksums |
ec58b663145a489aacf22a6c0a484aecdba36be6fd8b15127e63398727991183
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for gecko-iot-client 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.