Skip to main content

Async client for the ATC Cala / Grupo Ferroli WiFi radiator cloud API

Project description

pyatccala

Async Python client for the ATC Cala / Grupo Ferroli WiFi radiator cloud API (gateway.grupoferroli.es). It powers a companion ATC Cala Home Assistant integration but has no Home Assistant dependency and can be used standalone.

The reverse-engineered protocol is documented in the companion integration repo's API.md.

Install

pip install pyatccala

Usage

import asyncio
from pyatccala import AtcCalaClient

async def main():
    async with AtcCalaClient("you@example.com", "password") as client:
        await client.login()                      # OAuth password grant
        installations = await client.get_installations()
        inst = installations[0]

        for radiator in await client.get_radiators(inst.id_installation):
            print(radiator.name, radiator.mode, radiator.current_temperature)

        # Change the Comfort setpoint on one radiator (values sent as strings automatically).
        await client.put_radiator_changes(
            heaters=[radiator.id_radiator],
            cambios=[("TempComfort", 21.5)],
        )

        # Start a 60-minute boost to 22°C (expiry computed from the server clock).
        await client.async_start_boost(inst.id_installation, [radiator.id_radiator], 22.0, 60)

asyncio.run(main())

Auth handling

AtcCalaClient manages the OAuth token transparently:

  • The access token lasts ~20 minutes. async_ensure_token() refreshes it before expiry using the refresh grant, falling back to a full password login if the refresh is rejected.
  • Any 401 from a data call triggers one automatic re-auth and retry.
  • Errors are typed: AtcCalaAuthError (re-login required) vs AtcCalaConnectionError (transient).

Pass your own aiohttp.ClientSession via session= (recommended inside a larger app), or let the client create and own one. api_base= can point at a mock/proxy for testing.

Development

pip install -e .[test]
pytest -p no:homeassistant   # (the flag only matters if HA test plugins share the venv)

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

pyatccala-0.1.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

pyatccala-0.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file pyatccala-0.1.0.tar.gz.

File metadata

  • Download URL: pyatccala-0.1.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pyatccala-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eca9e18c106faab6d0a08f2197972cd954401df9d9bed70417cc29cac3c2269f
MD5 926621fa5ffdfbd889bd852b6921c20b
BLAKE2b-256 657abff694c1b23864da6365e347b7e166925ba02a817f81515df360e50ec088

See more details on using hashes here.

File details

Details for the file pyatccala-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyatccala-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pyatccala-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57f75fd19962ac40dfc12a6623a7c9c49f1138542057cdb586d5f038c4f70876
MD5 4136692d05279cf398411e95293e14e6
BLAKE2b-256 64dcb1ddc746586d041d01a1eab8d8f8ee0a66a52a02da33affb2df10b25e71c

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