python-openevse-http 0.1.86__tar.gz → 0.1.88__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.86
3
+ Version: 0.1.88
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
6
  Author: firstof9
@@ -231,8 +231,11 @@ class OpenEVSE:
231
231
 
232
232
  def ws_start(self) -> None:
233
233
  """Start the websocket listener."""
234
- if self._ws_listening:
235
- raise AlreadyListening
234
+ if self.websocket:
235
+ if self._ws_listening and self.websocket.state == "connected":
236
+ raise AlreadyListening
237
+ if self._ws_listening and self.websocket.state != "connected":
238
+ self._ws_listening = False
236
239
  self._start_listening()
237
240
 
238
241
  def _start_listening(self):
@@ -480,6 +483,9 @@ class OpenEVSE:
480
483
  # RAPI commands
481
484
  _LOGGER.debug("Setting current via RAPI")
482
485
  command = f"$SC {amps} N"
486
+ # Different parameters for older firmware
487
+ if self._version_check("2.9.1"):
488
+ command = f"$SC {amps} V"
483
489
  response, msg = await self.send_command(command)
484
490
  _LOGGER.debug("Set current response: %s", msg)
485
491
 
@@ -38,7 +38,7 @@ class OpenEVSEWebsocket:
38
38
  self._user = user
39
39
  self._password = password
40
40
  self.callback = callback
41
- self._state = None
41
+ self._state = STATE_DISCONNECTED
42
42
  self.failed_attempts = 0
43
43
  self._error_reason = None
44
44
  self._client = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-openevse-http
3
- Version: 0.1.86
3
+ Version: 0.1.88
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.86"
9
+ VERSION = "0.1.88"
10
10
 
11
11
  setup(
12
12
  name="python_openevse_http",