From d65320cfdd8387d474bd8028b98398285507fdfc Mon Sep 17 00:00:00 2001 From: Jeef Date: Sun, 7 Jan 2024 10:48:50 -0700 Subject: [PATCH] adding polling properties to unified fireplace --- pyproject.toml | 2 +- src/intellifire4py/unified_fireplace.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e563d6b..8d2f167 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "intellifire4py" -version = "4.1.4" +version = "4.1.5" description = "Intellifire4Py" authors = ["Jeff Stein "] license = "MIT" diff --git a/src/intellifire4py/unified_fireplace.py b/src/intellifire4py/unified_fireplace.py index faab5b9..28e2b67 100644 --- a/src/intellifire4py/unified_fireplace.py +++ b/src/intellifire4py/unified_fireplace.py @@ -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]