Skip to content

Commit

Permalink
adding polling properties to unified fireplace
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeftor committed Jan 7, 2024
1 parent f435fa2 commit d65320c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "intellifire4py"
version = "4.1.4"
version = "4.1.5"
description = "Intellifire4Py"
authors = ["Jeff Stein <[email protected]>"]
license = "MIT"
Expand Down
11 changes: 10 additions & 1 deletion src/intellifire4py/unified_fireplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,16 @@ async def perform_local_poll(self, timeout_seconds: float = 10.0) -> None:
await self._local_api.poll(timeout_seconds=timeout_seconds)

@property
def dump_user_data_json(self) -> str:
def is_cloud_polling(self) -> bool:
"""Returns True if the cloud API is currently polling in the background."""
return self._cloud_api.is_polling_in_background

@property
def is_local_polling(self) -> bool:
"""Returns True if the local API is currently polling in the background."""
return self._local_api.is_polling_in_background

def get_user_data_as_json(self) -> str:
"""Dump the internal _fireplace_data object to a JSON String."""
try:
return str(self._fireplace_data.model_dump_json(indent=2)) # type: ignore[attr-defined]
Expand Down

0 comments on commit d65320c

Please sign in to comment.