Skip to content

Fix ClimateControl using hardcoded API_BASE_URL instead of vehicle base_url#203

Merged
DasBasti merged 3 commits into
mainfrom
copilot/fix-climate-control-api-url
Jun 11, 2026
Merged

Fix ClimateControl using hardcoded API_BASE_URL instead of vehicle base_url#203
DasBasti merged 3 commits into
mainfrom
copilot/fix-climate-control-api-url

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Climate control commands fail on Smart #5 vehicles with error 8060: The vehicle corresponding to the VIN does not exist because ClimateControl uses hardcoded API_BASE_URL (v1) instead of the vehicle's base_url, which resolves to API_BASE_URL_V2 for Smart #5 (HY series).

ChargingControl already handles this correctly. This change aligns ClimateControl with that pattern:

# Before
API_BASE_URL + API_TELEMATICS_URL + self.vin

# After
self.account.vehicles[self.vin].base_url + API_TELEMATICS_URL + self.vin

…eControl

Replace hardcoded API_BASE_URL with self.account.vehicles[self.vin].base_url
in climate.py, matching the pattern already used by ChargingControl.
This fixes climate control commands failing on Smart #5 vehicles (error 8060)
which require API_BASE_URL_V2.

Closes #201
Copilot AI changed the title [WIP] Fix hardcoded API_BASE_URL in climate control Fix ClimateControl using hardcoded API_BASE_URL instead of vehicle base_url Jun 11, 2026
Copilot AI requested a review from DasBasti June 11, 2026 18:58
@DasBasti DasBasti marked this pull request as ready for review June 11, 2026 19:07
Copilot AI review requested due to automatic review settings June 11, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Smart #5 (HY series) climate control failures by building the telematics endpoint URL from the selected vehicle’s resolved base_url (v1 vs v2) instead of the hardcoded API_BASE_URL, aligning ClimateControll with existing control patterns (e.g., charging control).

Changes:

  • Remove the hardcoded API_BASE_URL dependency from climate control.
  • Construct the telematics PUT URL using self.account.vehicles[self.vin].base_url so Smart #5 routes to the v2 host.

Comment thread pysmarthashtag/control/climate.py
Copilot AI requested a review from DasBasti June 11, 2026 19:17
@DasBasti DasBasti merged commit 61d9f82 into main Jun 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants