Skip to main content

A Python client library for Gecko IoT devices with AWS IoT integration

Project description

๐ŸฆŽ Gecko IoT Client

Python Version License Tests Documentation Quality Gate Status Coverage PyPI Version

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

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (pytest)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. 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

๐Ÿท๏ธ 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

  1. Development happens on the develop branch
  2. Tagging creates releases: git tag v0.1.0-alpha.3 && git push origin v0.1.0-alpha.3
  3. GitHub Actions automatically builds and publishes to PyPI
  4. 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 smart pool and spa control

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gecko_iot_client-1.0.0.tar.gz (86.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gecko_iot_client-1.0.0-py3-none-any.whl (64.7 kB view details)

Uploaded Python 3

File details

Details for the file gecko_iot_client-1.0.0.tar.gz.

File metadata

  • Download URL: gecko_iot_client-1.0.0.tar.gz
  • Upload date:
  • Size: 86.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gecko_iot_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d1f72dba599fd06be6493060f579005058578f381bbcd04cd694c2498d43e5d2
MD5 75c142ee5f6309530c5eb618e24a318b
BLAKE2b-256 102badd5a49208a4b754fd2d2a27b408c79874d98c8bec241a2b0632a1056cb2

See more details on using hashes here.

File details

Details for the file gecko_iot_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gecko_iot_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c10ca7f639efb0ecd3393ef12c3c879f0369ed6948c18187e8f2a45c69a476f6
MD5 d9f88ddda5710c007000963517968ce3
BLAKE2b-256 6c5e3d0f4c3b3257d9710ce4f3e09a031514a66881a5d37fb06c2ae55a2fd2c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page