diff --git a/custom_components/daikin_residential/const.py b/custom_components/daikin_residential/const.py index 864faea..a87a45b 100644 --- a/custom_components/daikin_residential/const.py +++ b/custom_components/daikin_residential/const.py @@ -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" @@ -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" diff --git a/custom_components/daikin_residential/daikin_base.py b/custom_components/daikin_residential/daikin_base.py index e14849e..af024a1 100644 --- a/custom_components/daikin_residential/daikin_base.py +++ b/custom_components/daikin_residential/daikin_base.py @@ -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, @@ -30,6 +32,7 @@ ATTR_VSWING_MODE, ATTR_SWING_SWING, ATTR_SWING_STOP, + ATTR_SWING_FLOOR_HEATING, ATTR_ENERGY_CONSUMPTION, SENSOR_PERIOD_WEEKLY, ) @@ -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 @@ -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 @@ -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