Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "Floor Heating Airflow" #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions custom_components/daikin_residential/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
ATTR_SWING_AUTO = "auto"
ATTR_SWING_SWING = "swing"
ATTR_SWING_STOP = "stop"
ATTR_SWING_FLOOR_HEATING = "floorHeatingAirflow"
ATTR_COOL_ENERGY = "cool_energy"
ATTR_HEAT_ENERGY = "heat_energy"

Expand Down Expand Up @@ -115,6 +116,8 @@
SWING_BOTH = "3D"
SWING_VERTICAL = "Vertical"
SWING_HORIZONTAL = "Horizontal"
SWING_FLOOR_HEATING = "Floor Heating"
SWING_FLOOR_HEATING_AND_HORIZONTAL = "Floor Heating and Horizontal"

PRESET_STREAMER = "streamer"

Expand Down
37 changes: 27 additions & 10 deletions custom_components/daikin_residential/daikin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
SWING_BOTH,
SWING_VERTICAL,
SWING_HORIZONTAL,
SWING_FLOOR_HEATING,
SWING_FLOOR_HEATING_AND_HORIZONTAL,
DAIKIN_CMD_SETS,
ATTR_ON_OFF,
ATTR_OPERATION_MODE,
Expand All @@ -30,6 +32,7 @@
ATTR_VSWING_MODE,
ATTR_SWING_SWING,
ATTR_SWING_STOP,
ATTR_SWING_FLOOR_HEATING,
ATTR_ENERGY_CONSUMPTION,
SENSOR_PERIOD_WEEKLY,
)
Expand Down Expand Up @@ -234,13 +237,19 @@ def swing_mode(self):
swingMode = SWING_OFF
hMode = self.getValue(ATTR_HSWING_MODE)
vMode = self.getValue(ATTR_VSWING_MODE)
if hMode != ATTR_SWING_STOP:
if hMode not in (None, ATTR_SWING_STOP):
swingMode = SWING_HORIZONTAL
if vMode != ATTR_SWING_STOP:
if hMode != ATTR_SWING_STOP:
swingMode = SWING_BOTH
if vMode not in (None, ATTR_SWING_STOP):
if vMode == ATTR_SWING_FLOOR_HEATING:
if hMode not in (None, ATTR_SWING_STOP):
swingMode = SWING_FLOOR_HEATING_AND_HORIZONTAL
else:
swingMode = SWING_FLOOR_HEATING
else:
swingMode = SWING_VERTICAL
if hMode not in (None, ATTR_SWING_STOP):
swingMode = SWING_BOTH
else:
swingMode = SWING_VERTICAL
return swingMode

@property
Expand All @@ -253,6 +262,10 @@ def swing_modes(self):
swingModes.append(SWING_HORIZONTAL)
if vMode is not None:
swingModes.append(SWING_VERTICAL)
if ATTR_SWING_FLOOR_HEATING in vMode['values']:
swingModes.append(SWING_FLOOR_HEATING)
if hMode is not None:
swingModes.append(SWING_FLOOR_HEATING_AND_HORIZONTAL)
if hMode is not None:
swingModes.append(SWING_BOTH)
return swingModes
Expand All @@ -263,17 +276,21 @@ async def async_set_swing_mode(self, mode):
vMode = self.getValue(ATTR_VSWING_MODE)
new_hMode = (
ATTR_SWING_SWING
if mode == SWING_HORIZONTAL or mode == SWING_BOTH
if mode in (SWING_HORIZONTAL, SWING_BOTH, SWING_FLOOR_HEATING_AND_HORIZONTAL)
else ATTR_SWING_STOP
)
new_vMode = (
ATTR_SWING_SWING
if mode == SWING_VERTICAL or mode == SWING_BOTH
else ATTR_SWING_STOP
if mode in (SWING_VERTICAL, SWING_BOTH)
else (
ATTR_SWING_FLOOR_HEATING
if mode in (SWING_FLOOR_HEATING_AND_HORIZONTAL, SWING_FLOOR_HEATING)
else ATTR_SWING_STOP
)
)
if hMode != new_hMode:
if hMode not in (None, new_hMode):
await self.setValue(ATTR_HSWING_MODE, new_hMode)
if vMode != new_vMode:
if vMode not in (None, new_vMode):
await self.setValue(ATTR_VSWING_MODE, new_vMode)

@property
Expand Down