Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions pyintesishome/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
32: "auto",
64: "auto+tank",
}
SWINGMODE_BITS = {
1: "auto/stop",
2: "manual1",
4: "manual2",
8: "manual3",
16: "manual4",
32: "manual5",
64: "manual6",
128: "manual7",
256: "manual8",
512: "manual9",
1024: "swing"
}

INTESIS_MAP = {
1: {"name": "power", "values": {0: "off", 1: "on"}},
Expand Down
17 changes: 17 additions & 0 deletions pyintesishome/intesisbase.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Base class for Intesis controllers."""
import asyncio
import logging
Expand All @@ -9,6 +9,7 @@
from .const import (
COMMAND_MAP,
CONFIG_MODE_BITS,
SWINGMODE_BITS,
DEVICE_INTESISHOME,
DEVICE_INTESISHOME_LOCAL,
ERROR_MAP,
Expand Down Expand Up @@ -104,13 +105,13 @@
_LOGGER.debug("Received: %s", data)

await self._parse_response(data)

Check warning on line 108 in pyintesishome/intesisbase.py

View workflow job for this annotation

GitHub Actions / Check flake8

blank line contains whitespace
if not self._received_response.is_set():
_LOGGER.debug("Resolving set_value's await")
self._received_response.set()

Check warning on line 112 in pyintesishome/intesisbase.py

View workflow job for this annotation

GitHub Actions / Check flake8

blank line contains whitespace

except IncompleteReadError:

Check failure on line 114 in pyintesishome/intesisbase.py

View workflow job for this annotation

GitHub Actions / Check flake8

too many blank lines (2)
_LOGGER.debug(
"pyIntesisHome lost connection to the %s server", self._device_type
)
Expand Down Expand Up @@ -314,6 +315,22 @@
mode_list.append(mode_bits.get(mode_bit))

return mode_list

Check warning on line 318 in pyintesishome/intesisbase.py

View workflow job for this annotation

GitHub Actions / Check flake8

blank line contains whitespace
def get_vertical_swing_list(self, device_id) -> list:
"""Public method to return the list of vertical swing modes."""
config_vertical_vanes = self.get_device_property(device_id, "config_vertical_vanes")
return [
mode for bit, mode in SWINGMODE_BITS.items()
if config_vertical_vanes is not None and config_vertical_vanes & bit
]

def get_horizontal_swing_list(self, device_id) -> list:
"""Public method to return the list of horizontal swing modes."""
config_horizontal_vanes = self.get_device_property(device_id, "config_horizontal_vanes")
return [
mode for bit, mode in SWINGMODE_BITS.items()
if config_horizontal_vanes is not None and config_horizontal_vanes & bit
]

def get_fan_speed(self, device_id):
"""Public method returns the current fan speed."""
Expand Down Expand Up @@ -452,7 +469,7 @@
"""Public method returns the current horizontal vane setting."""
swing = self.get_device_property(device_id, "hvane")
return swing

Check warning on line 472 in pyintesishome/intesisbase.py

View workflow job for this annotation

GitHub Actions / Check flake8

blank line contains whitespace
def get_error(self, device_id) -> str:
"""Public method returns the current error code + description."""
error_code = self.get_device_property(device_id, "error_code")
Expand Down
16 changes: 16 additions & 0 deletions pyintesishome/intesishomelocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,25 @@
return values
return INTESIS_MAP[67]["values"][63]

def get_vertical_swing_list(self, device_id) -> list:
"""Get possible entity modes."""
uid = COMMAND_MAP["vvane"]["uid"]
return [
INTESIS_MAP[uid]["values"][i]
for i in self._datapoints[uid]["descr"]["states"]
]

def has_vertical_swing(self, device_id) -> bool:
"""Entity supports vertical swing."""
return self._has_datapoint("vvane")

def get_horizontal_swing_list(self, device_id) -> list:

Check warning on line 314 in pyintesishome/intesishomelocal.py

View workflow job for this annotation

GitHub Actions / Check flake8

blank line contains whitespace
"""Get possible entity modes."""
uid = COMMAND_MAP["hvane"]["uid"]
return [
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."""
Expand Down
Loading