python-openevse-http 0.1.88__tar.gz → 0.1.89__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.
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/PKG-INFO +1 -1
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/openevsehttp/websocket.py +7 -4
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/PKG-INFO +1 -1
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/setup.py +1 -1
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/README.md +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/openevsehttp/__init__.py +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/openevsehttp/__main__.py +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/openevsehttp/const.py +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/openevsehttp/exceptions.py +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/SOURCES.txt +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/dependency_links.txt +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/not-zip-safe +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/requires.txt +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/python_openevse_http.egg-info/top_level.txt +0 -0
- {python_openevse_http-0.1.88 → python_openevse_http-0.1.89}/setup.cfg +0 -0
|
@@ -147,7 +147,7 @@ class OpenEVSEWebsocket:
|
|
|
147
147
|
"""Send ping requests to websocket."""
|
|
148
148
|
if self._ping and self._pong:
|
|
149
149
|
time_delta = self._pong - self._ping
|
|
150
|
-
if time_delta < 0:
|
|
150
|
+
if time_delta < datetime.timedelta(0):
|
|
151
151
|
# Negitive time should indicate no pong reply so consider the
|
|
152
152
|
# websocket disconnected.
|
|
153
153
|
self._error_reason = ERROR_PING_TIMEOUT
|
|
@@ -156,9 +156,12 @@ class OpenEVSEWebsocket:
|
|
|
156
156
|
data = {"ping": 1}
|
|
157
157
|
_LOGGER.debug("Sending message: %s to websocket.", data)
|
|
158
158
|
try:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
if self._client:
|
|
160
|
+
await self._client.send_json(data)
|
|
161
|
+
self._ping = datetime.datetime.now()
|
|
162
|
+
_LOGGER.debug("Ping message sent.")
|
|
163
|
+
else:
|
|
164
|
+
_LOGGER.warning("Websocket client not found.")
|
|
162
165
|
except TypeError as err:
|
|
163
166
|
_LOGGER.error("Attempt to send ping data failed: %s", err)
|
|
164
167
|
except ValueError as err:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|