python-openevse-http 0.1.73__tar.gz → 0.1.75__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.73
3
+ Version: 0.1.75
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
6
  Author: firstof9
@@ -153,12 +153,12 @@ class OpenEVSE:
153
153
  await self.update()
154
154
  return message
155
155
 
156
- except (TimeoutError, ServerTimeoutError):
156
+ except (TimeoutError, ServerTimeoutError) as err:
157
157
  _LOGGER.error("%s: %s", ERROR_TIMEOUT, url)
158
- message = {"msg": ERROR_TIMEOUT}
158
+ raise err
159
159
  except ContentTypeError as err:
160
- _LOGGER.error("%s", err)
161
- message = {"msg": err}
160
+ _LOGGER.error("Content error: %s", err.message)
161
+ raise err
162
162
 
163
163
  await session.close()
164
164
  return message
@@ -263,7 +263,7 @@ class OpenEVSE:
263
263
  )
264
264
  _LOGGER.debug("Disconnect message: %s", error)
265
265
  self._ws_listening = False
266
- self.ws_start()
266
+
267
267
  # Stopped websockets without errors are expected during shutdown
268
268
  # and ignored
269
269
  elif data == STATE_STOPPED and error:
@@ -273,7 +273,6 @@ class OpenEVSE:
273
273
  error,
274
274
  )
275
275
  self._ws_listening = False
276
- await self.ws_disconnect()
277
276
 
278
277
  elif msgtype == "data":
279
278
  _LOGGER.debug("Websocket data: %s", data)
@@ -428,6 +427,7 @@ class OpenEVSE:
428
427
  # 3.x: use RAPI commands $FE (enable) and $FS (sleep)
429
428
  # 4.x: use HTTP API call
430
429
  lower = "4.0.0"
430
+ msg = ""
431
431
  if self._version_check(lower):
432
432
  url = f"{self.url}override"
433
433
 
@@ -1288,8 +1288,8 @@ class OpenEVSE:
1288
1288
  return None
1289
1289
 
1290
1290
  @property
1291
- def shaper_current_power(self) -> int | None:
1292
- """Return shaper live power reading."""
1291
+ def shaper_available_current(self) -> float | None:
1292
+ """Return shaper available current."""
1293
1293
  if self._status is not None and "shaper_cur" in self._status:
1294
1294
  if self._status["shaper_cur"] == 255:
1295
1295
  return self._status["pilot"]
@@ -110,7 +110,7 @@ class OpenEVSEWebsocket:
110
110
  self._error_reason = error
111
111
  await OpenEVSEWebsocket.state.fset(self, STATE_STOPPED)
112
112
  except (aiohttp.ClientConnectionError, asyncio.TimeoutError) as error:
113
- if self.failed_attempts >= MAX_FAILED_ATTEMPTS:
113
+ if self.failed_attempts > MAX_FAILED_ATTEMPTS:
114
114
  self._error_reason = ERROR_TOO_MANY_RETRIES
115
115
  await OpenEVSEWebsocket.state.fset(self, STATE_STOPPED)
116
116
  elif self.state != STATE_STOPPED:
@@ -150,8 +150,8 @@ class OpenEVSEWebsocket:
150
150
  if time_delta < 0:
151
151
  # Negitive time should indicate no pong reply so consider the
152
152
  # websocket disconnected.
153
- await OpenEVSEWebsocket.state.fset(self, STATE_DISCONNECTED)
154
153
  self._error_reason = ERROR_PING_TIMEOUT
154
+ await OpenEVSEWebsocket.state.fset(self, STATE_DISCONNECTED)
155
155
 
156
156
  data = json.dumps({"ping": 1})
157
157
  _LOGGER.debug("Sending message: %s to websocket.", data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-openevse-http
3
- Version: 0.1.73
3
+ Version: 0.1.75
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.73"
9
+ VERSION = "0.1.75"
10
10
 
11
11
  setup(
12
12
  name="python_openevse_http",