Catalog PyPI
PACKAGE EXPLORERView in registry

aioacaia

PyPI

Python library to interact with acaia Bluetooth scales.

acaiaapiasyncbluetoothclient
Versions collected1
Direct dependencies10From release 0.2.3
Last observed21 Oct, 11:35 UTC

README

Version 0.2.3 documentation

aioacaia

Async Python library for interacting with Acaia Bluetooth scales.

Usage

import asyncio

from aioacaia import AcaiaScale
from aioacaia.discovery import find_acaia_devices, is_new_scale


async def main() -> None:
    addresses = await find_acaia_devices()
    if not addresses:
        raise RuntimeError("No Acaia scale found")

    address = addresses[0]
    scale = AcaiaScale(
        address,
        is_new_style_scale=await is_new_scale(address),
    )
    await scale.connect()

    try:
        await scale.tare()
        await scale.start_stop_timer()
        await scale.reset_timer()
    finally:
        await scale.disconnect()


asyncio.run(main())

State Updates

Pass a no-argument callback to receive notification when the scale state changes. The latest values are available through weight, timer, flow_rate, and device_state.

timer and timer_running follow the scale's own timer: scales that report their timer with each weight reading keep timer in sync, and new-style (2021+) scales also report whether the timer is running with each settings update. This keeps both correct when the timer is started or stopped on the scale itself, or was already running when you connected.

import asyncio

from aioacaia import AcaiaScale


async def monitor(address: str) -> None:
    scale: AcaiaScale

    def state_changed() -> None:
        print(f"Weight: {scale.weight}")
        print(f"Timer: {scale.timer}")
        if scale.device_state is not None:
            print(f"Battery: {scale.device_state.battery_level}%")

    scale = AcaiaScale(address, notify_callback=state_changed)
    await scale.connect()
    try:
        await asyncio.Event().wait()
    finally:
        await scale.disconnect()


asyncio.run(monitor("AA:BB:CC:DD:EE:FF"))

connect() also accepts a raw Bleak notification callback. Supplying one bypasses the built-in parsing and state updates.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.34 Oct 202610

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
zweckj/aioacaia

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:35 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:15608c5c2ce0c27b4484a9c29cf45d210c59d8be68091d9e7ebea1f16a15b176