Skip to content

Commit b6ad427

Browse files
committed
Allow to read the configuration
1 parent 7c3df8f commit b6ad427

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

dingz/dingz.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ async def get_wifi_networks(self) -> None:
7575
url = URL(self.uri).join(URL(WIFI_SCAN))
7676
self._wifi_networks = await make_call(self, uri=url)
7777

78+
async def get_configuration(self, part) -> None:
79+
"""Get the configuration of a dingz part."""
80+
urls = {
81+
"pir": PIR_CONFIGURATION,
82+
"thermostat": THERMOSTAT_CONFIGURATION,
83+
"input": INPUT_CONFIGURATION,
84+
}
85+
url_part = [value for key, value in urls.items() if part in key][0]
86+
url = URL(self.uri).join(URL(url_part))
87+
self._configuration = await make_call(self, uri=url)
88+
7889
async def get_temperature(self) -> None:
7990
"""Get the room temperature from the dingz."""
8091
url = URL(self.uri).join(URL(TEMPERATURE))
@@ -121,6 +132,11 @@ def settings(self) -> str:
121132
"""Return the current device settings."""
122133
return self._settings
123134

135+
@property
136+
def configuration(self) -> str:
137+
"""Return the current configuration of a dingz part."""
138+
return self._configuration
139+
124140
@property
125141
def wifi_networks(self) -> str:
126142
"""Return the WiFi networks in range."""

0 commit comments

Comments
 (0)