Metadata-Version: 2.4
Name: vitafit-ble
Version: 0.2.0
Summary: Bluetooth library for Vitafit devices
Author: James Myatt
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Dist: bleak>=1.0
Requires-Dist: bleak-retry-connector>=4.0
Requires-Dist: bluetooth-data-tools>=1.28
Requires-Dist: bluetooth-sensor-state-data>=1.9
Requires-Dist: habluetooth>=3.42.0
Requires-Dist: sensor-state-data>=2.20
Requires-Python: >=3.11
Project-URL: Documentation, https://vitafit-ble.readthedocs.io
Project-URL: Repository, https://github.com/jamesmyatt/vitafit-ble
Project-URL: Bug Tracker, https://github.com/jamesmyatt/vitafit-ble/issues
Project-URL: Changelog, https://github.com/jamesmyatt/vitafit-ble/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# vitafit-ble

Bluetooth library for Vitafit devices. See [supported devices](docs/supported_devices.md) for the models it works with.

Unofficial; not affiliated with Vitafit.

## Install

```sh
pip install vitafit-ble
```

## Use

```python
from bleak import BleakClient
from vitafit_ble import async_measure

async with BleakClient(address) as client:
    measurement = await async_measure(client)
```

It returns a `Measurement` with `weight_kg`, `impedance_ohm` and `display_unit`, or `None` if no stable weight arrives within 30 s. Weight is always in kg. `impedance_ohm` is `None` if impedance isn't measured, for example through socks or if you step off early.

Pass `weight_only=True` to skip impedance (the Vitafit app's "Weight Only Mode"). The scale keeps this mode for later offline weigh-ins.

`VitafitBluetoothDeviceData` wraps the same session for Home Assistant; its `async_poll` passes `weight_only` through.

See [usage](docs/usage.md) for details.

## Licence

MIT. The protocol is based on openScale's
[VT701 handler](https://github.com/oliexdev/openScale/pull/1423).
