python-openevse-http 0.1.47__tar.gz → 0.1.48__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.
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/PKG-INFO +1 -1
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/openevsehttp/__main__.py +37 -21
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/PKG-INFO +1 -1
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/setup.py +1 -1
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/README.md +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/openevsehttp/__init__.py +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/openevsehttp/const.py +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/openevsehttp/exceptions.py +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/openevsehttp/websocket.py +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/SOURCES.txt +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/dependency_links.txt +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/not-zip-safe +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/requires.txt +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/python_openevse_http.egg-info/top_level.txt +0 -0
- {python-openevse-http-0.1.47 → python-openevse-http-0.1.48}/setup.cfg +0 -0
|
@@ -492,28 +492,38 @@ class OpenEVSE:
|
|
|
492
492
|
else:
|
|
493
493
|
url = f"{base_url}ESP8266_WiFi_v2.x/releases/latest"
|
|
494
494
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
async with http_method(url) as resp:
|
|
503
|
-
if resp.status != 200:
|
|
504
|
-
return None
|
|
505
|
-
message = await resp.text()
|
|
506
|
-
message = json.loads(message)
|
|
507
|
-
response = {}
|
|
508
|
-
response["latest_version"] = message["tag_name"]
|
|
509
|
-
release_notes = message["body"]
|
|
510
|
-
response["release_summary"] = (
|
|
511
|
-
(release_notes[:253] + "..")
|
|
512
|
-
if len(release_notes) > 255
|
|
513
|
-
else release_notes
|
|
495
|
+
try:
|
|
496
|
+
async with aiohttp.ClientSession() as session:
|
|
497
|
+
http_method = getattr(session, method)
|
|
498
|
+
_LOGGER.debug(
|
|
499
|
+
"Connecting to %s using method %s",
|
|
500
|
+
url,
|
|
501
|
+
method,
|
|
514
502
|
)
|
|
515
|
-
|
|
516
|
-
|
|
503
|
+
async with http_method(url) as resp:
|
|
504
|
+
if resp.status != 200:
|
|
505
|
+
return None
|
|
506
|
+
message = await resp.text()
|
|
507
|
+
message = json.loads(message)
|
|
508
|
+
response = {}
|
|
509
|
+
response["latest_version"] = message["tag_name"]
|
|
510
|
+
release_notes = message["body"]
|
|
511
|
+
response["release_summary"] = (
|
|
512
|
+
(release_notes[:253] + "..")
|
|
513
|
+
if len(release_notes) > 255
|
|
514
|
+
else release_notes
|
|
515
|
+
)
|
|
516
|
+
response["release_url"] = message["html_url"]
|
|
517
|
+
return response
|
|
518
|
+
|
|
519
|
+
except (TimeoutError, ServerTimeoutError):
|
|
520
|
+
_LOGGER.error("%s: %s", ERROR_TIMEOUT, url)
|
|
521
|
+
except ContentTypeError as err:
|
|
522
|
+
_LOGGER.error("%s", err)
|
|
523
|
+
except aiohttp.ClientConnectorError as err:
|
|
524
|
+
_LOGGER.error("%s : %s", err, url)
|
|
525
|
+
|
|
526
|
+
return None
|
|
517
527
|
|
|
518
528
|
def _version_check(self, min_version: str, max_version: str = "") -> bool:
|
|
519
529
|
"""Return bool if minimum version is met."""
|
|
@@ -688,6 +698,12 @@ class OpenEVSE:
|
|
|
688
698
|
assert self._status is not None
|
|
689
699
|
return states[int(self._status["state"])]
|
|
690
700
|
|
|
701
|
+
@property
|
|
702
|
+
def state_raw(self) -> int:
|
|
703
|
+
"""Return charger's state int form."""
|
|
704
|
+
assert self._status is not None
|
|
705
|
+
return self._status["state"]
|
|
706
|
+
|
|
691
707
|
@property
|
|
692
708
|
def charge_time_elapsed(self) -> int:
|
|
693
709
|
"""Return elapsed charging time."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|