Skip to content

Commit

Permalink
Add SELF_USE mode to 745 platform inverters
Browse files Browse the repository at this point in the history
Add SELF_USE mode to 745 platform inverters
  • Loading branch information
mletenay committed Apr 21, 2024
1 parent 7924bcc commit 9add7ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions goodwe/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ async def set_grid_export_limit(self, export_limit: int) -> None:
async def get_operation_modes(self, include_emulated: bool) -> Tuple[OperationMode, ...]:
result = [e for e in OperationMode]
result.remove(OperationMode.PEAK_SHAVING)
result.remove(OperationMode.SELF_USE)
if not include_emulated:
result.remove(OperationMode.ECO_CHARGE)
result.remove(OperationMode.ECO_DISCHARGE)
Expand Down
6 changes: 6 additions & 0 deletions goodwe/et.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ async def get_operation_modes(self, include_emulated: bool) -> Tuple[OperationMo
result = [e for e in OperationMode]
if not self._has_peak_shaving:
result.remove(OperationMode.PEAK_SHAVING)
if not is_745_platform(self):
result.remove(OperationMode.SELF_USE)
if not include_emulated:
result.remove(OperationMode.ECO_CHARGE)
result.remove(OperationMode.ECO_DISCHARGE)
Expand Down Expand Up @@ -644,6 +646,10 @@ async def set_operation_mode(self, operation_mode: OperationMode, eco_mode_power
await self.write_setting('work_mode', 4)
await self._set_offline(False)
await self._clear_battery_mode_param()
elif operation_mode == OperationMode.SELF_USE:
await self.write_setting('work_mode', 5)
await self._set_offline(False)
await self._clear_battery_mode_param()
elif operation_mode in (OperationMode.ECO_CHARGE, OperationMode.ECO_DISCHARGE):
if eco_mode_power < 0 or eco_mode_power > 100:
raise ValueError()
Expand Down
1 change: 1 addition & 0 deletions goodwe/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class OperationMode(IntEnum):
BACKUP = 2
ECO = 3
PEAK_SHAVING = 4
SELF_USE = 5
ECO_CHARGE = 10
ECO_DISCHARGE = 11

Expand Down

0 comments on commit 9add7ff

Please sign in to comment.