diff --git a/homeassistant/components/teslemetry/switch.py b/homeassistant/components/teslemetry/switch.py index acd17ac4165..f1082122e5c 100644 --- a/homeassistant/components/teslemetry/switch.py +++ b/homeassistant/components/teslemetry/switch.py @@ -60,6 +60,16 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetrySwitchEntityDescription, ...] = ( off_func=lambda api: api.set_sentry_mode(on=False), scopes=[Scope.VEHICLE_CMDS], ), + TeslemetrySwitchEntityDescription( + key="vehicle_state_valet_mode", + streaming_listener=lambda vehicle, value: vehicle.listen_ValetModeEnabled( + value + ), + streaming_firmware="2024.44.25", + on_func=lambda api: api.set_valet_mode(on=True, password=""), + off_func=lambda api: api.set_valet_mode(on=False, password=""), + scopes=[Scope.VEHICLE_CMDS], + ), TeslemetrySwitchEntityDescription( key="climate_state_auto_seat_climate_left", streaming_listener=lambda vehicle, callback: vehicle.listen_AutoSeatClimateLeft( diff --git a/tests/components/teslemetry/snapshots/test_switch.ambr b/tests/components/teslemetry/snapshots/test_switch.ambr index 0586b454a91..ffbfc06026e 100644 --- a/tests/components/teslemetry/snapshots/test_switch.ambr +++ b/tests/components/teslemetry/snapshots/test_switch.ambr @@ -383,6 +383,54 @@ 'state': 'off', }) # --- +# name: test_switch[switch.test_valet_mode-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.test_valet_mode', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Valet mode', + 'platform': 'teslemetry', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'vehicle_state_valet_mode', + 'unique_id': 'LRW3F7EK4NC700000-vehicle_state_valet_mode', + 'unit_of_measurement': None, + }) +# --- +# name: test_switch[switch.test_valet_mode-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'switch', + 'friendly_name': 'Test Valet mode', + }), + 'context': , + 'entity_id': 'switch.test_valet_mode', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_switch_alt[switch.energy_site_allow_charging_from_grid-statealt] StateSnapshot({ 'attributes': ReadOnlyDict({ @@ -495,6 +543,20 @@ 'state': 'off', }) # --- +# name: test_switch_alt[switch.test_valet_mode-statealt] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'switch', + 'friendly_name': 'Test Valet mode', + }), + 'context': , + 'entity_id': 'switch.test_valet_mode', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_switch_streaming[switch.test_auto_seat_climate_left] 'on' # ---