Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions custom_components/toyota/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,19 @@ async def async_setup_entry(
def _vehicle_has_climate_capability(vehicle: Vehicle) -> bool:
"""Check if vehicle supports climate control."""
try:
return getattr(
getattr(vehicle._vehicle_info, "features", False), # noqa : SLF001
"climate_start_engine",
False,
)
caps = getattr(vehicle._vehicle_info, "extended_capabilities", False) # noqa : SLF001
for cap in [
"climate_capable",
"econnect_climate_capable",
"remote_engine_start_stop",
]:
if getattr(caps, cap, False):
return True
except Exception: # pylint: disable=W0718 # noqa : BLE001
return False

return False


class ToyotaClimate(ToyotaBaseEntity, ClimateEntity):
"""Representation of a Toyota climate control."""
Expand Down
Loading