Skip to content

Commit

Permalink
Fix smart_call error on empty response
Browse files Browse the repository at this point in the history
  • Loading branch information
functionpointer committed Sep 5, 2023
1 parent 796e343 commit c801839
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pychargecloud"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"aiohttp",
"yarl",
Expand Down
4 changes: 2 additions & 2 deletions src/chargecloudapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ async def perform_smart_api_call(
ret = await self.location_by_evse_id(evse_id=evse_id, operator_id=opid)
if len(ret) != 0:
call_data.operator_id = opid
self.logger.info(f"found operator {opid.name}")
self.logger.info(f"{evse_id}: found operator {opid.name}")
break
if ret is None:
if ret is None or len(ret)==0:
return None, call_data
else:
return ret[0], call_data
Expand Down

0 comments on commit c801839

Please sign in to comment.