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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python_openevse_http
3
- Version: 0.1.88
3
+ Version: 0.1.89
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
6
  Author: firstof9
@@ -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
- await self._client.send_json(data)
160
- self._ping = datetime.datetime.now()
161
- _LOGGER.debug("Ping message sent.")
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-openevse-http
3
- Version: 0.1.88
3
+ Version: 0.1.89
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
6
  Author: firstof9
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
6
6
 
7
7
  PROJECT_DIR = Path(__file__).parent.resolve()
8
8
  README_FILE = PROJECT_DIR / "README.md"
9
- VERSION = "0.1.88"
9
+ VERSION = "0.1.89"
10
10
 
11
11
  setup(
12
12
  name="python_openevse_http",