Skip to content

Commit a62f087

Browse files
committed
Add suport for button actions
1 parent d192756 commit a62f087

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dingz/dingz.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __init__(self, host: str, session: aiohttp.client.ClientSession = None) -> N
3333
self._session = session
3434
self._device_details = None
3535
self._catch_all = {}
36+
self._button_action = None
3637
self._temperature = None
3738
self._intensity = None
3839
self._day = None
@@ -64,6 +65,11 @@ async def get_temperature(self) -> None:
6465
response = await make_call(self, uri=url)
6566
self._temperature = response["temperature"]
6667

68+
async def get_button_action(self) -> None:
69+
"""Get the room temperature from the dingz."""
70+
url = URL(self.uri).join(URL(BUTTON_ACTIONS))
71+
self._button_action = await make_call(self, uri=url)
72+
6773
async def get_light(self) -> None:
6874
"""Get the light details from the switch."""
6975
url = URL(self.uri).join(URL(LIGHT))
@@ -98,6 +104,11 @@ def everything(self) -> str:
98104
"""Return the all available device details."""
99105
return self._catch_all
100106

107+
@property
108+
def button_action(self) -> float:
109+
"""Return the current button action."""
110+
return self._button_action
111+
101112
@property
102113
def temperature(self) -> float:
103114
"""Return the current temperature in celsius."""

0 commit comments

Comments
 (0)