From 63ee9795b9e094cc277ab4f1428883cc6cdf6644 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Wed, 28 Oct 2020 08:35:13 +0100 Subject: [PATCH] Log on level info, if no points are found (#13) --- custom_components/tractive/device_tracker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/tractive/device_tracker.py b/custom_components/tractive/device_tracker.py index 85162b5..8a006d1 100644 --- a/custom_components/tractive/device_tracker.py +++ b/custom_components/tractive/device_tracker.py @@ -24,6 +24,7 @@ CONF_MAX_GPS_ACCURACY = "max_gps_accuracy" +LAST_HOURS = 6 PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -160,7 +161,7 @@ async def _fetch_tracker_data(self, tracker_id): pass now = datetime.timestamp(datetime.now()) - time_from = now - 3600 * 6 + time_from = now - 3600 * LAST_HOURS try: with async_timeout.timeout(self._timeout): @@ -199,7 +200,7 @@ async def _async_update(self, now=None): points = result[0] if not points: - _LOGGER.error("No points") + _LOGGER.info(f"No points found for the last {LAST_HOURS} hours") continue _LOGGER.debug("points %s", points) point = points[-1]