Danfoss Ally API library
Project description
Danfoss Ally API
Async-first Python client for the Danfoss Ally OpenAPI.
Installation
pip install pydanfossally
Async usage
Long-lived client
This is the recommended pattern for smart-home systems and other integrations that keep one client alive and reuse it across many calls.
from pydanfossally import DanfossAlly
ally = DanfossAlly(timeout=30)
authorized = await ally.initialize(key, secret)
if not authorized:
raise RuntimeError("Authorization failed")
devices = await ally.get_devices()
print(devices)
await ally.aclose()
Context-managed client
This is a good fit for small scripts, one-off tools, and examples where you want automatic resource cleanup.
import asyncio
import os
from pydanfossally import DanfossAlly
async def main() -> None:
async with DanfossAlly(timeout=30) as ally:
authorized = await ally.initialize(os.environ["KEY"], os.environ["SECRET"])
if not authorized:
raise RuntimeError("Authorization failed")
devices = await ally.get_devices()
print(devices)
asyncio.run(main())
Supported OpenAPI endpoints
POST /oauth2/tokenGET /ally/devicesGET /ally/devices/{device_id}GET /ally/devices/{device_id}/sub-devicesGET /ally/devices/{device_id}/statusPOST /ally/devices/{device_id}/commands
Notes about the data model
The transport layer follows the OpenAPI file in docs/openapi-spec.
The parsed devices mapping is a best-effort convenience model built from observed status
codes. The OpenAPI file documents generic {code, value} pairs, but it does not define all
device-specific status or command codes. That means:
- request/response transport compatibility is covered by the library
- friendly parsed fields are based on current observed API behavior
- some status fields may vary between device types
Known gaps
- The OpenAPI file does not fully document which command
codevalues are supported for all device types. - The
POST /commandsresponse shape is inconsistent between schema and examples; this client accepts both{"result": true, "t": ...}and{"t": ...}. - Live verification should be performed against read-only endpoints before enabling write flows in production integrations.
Local verification
The repository includes test.py as a small async read-only example that uses credentials from
the environment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydanfossally-1.0.1.tar.gz.
File metadata
- Download URL: pydanfossally-1.0.1.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f67b83647046a16a7d0a9a2d1aec4d5e487c3bc11fe935a6337c3dd0559be4
|
|
| MD5 |
f3f9258858a5e63d01f119f6960175bb
|
|
| BLAKE2b-256 |
9401156299cc59ab395f9706281e08bbb351b4febb3d3a8e926597d1f23ef885
|
Provenance
The following attestation bundles were made for pydanfossally-1.0.1.tar.gz:
Publisher:
pythonpublish.yml on MTrab/pydanfossally
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydanfossally-1.0.1.tar.gz -
Subject digest:
18f67b83647046a16a7d0a9a2d1aec4d5e487c3bc11fe935a6337c3dd0559be4 - Sigstore transparency entry: 1107773354
- Sigstore integration time:
-
Permalink:
MTrab/pydanfossally@9eb98fdc247862e81f88032539d9ab103b86e45f -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/MTrab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@9eb98fdc247862e81f88032539d9ab103b86e45f -
Trigger Event:
release
-
Statement type:
File details
Details for the file pydanfossally-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pydanfossally-1.0.1-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b77463ad1ce022b336a371b4be9336a8a43e97e8bfbaed77773271a1f51eda45
|
|
| MD5 |
88594a6a99d16c94a7a5b276212f3395
|
|
| BLAKE2b-256 |
2f2f2feb50721bf358a3cb768c7a142909fa872f35a9b6a94b84965762da9d04
|
Provenance
The following attestation bundles were made for pydanfossally-1.0.1-py3-none-any.whl:
Publisher:
pythonpublish.yml on MTrab/pydanfossally
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydanfossally-1.0.1-py3-none-any.whl -
Subject digest:
b77463ad1ce022b336a371b4be9336a8a43e97e8bfbaed77773271a1f51eda45 - Sigstore transparency entry: 1107773359
- Sigstore integration time:
-
Permalink:
MTrab/pydanfossally@9eb98fdc247862e81f88032539d9ab103b86e45f -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/MTrab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@9eb98fdc247862e81f88032539d9ab103b86e45f -
Trigger Event:
release
-
Statement type: