Skip to content

Commit

Permalink
Powerful mode in Heating mode for flat boilers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgospodinow committed Dec 7, 2024
1 parent 00f8f5c commit 3281287
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
15 changes: 15 additions & 0 deletions custom_components/eldom/eldom_boiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ async def set_temperature(self, temperature: float) -> None:

async def enable_powerful_mode(self) -> None:
"""Enable the boiler's powerful mode."""
required_mode_enabled = self.current_operation in (
OPERATION_MODES[1],
OPERATION_MODES[2],
)
if not required_mode_enabled:
_LOGGER.warning(
"Powerful mode can only be turned on when in Eco or Electric mode"
)
return

self._flat_boiler_details.HasBoost = True

await self._eldom_client.set_flat_boiler_powerful_mode_on(self.device_id)
Expand Down Expand Up @@ -385,6 +395,11 @@ async def set_temperature(self, temperature: float) -> None:

async def enable_powerful_mode(self) -> None:
"""Enable the boiler's powerful mode."""
required_mode_enabled = self.current_operation in (OPERATION_MODES[2],)
if not required_mode_enabled:
_LOGGER.warning("Powerful mode can only be turned on when in Eco mode")
return

self._smart_boiler_details.BoostHeating = True

await self._eldom_client.set_smart_boiler_powerful_mode_on(self.device_id)
2 changes: 1 addition & 1 deletion custom_components/eldom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"requirements": ["pyeldom==0.4.1"],
"ssdp": [],
"zeroconf": [],
"version": "3.0.1"
"version": "3.1.0"
}
12 changes: 2 additions & 10 deletions custom_components/eldom/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

from .const import DEVICE_TYPE_FLAT_BOILER, DEVICE_TYPE_SMART_BOILER, DOMAIN
from .coordinator import EldomCoordinator
from .eldom_boiler import OPERATION_MODES, EldomBoiler
from .eldom_boiler import EldomBoiler
from .models import EldomData

REQUIRED_OPERATION_MODE_FOR_BOOST = OPERATION_MODES[2]
SWITCH_NAME = "Powerful"

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -91,14 +90,7 @@ def is_on(self) -> bool:
return self._eldom_boiler.powerful_enabled

async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn powerful on."""
eco_mode_enabled = (
self._eldom_boiler.current_operation == REQUIRED_OPERATION_MODE_FOR_BOOST
)
if not eco_mode_enabled:
_LOGGER.warning("Powerful mode can only be turned on when in ECO mode")
return

"""Turn powerful mode on."""
await self._eldom_boiler.enable_powerful_mode()
self.schedule_update_ha_state()

Expand Down

0 comments on commit 3281287

Please sign in to comment.