Skip to content

Commit

Permalink
manual setpoint support on ambisense rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
signalkraft committed Mar 20, 2024
1 parent 75037aa commit 8365ad4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
Home Assistant component that interfaces with the myVAILLANT API (and branded versions of it, such as the MiGo Link app
from Saunier Duval & Bulex).

> [!WARNING]
> If you're using sensoAPP or the multiMATIC app, this integration won't work for you. Try
> the [Multimatic integration](https://github.com/thomasgermain/vaillant-component) instead and
> check [Vaillant's website](https://www.vaillant.de/heizung/produkte/mobile-apps/myvaillant-app/) for more information.
>
> [!WARNING]
> This integration is not affiliated with Vaillant, the developers take no responsibility for anything that happens to
> your devices because of this library.
Expand Down
23 changes: 19 additions & 4 deletions custom_components/mypyllant/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ async def async_setup_entry(
vol.Required("temperature"): vol.All(
vol.Coerce(float), vol.Clamp(min=0, max=30)
),
vol.Required("setpoint_type"): selector.SelectSelector(
vol.Optional("setpoint_type"): selector.SelectSelector(
selector.SelectSelectorConfig(
options=_ZONE_MANUAL_SETPOINT_TYPES_OPTIONS,
mode=selector.SelectSelectorMode.DROPDOWN,
Expand Down Expand Up @@ -567,7 +567,6 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
f"Setting manual mode setpoint on {self.zone.name} to {temperature}"
)
await self.set_manual_mode_setpoint(temperature=temperature)
await self.coordinator.async_request_refresh_delayed()
else:
if self.time_program_overwrite and not self.preset_mode == PRESET_BOOST:
_LOGGER.debug(
Expand All @@ -580,12 +579,12 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
"heating", # TODO: Cooling?
temperature=temperature,
)
await self.coordinator.async_request_refresh_delayed()
else:
_LOGGER.debug(
"Setting quick veto on %s to %s", self.zone.name, temperature
)
await self.set_quick_veto(temperature=temperature)
await self.coordinator.async_request_refresh_delayed()

@property
def preset_modes(self) -> list[str]:
Expand Down Expand Up @@ -780,6 +779,16 @@ async def remove_quick_veto(self):
await self.coordinator.api.cancel_quick_veto_ambisense_room(self.room)
await self.coordinator.async_request_refresh_delayed()

async def set_manual_mode_setpoint(self, **kwargs):
_LOGGER.debug(
f"Setting manual mode setpoint temperature on {self.room.name} with params {kwargs}"
)
temperature = kwargs.get("temperature")
await self.coordinator.api.set_ambisense_room_manual_mode_setpoint_temperature(
self.room, temperature
)
await self.coordinator.async_request_refresh_delayed()

@property
def supported_features(self) -> ClimateEntityFeature:
"""Return the list of supported features."""
Expand Down Expand Up @@ -847,4 +856,10 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
if not temperature:
return

await self.set_quick_veto(temperature=temperature)
if (
self.room.room_configuration.operation_mode
== AmbisenseRoomOperationMode.MANUAL
):
await self.set_manual_mode_setpoint(temperature=temperature)
else:
await self.set_quick_veto(temperature=temperature)
2 changes: 1 addition & 1 deletion custom_components/mypyllant/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/signalkraft/mypyllant-component/issues",
"requirements": [
"myPyllant==0.8.3"
"myPyllant==0.8.5"
],
"version": "v0.7.3"
}
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ types-PyYAML~=6.0.12.12

# Need specific versions
pytest-homeassistant-custom-component==0.13.101
myPyllant==0.8.3
myPyllant==0.8.5

# Versions handled by pytest-homeassistant-custom-component
freezegun
Expand Down

0 comments on commit 8365ad4

Please sign in to comment.