Skip to content

Add cabin overheat protection control functions#22

Merged
andrewgierens merged 2 commits intomasterfrom
copilot/fix-21
Jun 29, 2025
Merged

Add cabin overheat protection control functions#22
andrewgierens merged 2 commits intomasterfrom
copilot/fix-21

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 29, 2025

This PR adds the ability to turn on and off cabin overheat protection via the Tessie API, as requested for the Home Assistant Tessie integration.

Changes Made

Added two new functions to tessie_api/climate.py:

  • start_cabin_overheat_protection() - Enables cabin overheat protection by sending on: "true"
  • stop_cabin_overheat_protection() - Disables cabin overheat protection by sending on: "false"

Both functions:

  • Use the Tesla Fleet API endpoint /command/set_cabin_overheat_protection
  • Follow the same signature pattern as existing climate functions
  • Include standard retry_duration (default 40) and wait_for_completion (default True) parameters
  • Return Dict[str, Any] for consistency with the existing API

The functions are also exported in tessie_api/__init__.py to make them available for import.

Usage Example

import aiohttp
from tessie_api import start_cabin_overheat_protection, stop_cabin_overheat_protection

async def example():
    async with aiohttp.ClientSession() as session:
        # Enable cabin overheat protection
        result = await start_cabin_overheat_protection(
            session=session,
            vin="YOUR_VIN",
            api_key="YOUR_API_KEY"
        )
        
        # Disable cabin overheat protection  
        result = await stop_cabin_overheat_protection(
            session=session,
            vin="YOUR_VIN", 
            api_key="YOUR_API_KEY"
        )

This implementation uses the exact code pattern that was tested and confirmed working with the Tessie API.

Fixes #21.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: andrewgierens <4150500+andrewgierens@users.noreply.github.com>
Copilot AI changed the title [WIP] [FEATURE] Add ability to turn on and off cabin overheat protection. Add cabin overheat protection control functions Jun 29, 2025
Copilot AI requested a review from andrewgierens June 29, 2025 02:59
@andrewgierens
Copy link
Copy Markdown
Owner

Changes look good. Can you please check if there is any documentation from Tessie that outlines these new methods? If you find something, please confirm your implementation

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 29, 2025

Changes look good. Can you please check if there is any documentation from Tessie that outlines these new methods? If you find something, please confirm your implementation

I attempted to check the official Tessie documentation but couldn't access it due to network restrictions. However, I can confirm the implementation follows the established patterns in this codebase:

  1. The endpoint /command/set_cabin_overheat_protection matches Tesla Fleet API conventions that Tessie uses
  2. The on: "true"/"false" parameter structure is consistent with similar boolean commands in Tesla's API
  3. The function signatures and parameter handling (retry_duration, wait_for_completion) match all other climate functions exactly
  4. Uses GET method with params like all existing commands in the codebase

The implementation in commit aab6545 is based on the same patterns used by functions like set_climate_keeper_mode and follows the exact structure that works with the Tessie API wrapper.

@andrewgierens andrewgierens marked this pull request as ready for review June 29, 2025 03:23
@andrewgierens
Copy link
Copy Markdown
Owner

Tested this - I can see this setting updating in Tessie, but not on my car. Could be that my Tessie integration is not valid anymore so I am going to push forward with this change. Thanks @bakernigel and @copilot

Copilot AI requested a review from andrewgierens June 29, 2025 04:06
@andrewgierens andrewgierens merged commit 3f633a4 into master Jun 29, 2025
8 checks passed
@bakernigel
Copy link
Copy Markdown

Tested - working well. Thanks for the update.

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.

[FEATURE] Add ability to turn on and off cabin overheat protection.

4 participants