Skip to main content

Python client for DayBetter devices and services

Project description

DayBetter Python Client

A Python client library for interacting with DayBetter devices and services.

Features

  • Device management and control
  • MQTT configuration retrieval
  • Authentication handling
  • Async/await support

Installation

pip install daybetter-services-python

Usage

import asyncio
from daybetter_python import DayBetterClient

async def main():
    async with DayBetterClient(token="your_token") as client:
        # Fetch devices
        devices = await client.fetch_devices()
        print(f"Found {len(devices)} devices")
        
        # Control a device
        result = await client.control_device(
            device_name="device_001",
            action=True,
            brightness=80
        )
        print(f"Control result: {result}")

if __name__ == "__main__":
    asyncio.run(main())

API Reference

DayBetterClient

Methods

  • fetch_devices(): Get list of devices
  • fetch_pids(): Get device type PIDs
  • control_device(device_name, action, brightness, hs_color, color_temp): Control a device
  • fetch_mqtt_config(): Get MQTT configuration

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

daybetter_services_python-1.0.7.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

daybetter_services_python-1.0.7-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file daybetter_services_python-1.0.7.tar.gz.

File metadata

File hashes

Hashes for daybetter_services_python-1.0.7.tar.gz
Algorithm Hash digest
SHA256 1b37eb01f55fa23f20e4088e1fcd559acc29d912e9b9e3182413dc6a16659257
MD5 b3b5d7f2cea1652f1d1f7a8a1c166024
BLAKE2b-256 205e6f65d76b60a6eed7a50f9ed09e189be2e422d8ddb955df2236d495feba02

See more details on using hashes here.

File details

Details for the file daybetter_services_python-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for daybetter_services_python-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b1aa01fd63ffe977575b75b98ef37e7c1891d683682ecb2801548f0fac051341
MD5 6029c6f46ae6c8fc94adb552e4575ce2
BLAKE2b-256 a5b68c4925b8a7c2921df1ac2b430c729b3e81dbb4a0b89fde057e1820deeb1d

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