python-chargepoint 2.3.0__tar.gz → 2.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-chargepoint
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: A simple, Pythonic wrapper for the ChargePoint API.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-chargepoint"
3
- version = "2.3.0"
3
+ version = "2.3.1"
4
4
  description = "A simple, Pythonic wrapper for the ChargePoint API."
5
5
  authors = ["Marc Billow <mbillow@users.noreply.github.compoetry>"]
6
6
  license = "MIT"
@@ -129,6 +129,13 @@ class ChargePoint:
129
129
  _LOGGER.debug("[%s] %s", method, url)
130
130
  headers = {**self._request_headers, **kwargs.pop("headers", {})}
131
131
  response = await self._session.request(method, url, headers=headers, **kwargs)
132
+
133
+ # ChargePoint servers return coulomb_sess with Max-Age=7200 on every response.
134
+ # Re-set it without expiry so the cookie jar never evicts it.
135
+ refreshed = response.cookies.get(COULOMB_SESSION)
136
+ if refreshed and refreshed.value:
137
+ self._set_coulomb_token(refreshed.value)
138
+
132
139
  _LOGGER.debug("Status: %d", response.status)
133
140
  _LOGGER.debug("Request Headers: %s", response.request_info.headers)
134
141
  _LOGGER.debug("Response Headers: %s", response.headers)