mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
parent
d51070c99b
commit
66c03713b7
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from tesla_fleet_api.const import Scope, Seat
|
from tesla_fleet_api.const import AutoSeat, Scope, Seat
|
||||||
|
|
||||||
from homeassistant.components.switch import (
|
from homeassistant.components.switch import (
|
||||||
SwitchDeviceClass,
|
SwitchDeviceClass,
|
||||||
@ -46,7 +46,9 @@ VEHICLE_DESCRIPTIONS: tuple[TeslaFleetSwitchEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
TeslaFleetSwitchEntityDescription(
|
TeslaFleetSwitchEntityDescription(
|
||||||
key="climate_state_auto_seat_climate_left",
|
key="climate_state_auto_seat_climate_left",
|
||||||
on_func=lambda api: api.remote_auto_seat_climate_request(Seat.FRONT_LEFT, True),
|
on_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
|
AutoSeat.FRONT_LEFT, True
|
||||||
|
),
|
||||||
off_func=lambda api: api.remote_auto_seat_climate_request(
|
off_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
Seat.FRONT_LEFT, False
|
Seat.FRONT_LEFT, False
|
||||||
),
|
),
|
||||||
@ -55,10 +57,10 @@ VEHICLE_DESCRIPTIONS: tuple[TeslaFleetSwitchEntityDescription, ...] = (
|
|||||||
TeslaFleetSwitchEntityDescription(
|
TeslaFleetSwitchEntityDescription(
|
||||||
key="climate_state_auto_seat_climate_right",
|
key="climate_state_auto_seat_climate_right",
|
||||||
on_func=lambda api: api.remote_auto_seat_climate_request(
|
on_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
Seat.FRONT_RIGHT, True
|
AutoSeat.FRONT_RIGHT, True
|
||||||
),
|
),
|
||||||
off_func=lambda api: api.remote_auto_seat_climate_request(
|
off_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
Seat.FRONT_RIGHT, False
|
AutoSeat.FRONT_RIGHT, False
|
||||||
),
|
),
|
||||||
scopes=[Scope.VEHICLE_CMDS],
|
scopes=[Scope.VEHICLE_CMDS],
|
||||||
),
|
),
|
||||||
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from tesla_fleet_api.const import Scope
|
from tesla_fleet_api.const import AutoSeat, Scope
|
||||||
from teslemetry_stream import TeslemetryStreamVehicle
|
from teslemetry_stream import TeslemetryStreamVehicle
|
||||||
|
|
||||||
from homeassistant.components.switch import (
|
from homeassistant.components.switch import (
|
||||||
@ -62,15 +62,23 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetrySwitchEntityDescription, ...] = (
|
|||||||
TeslemetrySwitchEntityDescription(
|
TeslemetrySwitchEntityDescription(
|
||||||
key="climate_state_auto_seat_climate_left",
|
key="climate_state_auto_seat_climate_left",
|
||||||
streaming_listener=lambda x, y: x.listen_AutoSeatClimateLeft(y),
|
streaming_listener=lambda x, y: x.listen_AutoSeatClimateLeft(y),
|
||||||
on_func=lambda api: api.remote_auto_seat_climate_request(1, True),
|
on_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
off_func=lambda api: api.remote_auto_seat_climate_request(1, False),
|
AutoSeat.FRONT_LEFT, True
|
||||||
|
),
|
||||||
|
off_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
|
AutoSeat.FRONT_LEFT, False
|
||||||
|
),
|
||||||
scopes=[Scope.VEHICLE_CMDS],
|
scopes=[Scope.VEHICLE_CMDS],
|
||||||
),
|
),
|
||||||
TeslemetrySwitchEntityDescription(
|
TeslemetrySwitchEntityDescription(
|
||||||
key="climate_state_auto_seat_climate_right",
|
key="climate_state_auto_seat_climate_right",
|
||||||
streaming_listener=lambda x, y: x.listen_AutoSeatClimateRight(y),
|
streaming_listener=lambda x, y: x.listen_AutoSeatClimateRight(y),
|
||||||
on_func=lambda api: api.remote_auto_seat_climate_request(2, True),
|
on_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
off_func=lambda api: api.remote_auto_seat_climate_request(2, False),
|
AutoSeat.FRONT_RIGHT, True
|
||||||
|
),
|
||||||
|
off_func=lambda api: api.remote_auto_seat_climate_request(
|
||||||
|
AutoSeat.FRONT_RIGHT, False
|
||||||
|
),
|
||||||
scopes=[Scope.VEHICLE_CMDS],
|
scopes=[Scope.VEHICLE_CMDS],
|
||||||
),
|
),
|
||||||
TeslemetrySwitchEntityDescription(
|
TeslemetrySwitchEntityDescription(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user