diff --git a/openevsehttp/__init__.py b/openevsehttp/__init__.py index a24cb9d..af64ecf 100644 --- a/openevsehttp/__init__.py +++ b/openevsehttp/__init__.py @@ -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: @@ -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() @@ -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) diff --git a/setup.py b/setup.py index 9d03380..0ace299 100644 --- a/setup.py +++ b/setup.py @@ -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",