Metadata-Version: 2.4
Name: verisure-italy
Version: 0.9.6
Summary: Async Python client for the Verisure Italy alarm API
Author-email: Marcello Barnaba <vjt@openssl.it>
License-Expression: MIT
Project-URL: Homepage, https://github.com/vjt/ha-verisure-italy
Project-URL: Repository, https://github.com/vjt/ha-verisure-italy
Project-URL: Issues, https://github.com/vjt/ha-verisure-italy/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9
Requires-Dist: pydantic>=2.0
Requires-Dist: pyjwt>=2.8
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-timeout>=2.2; extra == "dev"
Requires-Dist: aioresponses>=0.7; extra == "dev"
Requires-Dist: homeassistant>=2026.2; extra == "dev"
Requires-Dist: pyright>=1.1; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Dynamic: license-file

# verisure-italy

Async Python client for the **Verisure Italy** alarm API.

Talks directly to `customers.verisure.it/owa-api/graphql`. Typed,
async, Pydantic models for all request/response types. No `Any`,
no dict soup. Pyright strict, zero errors.

> **Not affiliated with Verisure Group or Securitas Direct.**

## Installation

```bash
pip install verisure-italy
```

## Usage

```python
import aiohttp
from verisure_italy import VerisureClient, generate_device_id, generate_uuid

async with aiohttp.ClientSession() as session:
    client = VerisureClient(
        username="your@email.com",
        password="your-password",
        http_session=session,
        device_id=generate_device_id(),
        uuid=generate_uuid(),
        id_device_indigitall="",
    )

    # Login (may raise TwoFactorRequiredError)
    await client.login()

    # List installations
    installations = await client.list_installations()
    inst = installations[0]
    await client.get_services(inst)

    # Get alarm status (passive — no panel ping, no timeline entry)
    status = await client.get_general_status(inst)
    print(f"Alarm: {status.status}")  # D, B, A, E, P, T

    # Arm / disarm
    from verisure_italy import AlarmState, InteriorMode, PerimeterMode

    target = AlarmState(interior=InteriorMode.PARTIAL, perimeter=PerimeterMode.ON)
    result = await client.arm(inst, target)

    # Force-arm (bypassing open zones — admin users only)
    from verisure_italy.exceptions import ArmingExceptionError

    try:
        await client.arm(inst, target)
    except ArmingExceptionError as exc:
        print(f"Open zones: {[e.alias for e in exc.exceptions]}")
        await client.arm(
            inst, target,
            force_arming_remote_id=exc.reference_id,
            suid=exc.suid,
        )

    await client.disarm(inst)
    await client.logout()
```

## Alarm States

| State | Interior | Perimeter | Proto |
|---|---|---|---|
| Disarmed | OFF | OFF | `D` |
| Partial + Perimeter | PARTIAL | ON | `B` |
| Total + Perimeter | TOTAL | ON | `A` |
| Perimeter only | OFF | ON | `E` |
| Partial | PARTIAL | OFF | `P` |
| Total | TOTAL | OFF | `T` |

## Home Assistant

Looking for the Home Assistant integration? See
[ha-verisure-italy](https://github.com/vjt/ha-verisure-italy) on GitHub,
or install via HACS.

## License

MIT. See [LICENSE](https://github.com/vjt/ha-verisure-italy/blob/master/LICENSE).
