Skip to content

Commit 9c3b22e

Browse files
authored
Check callhandling
1 parent 7b89ab2 commit 9c3b22e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

custom_components/stromer/stromer.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,8 @@ async def stromer_reset_trip_data(self) -> None:
203203

204204
headers = {"Authorization": f"Bearer {self._token}"}
205205
res = await self._websession.delete(url, headers=headers)
206-
ret = json.loads(await res.text())
207-
log = "API reset trip status: %s" % res.status
208-
LOGGER.debug(log)
209-
log = "API reset trip returns: %s" % ret
210-
LOGGER.debug(log)
206+
if ret.status != 204:
207+
raise ApiError
211208

212209
async def stromer_call_api(self, endpoint: str) -> Any:
213210
"""Retrieve data from the API."""

0 commit comments

Comments
 (0)