diff --git a/homeassistant/components/tesla_fleet/manifest.json b/homeassistant/components/tesla_fleet/manifest.json index dfab47d2f694..6fdf4a6b6b7f 100644 --- a/homeassistant/components/tesla_fleet/manifest.json +++ b/homeassistant/components/tesla_fleet/manifest.json @@ -8,5 +8,5 @@ "integration_type": "hub", "iot_class": "cloud_polling", "loggers": ["tesla-fleet-api"], - "requirements": ["tesla-fleet-api==1.4.7"] + "requirements": ["tesla-fleet-api==1.5.2"] } diff --git a/homeassistant/components/tesla_fleet/switch.py b/homeassistant/components/tesla_fleet/switch.py index c71638789d2b..95b4eabffbd6 100644 --- a/homeassistant/components/tesla_fleet/switch.py +++ b/homeassistant/components/tesla_fleet/switch.py @@ -5,7 +5,7 @@ from dataclasses import dataclass from itertools import chain from typing import Any, override -from tesla_fleet_api.const import AutoSeat, Scope, Seat +from tesla_fleet_api.const import AutoSeat, Scope from homeassistant.components.switch import ( SwitchDeviceClass, @@ -48,7 +48,7 @@ VEHICLE_DESCRIPTIONS: tuple[TeslaFleetSwitchEntityDescription, ...] = ( AutoSeat.FRONT_LEFT, True ), off_func=lambda api: api.remote_auto_seat_climate_request( - Seat.FRONT_LEFT, False + AutoSeat.FRONT_LEFT, False ), scopes=[Scope.VEHICLE_CMDS], ), diff --git a/homeassistant/components/teslemetry/manifest.json b/homeassistant/components/teslemetry/manifest.json index 2ad8a28fa88d..d56b3c6a30e0 100644 --- a/homeassistant/components/teslemetry/manifest.json +++ b/homeassistant/components/teslemetry/manifest.json @@ -9,5 +9,5 @@ "iot_class": "cloud_polling", "loggers": ["tesla-fleet-api"], "quality_scale": "platinum", - "requirements": ["tesla-fleet-api==1.4.7", "teslemetry-stream==0.9.1"] + "requirements": ["tesla-fleet-api==1.5.2", "teslemetry-stream==0.9.1"] } diff --git a/homeassistant/components/tessie/manifest.json b/homeassistant/components/tessie/manifest.json index eb35db884ef8..7d653e6d4019 100644 --- a/homeassistant/components/tessie/manifest.json +++ b/homeassistant/components/tessie/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["tessie", "tesla-fleet-api"], "quality_scale": "silver", - "requirements": ["tessie-api==0.1.3", "tesla-fleet-api==1.4.7"] + "requirements": ["tessie-api==0.1.3", "tesla-fleet-api==1.5.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index b20a884494a1..ccbd557768e6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -3143,7 +3143,7 @@ temperusb==1.6.1 # homeassistant.components.tesla_fleet # homeassistant.components.teslemetry # homeassistant.components.tessie -tesla-fleet-api==1.4.7 +tesla-fleet-api==1.5.2 # homeassistant.components.powerwall tesla-powerwall==0.5.3 diff --git a/tests/components/tesla_fleet/test_switch.py b/tests/components/tesla_fleet/test_switch.py index dcdf66b7cc18..ac418721cb21 100644 --- a/tests/components/tesla_fleet/test_switch.py +++ b/tests/components/tesla_fleet/test_switch.py @@ -4,6 +4,7 @@ from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion +from tesla_fleet_api.const import AutoSeat from tesla_fleet_api.exceptions import VehicleOffline from homeassistant.components.switch import ( @@ -150,6 +151,27 @@ async def test_switch_services( call.assert_called_once() +async def test_switch_auto_seat_climate_off_seat_position( + hass: HomeAssistant, + normal_config_entry: MockConfigEntry, +) -> None: + """Tests that turning off auto seat climate sends the 1-indexed AutoSeat position.""" + + await setup_platform(hass, normal_config_entry, [Platform.SWITCH]) + + with patch( + "tesla_fleet_api.tesla.VehicleFleet.remote_auto_seat_climate_request", + return_value=COMMAND_OK, + ) as call: + await hass.services.async_call( + SWITCH_DOMAIN, + SERVICE_TURN_OFF, + {ATTR_ENTITY_ID: "switch.test_auto_seat_climate_left"}, + blocking=True, + ) + call.assert_called_once_with(AutoSeat.FRONT_LEFT, False) + + async def test_switch_no_scope( hass: HomeAssistant, entity_registry: er.EntityRegistry,