Skip to content

Commit

Permalink
use service property instead of get_services
Browse files Browse the repository at this point in the history
  • Loading branch information
zweckj committed Nov 9, 2024
1 parent 6be16ed commit 39320e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pyacaia_async/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ async def is_new_scale(address_or_ble_device: str | BLEDevice) -> bool:
async with BleakClient(address_or_ble_device) as client:
try:
await client.connect()
services = await client.get_services()
except BleakDeviceNotFoundError as ex:
raise AcaiaDeviceNotFound("Device not found") from ex
except (BleakError, Exception) as ex:
raise AcaiaError from ex

characteristics = []
for char in services.characteristics.values():
for char in client.services.characteristics.values():
characteristics.append(char.uuid)

if OLD_STYLE_CHAR_ID in characteristics:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyacaia_async",
version="0.1.1",
version="0.1.2",
description="An async implementation of PyAcaia",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 39320e0

Please sign in to comment.