Skip to content

Commit

Permalink
Preven other triggers from running when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmarlor committed Oct 31, 2022
1 parent ffbcbef commit 574d227
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/foxess_em/charge/charge_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ async def _eco_start_setup(self, *args) -> None: # pylint: disable=unused-argum

async def _eco_start(self, *args) -> None: # pylint: disable=unused-argument
"""Eco start"""
if self._battery_controller.disable_status() is True:
return

_LOGGER.debug(f"Setting min SoC to {self._perc_target}%")
await self._fox.set_min_soc(self._perc_target)

Expand Down Expand Up @@ -129,6 +132,9 @@ async def _stop_force_charge(

async def _eco_end(self, *args) -> None: # pylint: disable=unused-argument
"""Stop holding SoC"""
if self._battery_controller.disable_status() is True:
return

# Stop listening for updates
for listener in self._cancel_listeners:
listener()
Expand Down

0 comments on commit 574d227

Please sign in to comment.