Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyintesishome/intesishomelocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def _request(self, command: str, **kwargs) -> dict:
# If there's neither a "success" or "error" key, something is very
# wonky, so log an error plus the entire response.
if json_response.get("success", False):
return json_response.get("data")
return json_response.get("data") or {}
if "error" in json_response:
error = json_response["error"]
if error.get("code") in [1, 5]:
Expand Down Expand Up @@ -205,11 +205,12 @@ async def _request_value(self, name: str) -> dict:
return response["dpval"]["value"]

async def _set_value(self, device_id, uid, value):
return await self._request(
result = await self._request(
LOCAL_CMD_SET_DP_VALUE,
uid=uid,
value=value,
)
return result is not None

async def get_datapoints(self) -> dict:
"""Get all available datapoints."""
Expand Down Expand Up @@ -334,6 +335,7 @@ def get_horizontal_swing_list(self, device_id) -> list:
INTESIS_MAP[uid]["values"][i]
for i in self._datapoints[uid]["descr"]["states"]
]

def has_horizontal_swing(self, device_id) -> bool:
"""Entity supports horizontal swing."""
return self._has_datapoint("hvane")
Expand Down
Loading