pydeako
pydeako is a Python library for discovering, connecting to, and controlling Deako smart switches and dimmers on the local network. It talks to a Deako Connect over the Deako local API, and the Home Assistant Deako integration is built on it.
This is the community-maintained continuation of DeakoLights/pydeako, published on PyPI as pydeako-community. The import name is still pydeako.
Installation
pip install pydeako-community
It needs Python 3.11 or newer.
Usage
Find a device
import asyncio
from pydeako import DeakoDiscoverer, DevicesNotFoundError
async def main() -> None:
discoverer = DeakoDiscoverer()
try:
address, name = await discoverer.get_address()
except DevicesNotFoundError:
print("No Deako device found")
else:
print(f"Found {name} at {address}")
if __name__ == "__main__":
asyncio.run(main())
Control devices
import asyncio
from pydeako import Deako, DeakoDiscoverer, FindDevicesError
async def main() -> None:
discoverer = DeakoDiscoverer()
client = Deako(discoverer.get_address, client_name="my-app")
await client.connect()
try:
await client.find_devices()
for uuid, device in client.get_devices().items():
print(uuid, device["name"], device["state"])
# Turn the first device on; a dimmer goes to 50%.
uuid = next(iter(client.get_devices()))
changed = asyncio.Event()
client.set_state_callback(uuid, changed.set)
dim = 50 if client.is_dimmable(uuid) else None
await client.control_device(uuid, True, dim)
# The new state arrives as an event from the device.
await asyncio.wait_for(changed.wait(), timeout=5)
print(client.get_name(uuid), client.get_state(uuid))
except FindDevicesError as error:
print(error)
finally:
await client.disconnect()
if __name__ == "__main__":
asyncio.run(main())
Discovery is optional. Deako takes any coroutine function that returns (address, name), with the address as "host:port". The local API listens on port 23.
async def get_address() -> tuple[str, str]:
return "192.0.2.10:23", "my-bridge"
API
| Call | Notes |
|---|---|
DeakoDiscoverer(zeroconf=None) |
Browses for _deako._tcp.local. on a thread, using your Zeroconf instance or a new one. |
await discoverer.get_address() |
Returns (address, name). Waits up to 10 s, then raises DevicesNotFoundError. |
Deako(get_address, client_name=None) |
The client. Nothing is sent until connect(). |
await client.connect() |
Returns once connected. If no device answers within 10 s, it returns anyway and keeps trying in the background. |
await client.find_devices(timeout=10) |
Loads the devices. timeout is for the device count; the devices then get 2 s each. Raises FindDevicesError if they don't all arrive. |
client.get_devices() |
{uuid: {"name", "uuid", "dimmable", "state": {"power", "dim"}}} |
client.get_name(uuid), client.get_state(uuid), client.is_dimmable(uuid) |
Return None for an unknown uuid. |
client.set_state_callback(uuid, callback) |
One callback per device, called without arguments on the event loop. |
await client.control_device(uuid, power, dim=None) |
dim is 0 to 100. It doesn't raise; the new state arrives as an event. |
await client.disconnect() |
Closes the connection and stops reconnecting. |
The client sends one request at a time, waits up to 1 s for each answer and retries a DEVICE_BUSY answer three times. It pings the device every 10 s and reconnects when no answer comes back.
To stop discovery in a long-running program, call await asyncio.to_thread(discoverer.cancel). discoverer.stop() closes the Zeroconf instance, so don't call it on one you share with other code.
Log messages go to the pydeako.deako, pydeako.deako.utils and pydeako.discover loggers.
Contributing
See CONTRIBUTING.md for the setup, the checks and how releases are made. The tests need no Deako hardware: they run against a fake device on 127.0.0.1.
License
MIT License, see LICENSE.txt.
Project status
Deako published and maintained pydeako until release 0.6.0 (December 2024). The repository has had no commits since then. Its only contributor no longer maintains anything related to Deako and suggested continuing it as a fork. Deako didn't answer a request to software@deako.com about maintainership.
This fork keeps the full history of the original project. Release 0.6.1 has the same library code as pydeako 0.6.0, repackaged and published from GitHub Actions. Later releases contain fixes; the release notes list them.
Bugs in the Home Assistant Deako integration go to Home Assistant Core; bugs in this library go to this repository's issues.
Metadata
Release files for pydeako-community 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydeako_community-0.7.1.tar.gz | 45.7 kB | With provenance | Details for pydeako_community-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydeako_community-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for pydeako_community-0.7.1-py3-none-any.whl |
Total release size: 67.3 kB
Release files / pydeako_community-0.7.1.tar.gz
| Download URL | pydeako_community-0.7.1.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a5b392b9e411b27504122555f5c99bdec96663df54a1824c2afc8c436e11423
|
|
BLAKE2b-256 checksum How to use checksums |
bd13ea3d827794d63c3c09663b653dc30b77996a8a4a2cc840dbe6caaf0912f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / pydeako_community-0.7.1-py3-none-any.whl
| Download URL | pydeako_community-0.7.1-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5981e85c778a1ac727814d2179c82c165504d202703a878972fda6dcb5497b12
|
|
BLAKE2b-256 checksum How to use checksums |
1837161236793e3ab582c9690b9c275e0acfe0e9683c5cd7907505e24c75899b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for pydeako-community 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pydeako_community-0.7.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.