From 51999a2c5f72236dd8c2d579c9705a4201851383 Mon Sep 17 00:00:00 2001 From: Ivan Kruglov Date: Tue, 9 Apr 2024 10:50:16 +0200 Subject: [PATCH] alfen.py: improve logging --- custom_components/alfen_wallbox/alfen.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custom_components/alfen_wallbox/alfen.py b/custom_components/alfen_wallbox/alfen.py index 119283a..750a01a 100644 --- a/custom_components/alfen_wallbox/alfen.py +++ b/custom_components/alfen_wallbox/alfen.py @@ -251,10 +251,9 @@ async def _update_value(self, api_param, value, allowed_login=True) -> ClientRes async def _get_value(self, api_param): """Get a value from the API.""" - response = await self._get(url=self.__get_url( - f"{PROP}?{ID}={api_param}")) - - _LOGGER.debug(f"Status Response {response}") + cmd = f"{PROP}?{ID}={api_param}" + response = await self._get(url=self.__get_url(cmd)) + _LOGGER.debug(f"Status Response {cmd}: {response}") if response is not None: if self.properties is None: @@ -273,9 +272,10 @@ async def _get_all_properties_value(self): nextRequest = True offset = 0 while (nextRequest): - response = await self._get(url=self.__get_url( - f"{PROP}?{CAT}={cat}&{OFFSET}={offset}")) - _LOGGER.debug(f"Status Response {response}") + cmd = f"{PROP}?{CAT}={cat}&{OFFSET}={offset}" + response = await self._get(url=self.__get_url(cmd)) + _LOGGER.debug(f"Status Response {cmd}: {response}") + if response is not None: properties += response[PROPERTIES] nextRequest = response[TOTAL] > (