From d7e3df1974221957d3cbe7a36b1599e031e89a40 Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Mon, 5 Aug 2024 17:59:33 +1000 Subject: [PATCH] Fix class attribute condition in Tesla Fleet (#123162) --- homeassistant/components/tesla_fleet/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tesla_fleet/__init__.py b/homeassistant/components/tesla_fleet/__init__.py index 2c5ee1b5c75..8257bf75cd0 100644 --- a/homeassistant/components/tesla_fleet/__init__.py +++ b/homeassistant/components/tesla_fleet/__init__.py @@ -86,7 +86,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: TeslaFleetConfigEntry) - vehicles: list[TeslaFleetVehicleData] = [] energysites: list[TeslaFleetEnergyData] = [] for product in products: - if "vin" in product and tesla.vehicle: + if "vin" in product and hasattr(tesla, "vehicle"): # Remove the protobuff 'cached_data' that we do not use to save memory product.pop("cached_data", None) vin = product["vin"] @@ -111,7 +111,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: TeslaFleetConfigEntry) - device=device, ) ) - elif "energy_site_id" in product and tesla.energy: + elif "energy_site_id" in product and hasattr(tesla, "energy"): site_id = product["energy_site_id"] if not ( product["components"]["battery"]