Skip to content

Commit

Permalink
fix: Excessive logging w/ offline device and irregular update intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Jan 25, 2025
1 parent 704718a commit 6bd4716
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion custom_components/solarman/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .const import *
from .common import *
from .provider import *
from .include.pysolarmanv5 import PySolarmanAsync
from .include.pysolarmanv5.pysolarman import PySolarmanAsync

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -125,6 +125,8 @@ async def get(self, runtime = 0, requests = None):
_LOGGER.debug(f"[{self.config.serial}] Scheduling {scount} query request{'s' if scount != 1 else ''}. ^{runtime}")

if scount == 0:
if not self.modbus.connected:
raise Exception(f"[{self.config.serial}] No scheduled requests found, aborting.")
return result

try:
Expand Down

0 comments on commit 6bd4716

Please sign in to comment.