Fix auto seat heater in Teslemetry (#140703)

Fix auto seat heater
This commit is contained in:
Brett Adams 2025-03-16 19:16:21 +10:00 committed by GitHub
parent 5f8564bfc5
commit 011a076155
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ from dataclasses import dataclass
from itertools import chain
from typing import Any
from tesla_fleet_api.const import Scope, Seat
from tesla_fleet_api.const import Scope
from teslemetry_stream import TeslemetryStreamVehicle
from homeassistant.components.switch import (
@ -62,21 +62,15 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetrySwitchEntityDescription, ...] = (
TeslemetrySwitchEntityDescription(
key="climate_state_auto_seat_climate_left",
streaming_listener=lambda x, y: x.listen_AutoSeatClimateLeft(y),
on_func=lambda api: api.remote_auto_seat_climate_request(Seat.FRONT_LEFT, True),
off_func=lambda api: api.remote_auto_seat_climate_request(
Seat.FRONT_LEFT, False
),
on_func=lambda api: api.remote_auto_seat_climate_request(1, True),
off_func=lambda api: api.remote_auto_seat_climate_request(1, False),
scopes=[Scope.VEHICLE_CMDS],
),
TeslemetrySwitchEntityDescription(
key="climate_state_auto_seat_climate_right",
streaming_listener=lambda x, y: x.listen_AutoSeatClimateRight(y),
on_func=lambda api: api.remote_auto_seat_climate_request(
Seat.FRONT_RIGHT, True
),
off_func=lambda api: api.remote_auto_seat_climate_request(
Seat.FRONT_RIGHT, False
),
on_func=lambda api: api.remote_auto_seat_climate_request(2, True),
off_func=lambda api: api.remote_auto_seat_climate_request(2, False),
scopes=[Scope.VEHICLE_CMDS],
),
TeslemetrySwitchEntityDescription(