Skip to content

Commit 956df85

Browse files
committed
Add support for catching all details
1 parent 63a46cb commit 956df85

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

dingz/dingz.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from yarl import URL
66

77
from . import make_call
8-
from .constants import API, DEVICE_INFO, TEMPERATURE, LIGHT, FRONT_LED_GET, FRONT_LED_SET
8+
from .constants import API, DEVICE_INFO, TEMPERATURE, LIGHT, FRONT_LED_GET, FRONT_LED_SET, PUCK, SETTINGS
99

1010
_LOGGER = logging.getLogger(__name__)
1111

@@ -19,6 +19,7 @@ def __init__(self, host: str, session: aiohttp.client.ClientSession = None) -> N
1919
self._host = host
2020
self._session = session
2121
self._device_details = None
22+
self._catch_all = {}
2223
self._temperature = None
2324
self._intensity = None
2425
self._day = None
@@ -30,6 +31,12 @@ async def get_device_info(self) -> None:
3031
response = await make_call(self, uri=url)
3132
self._device_details = response
3233

34+
async def get_info(self) -> None:
35+
"""Get everything from the dingz unit."""
36+
for endpoint in [PUCK, DEVICE_INFO, SETTINGS]:
37+
url = URL(self.uri).join(URL(endpoint))
38+
self._catch_all[endpoint] = await make_call(self, uri=url)
39+
3340
async def get_temperature(self) -> None:
3441
"""Get the room temperature from the dingz."""
3542
url = URL(self.uri).join(URL(TEMPERATURE))
@@ -65,6 +72,11 @@ def device_details(self) -> str:
6572
"""Return the current device details."""
6673
return self._device_details
6774

75+
@property
76+
def everything(self) -> str:
77+
"""Return the all available device details."""
78+
return self._catch_all
79+
6880
@property
6981
def temperature(self) -> float:
7082
"""Return the current temperature in celsius."""

0 commit comments

Comments
 (0)