Skip to content

Commit

Permalink
Fix log formatting (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeyev authored Jan 29, 2024
1 parent 1fdb9db commit 8a2730b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion custom_components/eyeonwater/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
async def setup(self):
"""Fetch all of the user's meters."""
self.meters = await self.account.fetch_meters(self.client)
_LOGGER.debug("Discovered %s meter(s)", len(self.meters))
_LOGGER.debug("Discovered %i meter(s)", len(self.meters))

async def read_meters(self, days_to_load=3):
"""Read each meter."""
Expand Down
6 changes: 2 additions & 4 deletions custom_components/eyeonwater/statistic_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ async def get_last_imported_time(

if last_stats:
date = last_stats[statistic_id][0]["start"]
_LOGGER.debug("date %d", date)
date = datetime.datetime.fromtimestamp(date, tz=dtutil.DEFAULT_TIME_ZONE)
_LOGGER.debug("date %d", date)
date = dtutil.as_local(date)
_LOGGER.debug("date %d", date)
_LOGGER.debug("date %s", date)

return date
return None
Expand All @@ -113,7 +111,7 @@ def filter_newer_data(
) -> list[DataPoint]:
"""Filter data points that newer than given datetime."""
_LOGGER.debug(
"last_imported_time %d - data %d",
"last_imported_time %s - data %s",
last_imported_time,
data[-1].dt,
)
Expand Down

0 comments on commit 8a2730b

Please sign in to comment.