Skip to content

Commit 7c3df8f

Browse files
committed
Add support for getting the Wifi networks in range
1 parent 0505bb8 commit 7c3df8f

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

dingz/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
FRONT_LED_GET = "led/get"
2929
FRONT_LED_SET = "led/set"
3030
BUTTON_ACTIONS = "action"
31+
WIFI_SCAN = "scan"
3132

3233
# Configuration endpoints
3334
PIR_CONFIGURATION = "pir_config"

dingz/dingz.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
SETTINGS,
1919
TEMPERATURE,
2020
THERMOSTAT_CONFIGURATION,
21+
WIFI_SCAN,
2122
)
2223

2324
_LOGGER = logging.getLogger(__name__)
@@ -32,6 +33,7 @@ def __init__(self, host: str, session: aiohttp.client.ClientSession = None) -> N
3233
self._host = host
3334
self._session = session
3435
self._device_details = None
36+
self._wifi_networks = None
3537
self._settings = None
3638
self._catch_all = {}
3739
self._button_action = None
@@ -68,6 +70,11 @@ async def get_settings(self) -> None:
6870
url = URL(self.uri).join(URL(SETTINGS))
6971
self._settings = await make_call(self, uri=url)
7072

73+
async def get_wifi_networks(self) -> None:
74+
"""Get the Wifi networks in range."""
75+
url = URL(self.uri).join(URL(WIFI_SCAN))
76+
self._wifi_networks = await make_call(self, uri=url)
77+
7178
async def get_temperature(self) -> None:
7279
"""Get the room temperature from the dingz."""
7380
url = URL(self.uri).join(URL(TEMPERATURE))
@@ -114,6 +121,11 @@ def settings(self) -> str:
114121
"""Return the current device settings."""
115122
return self._settings
116123

124+
@property
125+
def wifi_networks(self) -> str:
126+
"""Return the WiFi networks in range."""
127+
return self._wifi_networks
128+
117129
@property
118130
def everything(self) -> str:
119131
"""Return the all available device details."""

0 commit comments

Comments
 (0)