Skip to content

Commit

Permalink
save tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
zweckj committed Nov 23, 2023
1 parent b82c7e0 commit 4531093
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions pyacaia_async/acaiascale.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ async def connect(
except BleakDeviceNotFoundError as ex:
raise AcaiaDeviceNotFound("Device not found") from ex

asyncio.create_task(
self._send_heartbeats(
interval=HEARTBEAT_INTERVAL if not self._is_new_style_scale else 1,
new_style_heartbeat=self._is_new_style_scale,
if not self._heartbeat_task:
self._heartbeat_task = asyncio.create_task(
self._send_heartbeats(
interval=HEARTBEAT_INTERVAL if not self._is_new_style_scale else 1,
new_style_heartbeat=self._is_new_style_scale,
)
)
)
asyncio.create_task(self._process_queue())
if not self._process_queue_task:
self._process_queue_task = asyncio.create_task(self._process_queue())

async def auth(self) -> None:
"""Send auth message to scale, if subscribed to notifications returns Settings object"""
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.0.11b4",
version="0.0.11b5",
description="An async implementation of PyAcaia",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 4531093

Please sign in to comment.