Skip to content

Commit

Permalink
Add reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Oct 9, 2024
1 parent c56ff48 commit aae5cf7
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions tesla_fleet_api/vehiclesigned.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,33 +279,11 @@ async def _send(self, domain: int, command: bytes) -> dict[str, Any]:
return {"response": {"result": False}}

LOGGER.debug(resp)
reason = resp.protobuf_message_as_bytes[8:].decode()

if domain == DOMAIN_INFOTAINMENT:
resp_msg = Action()
resp_msg.ParseFromString(resp.protobuf_message_as_bytes)
print("INFOTAINMENT RESPONSE", resp_msg)
elif domain == DOMAIN_VEHICLE_SECURITY:
resp_msg = UnsignedMessage()
resp_msg.ParseFromString(resp.protobuf_message_as_bytes)
print("VCSEC RESPONSE", resp_msg)


if resp.protobuf_message_as_bytes and (
text := resp.protobuf_message_as_bytes.decode()
):
LOGGER.warning(text)

# if domain == DOMAIN_INFOTAINMENT:
# resp_msg = Action()
# resp_msg.ParseFromString(resp.protobuf_message_as_bytes)
# print("INFOTAINMENT RESPONSE", resp_msg)
# #return {"response": {"result": False, "reason": resp_msg}}
# elif domain == DOMAIN_VEHICLE_SECURITY:
# resp_msg = UnsignedMessage()
# resp_msg.ParseFromString(resp.protobuf_message_as_bytes)
# print("VCSEC RESPONSE", resp_msg)
# print(resp.protobuf_message_as_bytes.encode())
# #return {"response": {"result": False, "reason": resp_msg}}
if reason:
LOGGER.error(reason)
return {"response": {"result": False, "reason": reason}}

return {"response": {"result": True, "reason": ""}}

Expand Down

0 comments on commit aae5cf7

Please sign in to comment.