Skip to content

Commit

Permalink
chore: pre-commit autoupdate (#711)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.1 →
v0.9.2](astral-sh/ruff-pre-commit@v0.9.1...v0.9.2)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 21, 2025
1 parent a64116a commit 9b7a87b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
autoupdate_commit_msg: "chore: pre-commit autoupdate"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
rev: v0.9.2
hooks:
- id: ruff
args:
Expand Down
40 changes: 13 additions & 27 deletions hyundai_kia_connect_api/KiaUvoApiEU.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,17 +917,11 @@ def lock_action(
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/door"

payload = {"command": action.value}
headers = self._get_control_headers(
token, vehicle
)
headers = self._get_control_headers(token, vehicle)

_LOGGER.debug(f"{DOMAIN} - Lock Action Request: {payload}")

response = requests.post(
url,
json=payload,
headers=headers
).json()

response = requests.post(url, json=payload, headers=headers).json()
_LOGGER.debug(f"{DOMAIN} - Lock Action Response: {response}")
_check_response_for_errors(response)
token.device_id = self._get_device_id(self._get_stamp())
Expand Down Expand Up @@ -1029,19 +1023,15 @@ def start_charge(self, token: Token, vehicle: Vehicle) -> str:
)

else:
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
url = (
self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
)

payload = {"command": "start"}
headers = self._get_control_headers(
token, vehicle
)
headers = self._get_control_headers(token, vehicle)

_LOGGER.debug(f"{DOMAIN} - Start Charge Action Request: {payload}")
response = requests.post(
url,
json=payload,
headers=headers
).json()
response = requests.post(url, json=payload, headers=headers).json()
_LOGGER.debug(f"{DOMAIN} - Start Charge Action Response: {response}")
_check_response_for_errors(response)
token.device_id = self._get_device_id(self._get_stamp())
Expand All @@ -1057,19 +1047,15 @@ def stop_charge(self, token: Token, vehicle: Vehicle) -> str:
)

else:
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
url = (
self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/charge"
)

payload = {"command": "stop"}
headers = self._get_control_headers(
token, vehicle
)
headers = self._get_control_headers(token, vehicle)

_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Request: {payload}")
response = requests.post(
url,
json=payload,
headers=headers
).json()
response = requests.post(url, json=payload, headers=headers).json()
_LOGGER.debug(f"{DOMAIN} - Stop Charge Action Response: {response}")
_check_response_for_errors(response)
token.device_id = self._get_device_id(self._get_stamp())
Expand Down

0 comments on commit 9b7a87b

Please sign in to comment.