mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Add missing data description string in Tesla Fleet (#161201)
Co-authored-by: Josef Zweck <josef@zweck.dev> Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
@@ -24,12 +24,18 @@ async def wake_up_vehicle(vehicle: TeslaFleetVehicleData) -> None:
|
||||
cmd = await vehicle.api.vehicle()
|
||||
state = cmd["response"]["state"]
|
||||
except TeslaFleetError as e:
|
||||
raise HomeAssistantError(str(e)) from e
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="wake_up_failed",
|
||||
) from e
|
||||
vehicle.coordinator.data["state"] = state
|
||||
if state != TeslaFleetState.ONLINE:
|
||||
times += 1
|
||||
if times >= 4: # Give up after 30 seconds total
|
||||
raise HomeAssistantError("Could not wake up vehicle")
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="wake_up_timeout",
|
||||
)
|
||||
await asyncio.sleep(times * 5)
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
"data": {
|
||||
"domain": "Domain"
|
||||
},
|
||||
"data_description": {
|
||||
"domain": "The domain that hosts your public key for Tesla Fleet API authentication."
|
||||
},
|
||||
"description": "Enter the domain that will host your public key. This is typically the domain of the origin you specified during registration at {dashboard}.",
|
||||
"title": "Tesla Fleet domain registration"
|
||||
},
|
||||
@@ -51,6 +54,12 @@
|
||||
"title": "[%key:common::config_flow::title::reauth%]"
|
||||
},
|
||||
"registration_complete": {
|
||||
"data": {
|
||||
"qr_code": "QR code"
|
||||
},
|
||||
"data_description": {
|
||||
"qr_code": "Scan this QR code with your phone to set up the virtual key."
|
||||
},
|
||||
"description": "To enable command signing, you must open the Tesla app, select your vehicle, and then visit the following URL to set up a virtual key. You must repeat this process for each vehicle.\n\n{virtual_key_url}",
|
||||
"title": "Command signing"
|
||||
}
|
||||
@@ -623,6 +632,12 @@
|
||||
},
|
||||
"update_failed": {
|
||||
"message": "{endpoint} data request failed: {message}"
|
||||
},
|
||||
"wake_up_failed": {
|
||||
"message": "Failed to wake up vehicle"
|
||||
},
|
||||
"wake_up_timeout": {
|
||||
"message": "Could not wake up vehicle"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,8 @@ async def test_asleep_or_offline(
|
||||
# Run a command but fail trying to wake up the vehicle
|
||||
mock_wake_up.side_effect = InvalidCommand
|
||||
with pytest.raises(
|
||||
HomeAssistantError, match="The data request or command is unknown."
|
||||
HomeAssistantError,
|
||||
match="Failed to wake up vehicle",
|
||||
):
|
||||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
|
||||
Reference in New Issue
Block a user