Metadata-Version: 2.4
Name: govee-h6199-ble
Version: 2.0.0
Summary: Manage Govee DreamView T1 (H6199) BLE devices
License: Copyright (c) 2024 Mikalai Kukhta and individual contributors.
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
License-File: LICENSE
Keywords: ble,govee,h6199,dreamview
Author: Mikalai Kukhta
Author-email: mikalai.kukhta@gmail.com
Requires-Python: >=3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: bleak (>=0.15.1)
Project-URL: Issues, https://github.com/NecroKote/pygovee-h6199-ble/issues
Project-URL: Repository, https://github.com/NecroKote/pygovee-h6199-ble
Description-Content-Type: text/markdown

# Govee DreamView T1 (H6199) BLE client

[![version](https://img.shields.io/pypi/v/govee-h6199-ble)](https://pypi.org/project/govee-h6199-ble)
[![python version](https://img.shields.io/pypi/pyversions/govee-h6199-ble)](https://github.com/NecroKote/pygovee-h6199-ble)
[![license](https://img.shields.io/github/license/necrokote/pygovee-h6199-ble)](https://github.com/NecroKote/pygovee-h6199-ble/blob/main/LICENSE)

Control the Govee DreamView T1 (H6199) from Python over Bluetooth Low Energy (BLE).

## Install

Python 3.11 or newer is required.

```sh
python -m pip install govee-h6199-ble
```

## Usage

Pass an already connected `BleakClient` to `GoveeH6199`. The library reads device information when first needed and selects commands appropriate for the device’s firmware and protocol generation. A capability-gated operation raises `UnsupportedFeature` if the required capability is unavailable. See [capabilities](docs/capabilities.md) for details.

## Limitations

Scenes and DIY are not supported. Music sensitivity, fixed color and the calm flag cannot be read back. See [hardware coverage](docs/advanced.md#hardware-coverage) for tested firmware.

## Quick start

```python
import asyncio

from bleak import BleakClient, BleakScanner
from govee_h6199_ble import GoveeH6199


async def main():
    device = await BleakScanner.find_device_by_filter(
        lambda d, _: bool(d.name and d.name.startswith("Govee_H6199"))
    )
    if device is None:
        print("no H6199 found")
        return

    async with BleakClient(device) as client:
        async with GoveeH6199(client) as light:
            await light.set_power(True)
            await light.set_brightness(60)
            await light.set_static_color((255, 80, 0))
            print(await light.read_state())

            caps = await light.get_capabilities()
            if caps.white_balance:
                await light.set_white_balance(10)


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

The outer context manages the Bluetooth connection; the inner context starts notifications and keep-alive. See [connection](docs/connection.md) for details.

See the [usage walkthrough](docs/usage.md) for more features and the interactive device check.

## Documentation

Start with the [documentation homepage](docs/index.md).

## Credits

Govee for the device and the app.

https://github.com/Obi2000/Govee-H6199-Reverse-Engineering for the details of the protocol.

## Contributing

Both bug reports and pull requests are appreciated.

