Metadata-Version: 2.4
Name: xiaobiu-python
Version: 0.0.1
Summary: Suning biu smart home SMS login and session client
Project-URL: Homepage, https://github.com/zhiyuHD/xiaobiu-python
Project-URL: Bug Tracker, https://github.com/zhiyuHD/xiaobiu-python/issues
Author-email: FaintGhost <zhang.yaowei@live.com>, zhiyuHD <zhiyuxl@outlook.com>
License: MIT
Keywords: climate,home-assistant,smart-home,suning
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.14
Requires-Dist: cryptography>=44.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.28.0
Description-Content-Type: text/markdown

# python-xiaobiu

Python client for Suning smart home SMS login and session management.

Used by the [ha-suning](https://github.com/FaintGhost/ha-suning) Home Assistant custom integration.

## Install

```bash
pip install python-xiaobiu
```

## Usage

```python
from xiaobiu import CaptchaRequiredError, SuningSmartHomeClient

client = SuningSmartHomeClient(state_path=".suning-session.json")

try:
    client.send_sms_code("13800000000")
except CaptchaRequiredError as error:
    print(error.risk_type, error.sms_ticket)

client.login_with_sms_code(phone_number="13800000000", sms_code="123456")
print(client.list_family_infos())
```

## CLI

```bash
# Interactive login
xiaobiucli login --phone 13800000000 --state-file .suning-session.json

# Send SMS only
xiaobiucli send-sms --phone 13800000000 --state-file .suning-session.json

# Check session
xiaobiucli check --state-file .suning-session.json

# List families / devices
xiaobiucli families --state-file .suning-session.json
xiaobiucli devices --family-id 37790 --state-file .suning-session.json
```

## Requirements

- Python >= 3.14
- `cryptography`, `pydantic`, `requests`
