Skip to main content

pyacaia_async

Async implementation of pyacaia, based on asyncio and bleak

Usage

import asyncio
from pyacaia_async import AcaiaScale
from pyacaia_async.helpers import find_acaia_devices

async def main()
  addresses = await find_acaia_devices()
  address = addresses[0]
  scale = await AcaiaScale.create(mac=address, is_new_style_scale=False)
  await scale.tare()
  await scale.startStopTimer()
  await scale.resetTimer()

asyncio.run(main())

Callback

Weight and settings are available, if you pass a callback function to the constructor. In that callback you will either receive objects of type Message or Settings. A sample notification handler can look like this and can also be found in decode.py

def notification_handler(sender, data) -> None:
    msg = decode(data)[0]
    if isinstance(msg, Settings):
        print(f"Battery: {msg.battery}")
        print(f"Unit: {msg.units}")
    elif isinstance(msg, Message):
        print(f"Weight: {msg.value}")

scale = await AcaiaScale.create(mac=address, callback=notification_handler)

Metadata

Release files for pyacaia-async 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyacaia-async 0.1.2
File Size Uploaded Provenance
pyacaia_async-0.1.2.tar.gz 20.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyacaia-async 0.1.2
File Interpreter ABI Platform
pyacaia_async-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / pyacaia_async-0.1.2.tar.gz

Download URL pyacaia_async-0.1.2.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4708804a7ea60fa061641ca81d5a9a087ee4a1584de70428ac6da5e75c0501c2
BLAKE2b-256 checksum
How to use checksums
182f465cfa246f73598e8094a58cd6cc84e0148812e0aa9d3b03f822ca2d8e8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / pyacaia_async-0.1.2-py3-none-any.whl

Download URL pyacaia_async-0.1.2-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff5305a6f9fc66925952b5ca1b5fc60c87731ceecd47a6695c5cfd8930a10f3e
BLAKE2b-256 checksum
How to use checksums
a627d09e2b66b0a2933e1e9fd83e557d4f64ff0a9ac3b05ebfcbf2147d77cdc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for pyacaia-async 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page