Skip to content

Commit

Permalink
refactor: Eight batch of name standardization Deye
Browse files Browse the repository at this point in the history
* Added common header for string, hybrid and 2/4mppt
* AC* renamed to Grid*
* Output Frequency to Grid Frequency
* Total AC Output Power (Action) renamed to Power
* Output Active Power renamed to Power
* Output Power renamed to Power
  • Loading branch information
davidrapan committed Sep 23, 2024
1 parent 194c0f5 commit fcbba69
Show file tree
Hide file tree
Showing 7 changed files with 1,564 additions and 949 deletions.
6 changes: 3 additions & 3 deletions custom_components/solarman/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async def get(self, runtime = 0):
return self.get_result()

async def call(self, code, start, arg, wait_for_attempts = ACTION_ATTEMPTS) -> bool:
_LOGGER.debug(f"[{self.serial}] call code {code}: {start}, arg: {arg}, wait_for_attempts: {wait_for_attempts}")
_LOGGER.debug(f"[{self.serial}] call code {code}: {start} | 0x{start:04X}, arg: {arg}, wait_for_attempts: {wait_for_attempts}")

if await self.wait_for_reading_done(wait_for_attempts):
_LOGGER.debug(f"[{self.serial}] call code {code}: Timeout.")
Expand All @@ -297,10 +297,10 @@ async def call(self, code, start, arg, wait_for_attempts = ACTION_ATTEMPTS) -> b

try:
response = await self.read_write(code, start, arg)
_LOGGER.debug(f"[{self.serial}] call code {code}: {start}, response: {response}")
_LOGGER.debug(f"[{self.serial}] call code {code}: {start} | 0x{start:04X}, response: {response}")
return response
except Exception as e:
_LOGGER.warning(f"[{self.serial}] call code {code}: {start}, arg: {arg} failed, attempts left: {attempts_left}. [{format_exception(e)}]")
_LOGGER.warning(f"[{self.serial}] call code {code}: {start} | 0x{start:04X}, arg: {arg} failed, attempts left: {attempts_left}. [{format_exception(e)}]")
if not self.auto_reconnect:
await self.disconnect()
if not attempts_left > 0:
Expand Down
Loading

1 comment on commit fcbba69

@CrazyUs3r
Copy link
Contributor

@CrazyUs3r CrazyUs3r commented on fcbba69 Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try it Tomorrow to day i am in Austria

Its work but no data by offline

Please sign in to comment.