Skip to content

Commit

Permalink
Fix eco_mode v2 detection on ESA models
Browse files Browse the repository at this point in the history
  • Loading branch information
mletenay committed May 26, 2024
1 parent 893a81e commit 249ee1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions goodwe/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ def __init__(self, host: str, port: int, comm_addr: int = 0, timeout: int = 1, r
def _supports_eco_mode_v2(self) -> bool:
if self.arm_version < 14:
return False
if "EMU" in self.serial_number:
if "EMU" in self.serial_number or "EMJ" in self.serial_number:
return self.dsp1_version >= 11
if "ESU" in self.serial_number:
if "ESU" in self.serial_number or "ESA" in self.serial_number:
return self.dsp1_version >= 22
if "BPS" in self.serial_number:
if "BPS" in self.serial_number or "BPU" in self.serial_number:
return self.dsp1_version >= 10
return False

Expand All @@ -188,7 +188,7 @@ async def read_device_info(self):
self.firmware = self._decode(response[0:5]).rstrip()
self.model_name = self._decode(response[5:15]).rstrip()
self.serial_number = self._decode(response[31:47])
self.software_version = self._decode(response[51:63])
self.arm_firmware = self._decode(response[51:63]) # AKA software_version
try:
if len(self.firmware) >= 2:
self.dsp1_version = int(self.firmware[0:2])
Expand Down

0 comments on commit 249ee1e

Please sign in to comment.