ha-porscheconnect icon indicating copy to clipboard operation
ha-porscheconnect copied to clipboard

directCharge.isActive switch does not work

Open barto64 opened this issue 1 year ago • 3 comments

Version of the custom_component

0.0.13

Configuration

N/A

Describe the bug

The switch directCharge.isActive does not work, when trying to execute the swith.turn.on service it produces an error. Log attached. Nevertheless, it works fine from the mobile app and when directCharge is activated by the App the switch gets its satus updated inHA.

Debug log

2023-05-25 14:09:18.961 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472504004032] unexpected character: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call await result File "/config/custom_components/porscheconnect/switch.py", line 38, in async_turn_on await self.coordinator.controller.directChargeOn(self.vin, None, True) File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/client.py", line 401, in directChargeOn return await self._setDirectCharge( File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/client.py", line 100, in _setDirectCharge progressResult = await self._connection.post( File "/usr/local/lib/python3.10/site-packages/pyporscheconnectapi/connection.py", line 213, in post return await resp.json() File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 72, in json return await super().json(*args, loads=loads, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1120, in json return loads(stripped.decode(encoding)) orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)

barto64 avatar May 25 '23 12:05 barto64