Skip to content

Commit

Permalink
Changed error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Ott <[email protected]>
  • Loading branch information
DerOetzi committed Jan 7, 2024
1 parent 81a58b9 commit 1a6d14f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions solaredge2mqtt/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,13 @@ def flush_loop(self) -> None:
write_api = self.client.write_api(
success_callback=self.write_success_callback,
error_callback=self.write_error_callback,
retry_callback=self.write_retry_callback,
retry_callback=self.write_error_callback,
)
write_api.write(bucket=self.bucket_raw, record=self.loop_points)
self.loop_points = []

def write_success_callback(self, conf: (str, str, str), data: str) -> None:
logger.debug(f"Write success: {conf} {data}")
logger.debug(f"InfluxDB batch written: {conf} {data}")

def write_error_callback(self, conf: (str, str, str), error: InfluxDBError) -> None:
logger.error(f"Write error: {conf} {error}")

def write_retry_callback(self, conf: (str, str, str), error: InfluxDBError) -> None:
logger.warning(f"Write retry error: {conf} {error}")

logger.error(f"InfluxDB error while writting: {conf} {error}")

0 comments on commit 1a6d14f

Please sign in to comment.