mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Add melcloud standard horizontal vane modes (#136654)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
0b7a023d2e
commit
37240e811b
@ -152,6 +152,14 @@ class AtaDeviceClimate(MelCloudClimate):
|
|||||||
self._attr_unique_id = f"{self.api.device.serial}-{self.api.device.mac}"
|
self._attr_unique_id = f"{self.api.device.serial}-{self.api.device.mac}"
|
||||||
self._attr_device_info = self.api.device_info
|
self._attr_device_info = self.api.device_info
|
||||||
|
|
||||||
|
async def async_added_to_hass(self) -> None:
|
||||||
|
"""When entity is added to hass."""
|
||||||
|
await super().async_added_to_hass()
|
||||||
|
|
||||||
|
# We can only check for vane_horizontal once we fetch the device data from the cloud
|
||||||
|
if self._device.vane_horizontal:
|
||||||
|
self._attr_supported_features |= ClimateEntityFeature.SWING_HORIZONTAL_MODE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||||
"""Return the optional state attributes with device specific additions."""
|
"""Return the optional state attributes with device specific additions."""
|
||||||
@ -274,15 +282,29 @@ class AtaDeviceClimate(MelCloudClimate):
|
|||||||
"""Return vertical vane position or mode."""
|
"""Return vertical vane position or mode."""
|
||||||
return self._device.vane_vertical
|
return self._device.vane_vertical
|
||||||
|
|
||||||
|
@property
|
||||||
|
def swing_horizontal_mode(self) -> str | None:
|
||||||
|
"""Return horizontal vane position or mode."""
|
||||||
|
return self._device.vane_horizontal
|
||||||
|
|
||||||
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
||||||
"""Set vertical vane position or mode."""
|
"""Set vertical vane position or mode."""
|
||||||
await self.async_set_vane_vertical(swing_mode)
|
await self.async_set_vane_vertical(swing_mode)
|
||||||
|
|
||||||
|
async def async_set_swing_horizontal_mode(self, swing_horizontal_mode: str) -> None:
|
||||||
|
"""Set horizontal vane position or mode."""
|
||||||
|
await self.async_set_vane_horizontal(swing_horizontal_mode)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def swing_modes(self) -> list[str] | None:
|
def swing_modes(self) -> list[str] | None:
|
||||||
"""Return a list of available vertical vane positions and modes."""
|
"""Return a list of available vertical vane positions and modes."""
|
||||||
return self._device.vane_vertical_positions
|
return self._device.vane_vertical_positions
|
||||||
|
|
||||||
|
@property
|
||||||
|
def swing_horizontal_modes(self) -> list[str] | None:
|
||||||
|
"""Return a list of available horizontal vane positions and modes."""
|
||||||
|
return self._device.vane_horizontal_positions
|
||||||
|
|
||||||
async def async_turn_on(self) -> None:
|
async def async_turn_on(self) -> None:
|
||||||
"""Turn the entity on."""
|
"""Turn the entity on."""
|
||||||
await self._device.set({"power": True})
|
await self._device.set({"power": True})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user