mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix path to tesla fleet key file in config folder (#130124)
* Tesla Fleet load key file from config folder * Fix test --------- Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
parent
31a2bb1b98
commit
ecd8dde347
@ -134,7 +134,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: TeslaFleetConfigEntry) -
|
|||||||
signing = product["command_signing"] == "required"
|
signing = product["command_signing"] == "required"
|
||||||
if signing:
|
if signing:
|
||||||
if not tesla.private_key:
|
if not tesla.private_key:
|
||||||
await tesla.get_private_key("config/tesla_fleet.key")
|
await tesla.get_private_key(hass.config.path("tesla_fleet.key"))
|
||||||
api = VehicleSigned(tesla.vehicle, vin)
|
api = VehicleSigned(tesla.vehicle, vin)
|
||||||
else:
|
else:
|
||||||
api = VehicleSpecific(tesla.vehicle, vin)
|
api = VehicleSpecific(tesla.vehicle, vin)
|
||||||
|
@ -77,9 +77,13 @@ async def test_press_signing_error(
|
|||||||
new_product["response"][0]["command_signing"] = "required"
|
new_product["response"][0]["command_signing"] = "required"
|
||||||
mock_products.return_value = new_product
|
mock_products.return_value = new_product
|
||||||
|
|
||||||
|
with (
|
||||||
|
patch("homeassistant.components.tesla_fleet.TeslaFleetApi.get_private_key"),
|
||||||
|
):
|
||||||
await setup_platform(hass, normal_config_entry, [Platform.BUTTON])
|
await setup_platform(hass, normal_config_entry, [Platform.BUTTON])
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
patch("homeassistant.components.tesla_fleet.TeslaFleetApi.get_private_key"),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.tesla_fleet.VehicleSigned.flash_lights",
|
"homeassistant.components.tesla_fleet.VehicleSigned.flash_lights",
|
||||||
side_effect=NotOnWhitelistFault,
|
side_effect=NotOnWhitelistFault,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user