Skip to content

Commit

Permalink
add new attribute remaining time
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-mattioli committed Dec 5, 2024
1 parent dd4cedc commit f031254
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions custom_components/bticino_x8000/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def update_token(now: dt_util.dt.datetime | None) -> None:
refresh_token,
access_token_expires_on,
) = await refresh_access_token(data)
_LOGGER.debug("Access_token_expires_on: %s", access_token_expires_on)
data["access_token"] = access_token
data["refresh_token"] = refresh_token
data["access_token_expires_on"] = access_token_expires_on
Expand Down
19 changes: 9 additions & 10 deletions custom_components/bticino_x8000/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def check_api_endpoint_health(self) -> bool:
)
return True
if status_code == 401:
_LOGGER.warning(
_LOGGER.debug(
"Attempt to update token. HTTP %s, Content: %s, data: %s",
status_code,
content,
Expand All @@ -80,7 +80,7 @@ async def handle_unauthorized_error(self, response: aiohttp.ClientResponse) -> b
status_code = response.status

if status_code == 401:
_LOGGER.warning("Received 401 Unauthorized error. Attempting token refresh")
_LOGGER.debug("Received 401 Unauthorized error. Attempting token refresh")
(
access_token,
_,
Expand Down Expand Up @@ -187,8 +187,7 @@ async def set_chronothermostat_status(
return {
"status_code": 500,
"error": (
f"Errore nella richiesta di set_chronothermostat_status: "
f"{e}"
f"Error during set_chronothermostat_status request: " f"{e}"
),
}

Expand Down Expand Up @@ -217,7 +216,7 @@ async def get_chronothermostat_status(
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di get_chronothermostat_status: {e}",
"error": f"Error during get_chronothermostat_status request: {e}",
}

async def get_chronothermostat_measures(
Expand Down Expand Up @@ -245,7 +244,7 @@ async def get_chronothermostat_measures(
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di get_chronothermostat_measures: {e}",
"error": f"Error during get_chronothermostat_measures request: {e}",
}

async def get_chronothermostat_programlist(
Expand Down Expand Up @@ -278,7 +277,7 @@ async def get_chronothermostat_programlist(
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di get_chronothermostat_programlist: {e}",
"error": f"Error during get_chronothermostat_programlist request: {e}",
}

async def get_subscriptions_c2c_notifications(self) -> dict[str, Any]:
Expand All @@ -302,7 +301,7 @@ async def get_subscriptions_c2c_notifications(self) -> dict[str, Any]:
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di get_subscriptions_C2C_notifications: {e}",
"error": f"Error during get_subscriptions_C2C_notifications request: {e}",
}

async def set_subscribe_c2c_notifications(
Expand All @@ -329,7 +328,7 @@ async def set_subscribe_c2c_notifications(
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di set_subscribe_C2C_notifications: {e}",
"error": f"Error during set_subscribe_C2C_notifications request: {e}",
}

async def delete_subscribe_c2c_notifications(
Expand Down Expand Up @@ -359,5 +358,5 @@ async def delete_subscribe_c2c_notifications(
except aiohttp.ClientError as e:
return {
"status_code": 500,
"error": f"Errore nella richiesta di delete_subscribe_C2C_notifications: {e}",
"error": f"Error during delete_subscribe_C2C_notifications request: {e}",
}

0 comments on commit f031254

Please sign in to comment.