python-openevse-http 0.1.88__tar.gz → 0.1.90__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.
Files changed (18) hide show
  1. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/PKG-INFO +15 -7
  2. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/openevsehttp/__main__.py +8 -0
  3. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/openevsehttp/websocket.py +7 -4
  4. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/PKG-INFO +16 -8
  5. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/SOURCES.txt +4 -1
  6. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/setup.py +1 -1
  7. python_openevse_http-0.1.90/tests/test_main.py +2305 -0
  8. python_openevse_http-0.1.90/tests/test_main_edge_cases.py +61 -0
  9. python_openevse_http-0.1.90/tests/test_websocket.py +281 -0
  10. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/README.md +0 -0
  11. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/openevsehttp/__init__.py +0 -0
  12. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/openevsehttp/const.py +0 -0
  13. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/openevsehttp/exceptions.py +0 -0
  14. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/dependency_links.txt +0 -0
  15. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/not-zip-safe +0 -0
  16. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/requires.txt +0 -0
  17. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/python_openevse_http.egg-info/top_level.txt +0 -0
  18. {python_openevse_http-0.1.88 → python_openevse_http-0.1.90}/setup.cfg +0 -0
@@ -1,13 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python_openevse_http
3
- Version: 0.1.88
3
+ Version: 0.1.90
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
+ Download-URL: https://github.com/firstof9/python-openevse-http
6
7
  Author: firstof9
7
8
  Author-email: firstof9@gmail.com
8
- License: UNKNOWN
9
- Download-URL: https://github.com/firstof9/python-openevse-http
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 4 - Beta
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Natural Language :: English
@@ -18,6 +16,18 @@ Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
19
17
  Requires-Python: >=3.10
20
18
  Description-Content-Type: text/markdown
19
+ Requires-Dist: aiohttp
20
+ Requires-Dist: requests
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: download-url
27
+ Dynamic: home-page
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
21
31
 
22
32
  ![Codecov branch](https://img.shields.io/codecov/c/github/firstof9/python-openevse-http/main?style=flat-square)
23
33
  ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/firstof9/python-openevse-http?style=flat-square)
@@ -34,5 +44,3 @@ TODO:
34
44
  - [X] Setup webosocket listener for value updates
35
45
  - [X] Convert to aiohttp from requests
36
46
  - [X] Expose values as properties
37
-
38
-
@@ -1379,3 +1379,11 @@ class OpenEVSE:
1379
1379
  if "state" in override.keys():
1380
1380
  return override["state"]
1381
1381
  return "auto"
1382
+
1383
+ @property
1384
+ def current_power(self) -> int:
1385
+ """Return the current power (live) in watts."""
1386
+ if not self._version_check("4.2.2"):
1387
+ _LOGGER.debug("Feature not supported for older firmware.")
1388
+ raise UnsupportedFeature
1389
+ return self._status.get("power", 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
- 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,13 +1,11 @@
1
- Metadata-Version: 2.1
2
- Name: python-openevse-http
3
- Version: 0.1.88
1
+ Metadata-Version: 2.4
2
+ Name: python_openevse_http
3
+ Version: 0.1.90
4
4
  Summary: Python wrapper for OpenEVSE HTTP API
5
5
  Home-page: https://github.com/firstof9/python-openevse-http
6
+ Download-URL: https://github.com/firstof9/python-openevse-http
6
7
  Author: firstof9
7
8
  Author-email: firstof9@gmail.com
8
- License: UNKNOWN
9
- Download-URL: https://github.com/firstof9/python-openevse-http
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 4 - Beta
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Natural Language :: English
@@ -18,6 +16,18 @@ Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
19
17
  Requires-Python: >=3.10
20
18
  Description-Content-Type: text/markdown
19
+ Requires-Dist: aiohttp
20
+ Requires-Dist: requests
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: download-url
27
+ Dynamic: home-page
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
21
31
 
22
32
  ![Codecov branch](https://img.shields.io/codecov/c/github/firstof9/python-openevse-http/main?style=flat-square)
23
33
  ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/firstof9/python-openevse-http?style=flat-square)
@@ -34,5 +44,3 @@ TODO:
34
44
  - [X] Setup webosocket listener for value updates
35
45
  - [X] Convert to aiohttp from requests
36
46
  - [X] Expose values as properties
37
-
38
-
@@ -10,4 +10,7 @@ python_openevse_http.egg-info/SOURCES.txt
10
10
  python_openevse_http.egg-info/dependency_links.txt
11
11
  python_openevse_http.egg-info/not-zip-safe
12
12
  python_openevse_http.egg-info/requires.txt
13
- python_openevse_http.egg-info/top_level.txt
13
+ python_openevse_http.egg-info/top_level.txt
14
+ tests/test_main.py
15
+ tests/test_main_edge_cases.py
16
+ tests/test_websocket.py
@@ -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.90"
10
10
 
11
11
  setup(
12
12
  name="python_openevse_http",