Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions openevsehttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,13 @@ async def process_request(

async with aiohttp.ClientSession() as session:
http_method = getattr(session, method)
async with http_method(url, data=data, auth=auth) as resp:
_LOGGER.debug(
"Connecting to %s with data payload of %s using method %s",
url,
data,
method,
)
async with http_method(url, json=data, auth=auth) as resp:
try:
message = await resp.json()
except TimeoutError:
Expand All @@ -206,7 +212,7 @@ async def process_request(
message = {"msg": resp}

if resp.status == 400:
_LOGGER.error("%s", message["msg"])
_LOGGER.error("Error 400: %s", message["msg"])
raise ParseJSONError
if resp.status == 401:
error = await resp.text()
Expand Down Expand Up @@ -459,6 +465,7 @@ async def set_current(self, amps: int = 6) -> None:
):
_LOGGER.error("Invalid value for max_current_soft: %s", amps)
raise ValueError

data = {"max_current_soft": amps}

_LOGGER.debug("Setting max_current_soft to %s", amps)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
VERSION = "0.1.18"
VERSION = "0.1.19"

setup(
name="python-openevse-http",
Expand Down