Skip to content

Commit b978285

Browse files
committed
Add schedule
1 parent 0aa506b commit b978285

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dingz/dingz.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __init__(self, host: str, session: aiohttp.client.ClientSession = None) -> N
4545
self._night = None
4646
self._hour_of_day = None
4747
self._motion = None
48+
self._schedule = None
4849
self.uri = URL.build(scheme="http", host=self._host).join(URL(API))
4950

5051
async def get_device_info(self) -> None:
@@ -77,6 +78,11 @@ async def get_wifi_networks(self) -> None:
7778
url = URL(self.uri).join(URL(WIFI_SCAN))
7879
self._wifi_networks = await make_call(self, uri=url)
7980

81+
async def get_schedule(self) -> None:
82+
"""Get the avaialble schedules."""
83+
url = URL(self.uri).join(URL(SCHEDULE))
84+
self._schedule = await make_call(self, uri=url)
85+
8086
async def get_configuration(self, part) -> None:
8187
"""Get the configuration of a dingz part."""
8288
urls = {
@@ -134,6 +140,11 @@ def settings(self) -> str:
134140
"""Return the current device settings."""
135141
return self._settings
136142

143+
@property
144+
def schedule(self) -> str:
145+
"""Return the schedule details."""
146+
return self._schedule
147+
137148
@property
138149
def configuration(self) -> str:
139150
"""Return the current configuration of a dingz part."""

0 commit comments

Comments
 (0)