Skip to content

Commit 5987d62

Browse files
committed
Add timer support
1 parent b978285 commit 5987d62

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

dingz/dingz.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __init__(self, host: str, session: aiohttp.client.ClientSession = None) -> N
4646
self._hour_of_day = None
4747
self._motion = None
4848
self._schedule = None
49+
self._timer = None
4950
self.uri = URL.build(scheme="http", host=self._host).join(URL(API))
5051

5152
async def get_device_info(self) -> None:
@@ -79,10 +80,15 @@ async def get_wifi_networks(self) -> None:
7980
self._wifi_networks = await make_call(self, uri=url)
8081

8182
async def get_schedule(self) -> None:
82-
"""Get the avaialble schedules."""
83+
"""Get the available schedules."""
8384
url = URL(self.uri).join(URL(SCHEDULE))
8485
self._schedule = await make_call(self, uri=url)
8586

87+
async def get_timer(self) -> None:
88+
"""Get the available timers."""
89+
url = URL(self.uri).join(URL(TIMER))
90+
self._timer = await make_call(self, uri=url)
91+
8692
async def get_configuration(self, part) -> None:
8793
"""Get the configuration of a dingz part."""
8894
urls = {
@@ -145,6 +151,11 @@ def schedule(self) -> str:
145151
"""Return the schedule details."""
146152
return self._schedule
147153

154+
@property
155+
def timer(self) -> str:
156+
"""Return the timer details."""
157+
return self._timer
158+
148159
@property
149160
def configuration(self) -> str:
150161
"""Return the current configuration of a dingz part."""

0 commit comments

Comments
 (0)