python-openevse-http 0.3.0b0__py3-none-any.whl → 0.3.2__py3-none-any.whl

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.
openevsehttp/commands.py CHANGED
@@ -491,3 +491,35 @@ class CommandsMixin:
491
491
  if not success:
492
492
  _LOGGER.error("Problem issuing command: %s", response)
493
493
  raise UnknownError
494
+
495
+ async def set_shaper(self, enable: bool = True) -> None:
496
+ """Set shaper mode."""
497
+ if not self._version_check("4.0.0"):
498
+ _LOGGER.debug("Feature not supported for older firmware.")
499
+ raise UnsupportedFeature
500
+
501
+ url = f"{self.url}shaper"
502
+ mode = 1 if enable else 0
503
+ data = {"mode": mode}
504
+
505
+ _LOGGER.debug("Setting shaper to %s", mode)
506
+ response = await self.process_request(url=url, method="post", data=data)
507
+ response = self._normalize_response(response)
508
+ msg = response.get("msg") if isinstance(response, Mapping) else None
509
+ if msg not in ["OK", "done", "no change", "Current Shaper state changed"]:
510
+ _LOGGER.error("Problem issuing command: %s", response)
511
+ raise UnknownError
512
+
513
+ async def toggle_shaper(self) -> None:
514
+ """Toggle shaper mode."""
515
+ shaper_active = self._status.get("shaper")
516
+ if shaper_active is None:
517
+ await self.update()
518
+ shaper_active = self._status.get("shaper")
519
+
520
+ if shaper_active is None:
521
+ _LOGGER.error("Cannot toggle shaper: unknown shaper state.")
522
+ raise RuntimeError("Cannot toggle shaper: unknown shaper state.")
523
+
524
+ new_state = not bool(shaper_active)
525
+ await self.set_shaper(new_state)
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: python_openevse_http
3
+ Version: 0.3.2
4
+ Summary: Python wrapper for OpenEVSE HTTP API
5
+ Home-page: https://github.com/firstof9/python-openevse-http
6
+ Download-URL: https://github.com/firstof9/python-openevse-http
7
+ Author: firstof9
8
+ Author-email: firstof9@gmail.com
9
+ License: Apache-2.0
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Requires-Python: >=3.13
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: aiohttp
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: license
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ ![Codecov branch](https://img.shields.io/codecov/c/github/firstof9/python-openevse-http/main?style=flat-square)
35
+ ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/firstof9/python-openevse-http?style=flat-square)
36
+ ![GitHub last commit](https://img.shields.io/github/last-commit/firstof9/python-openevse-http?style=flat-square)
37
+ ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/firstof9/python-openevse-http?style=flat-square)
38
+
39
+ # python-openevse-http
40
+
41
+ A Python library for communicating with [OpenEVSE](https://www.openevse.com/) chargers via the HTTP API on ESP8266 and ESP32-based WiFi modules.
42
+
43
+ ## Features
44
+
45
+ - **Asynchronous**: Built on `aiohttp` for non-blocking I/O.
46
+ - **WebSocket Support**: Real-time updates for charger status.
47
+ - **Firmware Support**: Compatible with ESP8266 (2.x) and ESP32 (4.x+) WiFi firmware.
48
+ - **Comprehensive API**:
49
+ - Query status and configuration.
50
+ - Manage manual overrides.
51
+ - Control charging claims and limits.
52
+ - Handle schedules.
53
+ - **Shaper Toggle**: Enable or disable the grid shaper feature (requires firmware 4.0.0+).
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ pip install python_openevse_http
59
+ ```
60
+
61
+ ## Quick Start
62
+
63
+ ```python
64
+ import asyncio
65
+ from openevsehttp import OpenEVSE
66
+
67
+ async def main():
68
+ # Initialize the charger
69
+ charger = OpenEVSE("192.168.1.30")
70
+
71
+ # Update state
72
+ await charger.update()
73
+
74
+ print(f"Charger State: {charger.status}")
75
+ print(f"Current Charge: {charger.charge_current}A")
76
+
77
+ # Toggle the Shaper feature
78
+ if charger.shaper_active:
79
+ print("Shaper is active, disabling...")
80
+ else:
81
+ print("Shaper is inactive, enabling...")
82
+
83
+ await charger.toggle_shaper()
84
+
85
+ # Clean up
86
+ await charger.close()
87
+
88
+ if __name__ == "__main__":
89
+ asyncio.run(main())
90
+ ```
91
+
92
+ ## API Support Matrix
93
+
94
+ | Endpoint | Methods | Supported | Description |
95
+ | :--- | :--- | :---: | :--- |
96
+ | `/status` | GET, POST | ✅ | Real-time status, sensors, and **Vehicle SoC** pushing |
97
+ | `/config` | GET, POST | ✅ | System and WiFi configuration |
98
+ | `/override` | GET, POST, PATCH, DELETE | ✅ | Manual charging overrides & current limits |
99
+ | `/claims` | GET, POST, DELETE | ✅ | Client-based charging claims |
100
+ | `/schedule` | GET, POST | ✅ | Charging schedule management |
101
+ | `/limit` | GET, POST, DELETE | ✅ | Charge limits (Time, Energy, SoC) |
102
+ | `/shaper` | POST | ✅ | Grid shaper control (v4.0.0+) |
103
+ | `/restart` | POST | ✅ | Reboot WiFi gateway or EVSE module |
104
+ | `/divertmode` | POST | ✅ | Solar divert mode control |
105
+ | `/r` (RAPI) | POST | ✅ | Direct RAPI command interface |
106
+ | `/ws` | GET | ✅ | WebSocket real-time updates |
107
+ | `/time` | GET, POST | ❌ | RTC and NTP time settings |
108
+ | `/logs` | GET | ❌ | System and debug event logs |
109
+ | `/emeter` | DELETE | ❌ | Energy meter reset |
110
+ | `/wifi` | GET, POST | ❌ | Network scanning and AP configuration |
111
+ | `/tesla` | GET | ❌ | Tesla vehicle integration |
112
+ | `/certificates`| GET, POST, DELETE | ❌ | SSL/TLS certificate management |
113
+ | `/schedule/plan`| GET | ❌ | Schedule planning and optimization |
114
+ | `/update` | POST | ❌ | Firmware update interface |
115
+ | `/rfid/add` | POST | ❌ | RFID tag management |
116
+
117
+ ✅ = Fully Supported \| ⚠️ = Partial Support \| ❌ = Not yet implemented
118
+
119
+ ## License
120
+
121
+ This project is licensed under the Apache-2.0 License.
@@ -1,15 +1,15 @@
1
1
  openevsehttp/__init__.py,sha256=I6a1mjOZHYiWb_qfCuDuFLOOncrkkB_7uwybtOIujfY,1165
2
2
  openevsehttp/__main__.py,sha256=EHmSdT7GjAVvHQxvLBTjZXsj_V5SB6B2_kpgUAT7mPM,146
3
3
  openevsehttp/client.py,sha256=rdUZn6HdJgUj5vZDin2PL8DyCBRK5_81YR5XJeGI6B0,18210
4
- openevsehttp/commands.py,sha256=PpqbqSD4TawJW8wMnStGUt11ce2vy6LQiE5kzONf-9o,19708
4
+ openevsehttp/commands.py,sha256=UghodbIq7mF1HDI-o0BpcKcRQm7fgcz_pCqPBOtZPns,21021
5
5
  openevsehttp/const.py,sha256=VSc5Xt-KFenft0rT6ql9whCD7J9g_YvjLYU_PX706eE,1360
6
6
  openevsehttp/exceptions.py,sha256=bqz-tHTW1AYJMKcm0s5M6z5tA6XZgjnCiBLW1XrZ_70,672
7
7
  openevsehttp/managers.py,sha256=kEX1ZD9u-FY0UEZJsxeFEGBSGzSlkbBc0kmxCiMJtJw,5373
8
8
  openevsehttp/properties.py,sha256=Lo2p6WfPuhpaEcIZ0OeAxinHSa0G8Sv2wLZ-dPe7rjo,17181
9
9
  openevsehttp/sensors.py,sha256=sJP2FPnU1Lk5S3VUyFT14JM1nKEBQPsjl-DiZI-pZrs,4673
10
10
  openevsehttp/websocket.py,sha256=Mi_WFmlT3-9i6bbHIN6ua09SD8CpIle2vRXB3HyWzmM,10066
11
- python_openevse_http-0.3.0b0.dist-info/licenses/LICENSE,sha256=hSB6TOQ7rmwSGb6XzqRjDGMvmUj5_GlacqQin3tegtA,11341
12
- python_openevse_http-0.3.0b0.dist-info/METADATA,sha256=2f6l6UhX4hUyFTBR6Rz4v0WMknrH4fczMn6wa-Jo-f8,1902
13
- python_openevse_http-0.3.0b0.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
14
- python_openevse_http-0.3.0b0.dist-info/top_level.txt,sha256=u8RUkoEIE33Cjn6gmqiEoVpZ0VZ59WJ3FXBwwOg0CPE,13
15
- python_openevse_http-0.3.0b0.dist-info/RECORD,,
11
+ python_openevse_http-0.3.2.dist-info/licenses/LICENSE,sha256=hSB6TOQ7rmwSGb6XzqRjDGMvmUj5_GlacqQin3tegtA,11341
12
+ python_openevse_http-0.3.2.dist-info/METADATA,sha256=owAAfc5N-66JfgL2DjzWeeM94vf3lESDwmFTitwzQQ0,4363
13
+ python_openevse_http-0.3.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
14
+ python_openevse_http-0.3.2.dist-info/top_level.txt,sha256=u8RUkoEIE33Cjn6gmqiEoVpZ0VZ59WJ3FXBwwOg0CPE,13
15
+ python_openevse_http-0.3.2.dist-info/RECORD,,
@@ -1,48 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python_openevse_http
3
- Version: 0.3.0b0
4
- Summary: Python wrapper for OpenEVSE HTTP API
5
- Home-page: https://github.com/firstof9/python-openevse-http
6
- Download-URL: https://github.com/firstof9/python-openevse-http
7
- Author: firstof9
8
- Author-email: firstof9@gmail.com
9
- License: Apache-2.0
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Natural Language :: English
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.13
15
- Classifier: Programming Language :: Python :: 3.14
16
- Classifier: License :: OSI Approved :: Apache Software License
17
- Requires-Python: >=3.13
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
- Requires-Dist: aiohttp
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: license
29
- Dynamic: license-file
30
- Dynamic: requires-dist
31
- Dynamic: requires-python
32
- Dynamic: summary
33
-
34
- ![Codecov branch](https://img.shields.io/codecov/c/github/firstof9/python-openevse-http/main?style=flat-square)
35
- ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/firstof9/python-openevse-http?style=flat-square)
36
- ![GitHub last commit](https://img.shields.io/github/last-commit/firstof9/python-openevse-http?style=flat-square)
37
- ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/firstof9/python-openevse-http?style=flat-square)
38
- # python-openevse-http
39
- Python Library for OpenEVSE HTTP API
40
-
41
- A python library for communicating with the ESP8266- and ESP32-based wifi module from OpenEVSE. This library uses the HTTP API commands to query the OpenEVSE charger.
42
-
43
- TODO:
44
- - [ ] Finish tests
45
- - [ ] Finish HTTP API functions
46
- - [X] Setup webosocket listener for value updates
47
- - [X] Convert to aiohttp from requests
48
- - [X] Expose values as properties