Skip to main content

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

Project description

๐ŸฆŽ Gecko IoT Client

[!CAUTION] ๐Ÿšจ HEAVY DEVELOPMENT IN PROGRESS ๐Ÿšจ

This project is under heavy active development and the API is rapidly changing.

  • โš ๏ธ Breaking changes expected in the coming days/weeks
  • ๐Ÿšซ Not recommended for production use until v1.0.0
  • ๐ŸŽฏ Use at your own risk for development/testing only
  • ๐Ÿ“… API stability target: Within November 2025

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

Current Development Phase

๐Ÿšง Alpha Stage - The project is currently in alpha development:

  • API Stability: โš ๏ธ APIs may change without notice
  • Production Use: โŒ Not recommended until v1.0.0
  • Testing: โœ… Suitable for development and testing
  • Feedback: ๐ŸŽฏ Highly appreciated via GitHub Issues

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-0.2.2.tar.gz (87.0 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-0.2.2-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gecko_iot_client-0.2.2.tar.gz
  • Upload date:
  • Size: 87.0 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-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0d4a99d3bc45964aab969071321518e03166dff801dc339ce5b7f53cdbbac46b
MD5 c5d0d2a64a3699bfe55488cff1bb972b
BLAKE2b-256 74f4940f52a004d86da191c0c59875c9076670c241ae8a9af64eeb4402805aac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gecko_iot_client-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 777659d66a3c5bb74c3b8d180c22c74a7e9aafb34e9991434cfaa878d88ba623
MD5 4f6a890c10a8dff829f90835e95728da
BLAKE2b-256 2af4d7e9bdc2cc04c8382f03412abfda320e741292f256af998aa72b3403431d

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