Skip to content

Commit 425f771

Browse files
committed
Lower log level during initialization
1 parent 474ec3f commit 425f771

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

plugwise_usb/nodes/circle.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,18 @@ async def energy_update(
279279
self._mac_in_str,
280280
)
281281
if await self.node_info_update() is None:
282-
_LOGGER.warning("Unable to return energy statistics for %s, because it is not responding", self.name)
282+
if datetime.now(UTC) < self._initialization_delay_expired:
283+
_LOGGER.info("Unable to return energy statistics for %s, because it is not responding", self.name)
284+
else:
285+
_LOGGER.warning("Unable to return energy statistics for %s, because it is not responding", self.name)
283286
return None
284287
# request node info update every 30 minutes.
285288
elif not self.skip_update(self._node_info, 1800):
286289
if await self.node_info_update() is None:
287-
_LOGGER.warning("Unable to return energy statistics for %s, because it is not responding", self.name)
290+
if datetime.now(UTC) < self._initialization_delay_expired:
291+
_LOGGER.info("Unable to return energy statistics for %s, because it is not responding", self.name)
292+
else:
293+
_LOGGER.warning("Unable to return energy statistics for %s, because it is not responding", self.name)
288294
return None
289295

290296
# Always request last energy log records at initial startup
@@ -351,7 +357,10 @@ async def energy_update(
351357
"Skip creating task to update energy logs for node %s",
352358
self._mac_in_str,
353359
)
354-
_LOGGER.warning("Unable to return energy statistics for %s, collecting required data...", self.name)
360+
if datetime.now(UTC) < self._initialization_delay_expired:
361+
_LOGGER.info("Unable to return energy statistics for %s, collecting required data...", self.name)
362+
else:
363+
_LOGGER.warning("Unable to return energy statistics for %s, collecting required data...", self.name)
355364
return None
356365

357366
async def get_missing_energy_logs(self) -> None:

0 commit comments

Comments
 (0)