diff --git a/homeassistant/components/volvo/coordinator.py b/homeassistant/components/volvo/coordinator.py index d42ca6e9c94c8b..43057c1e141a5a 100644 --- a/homeassistant/components/volvo/coordinator.py +++ b/homeassistant/components/volvo/coordinator.py @@ -297,9 +297,9 @@ def __init__( async def _async_determine_api_calls( self, ) -> list[Callable[[], Coroutine[Any, Any, Any]]]: - api_calls: list[Any] = [] api = self.context.api vehicle = self.context.vehicle + api_calls: list[Any] = [api.async_get_engine_status] if vehicle.has_battery_engine(): capabilities = await api.async_get_energy_capabilities() @@ -317,9 +317,6 @@ def _normalize_key(key: str) -> str: api_calls.append(self._async_get_energy_state) - if vehicle.has_combustion_engine(): - api_calls.append(api.async_get_engine_status) - return api_calls async def _async_get_energy_state( diff --git a/tests/components/volvo/snapshots/test_binary_sensor.ambr b/tests/components/volvo/snapshots/test_binary_sensor.ambr index 2ebbe4890888d4..40922692108a46 100644 --- a/tests/components/volvo/snapshots/test_binary_sensor.ambr +++ b/tests/components/volvo/snapshots/test_binary_sensor.ambr @@ -538,6 +538,55 @@ 'state': 'off', }) # --- +# name: test_binary_sensor[ex30_2024][binary_sensor.volvo_ex30_engine_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.volvo_ex30_engine_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Engine status', + 'platform': 'volvo', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'engine_status', + 'unique_id': 'yv1abcdefg1234567_engine_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensor[ex30_2024][binary_sensor.volvo_ex30_engine_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'running', + 'friendly_name': 'Volvo EX30 Engine status', + }), + 'context': , + 'entity_id': 'binary_sensor.volvo_ex30_engine_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor[ex30_2024][binary_sensor.volvo_ex30_fog_light_front-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -4801,6 +4850,55 @@ 'state': 'off', }) # --- +# name: test_binary_sensor[xc40_electric_2024][binary_sensor.volvo_xc40_engine_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.volvo_xc40_engine_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Engine status', + 'platform': 'volvo', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'engine_status', + 'unique_id': 'yv1abcdefg1234567_engine_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensor[xc40_electric_2024][binary_sensor.volvo_xc40_engine_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'running', + 'friendly_name': 'Volvo XC40 Engine status', + }), + 'context': , + 'entity_id': 'binary_sensor.volvo_xc40_engine_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor[xc40_electric_2024][binary_sensor.volvo_xc40_fog_light_front-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/volvo/snapshots/test_diagnostics.ambr b/tests/components/volvo/snapshots/test_diagnostics.ambr index 8b98a697829696..470a4a9d764684 100644 --- a/tests/components/volvo/snapshots/test_diagnostics.ambr +++ b/tests/components/volvo/snapshots/test_diagnostics.ambr @@ -167,6 +167,13 @@ 'unit': 'mi', 'value': 150, }), + 'engineStatus': dict({ + 'extra_data': dict({ + }), + 'timestamp': '2024-12-30T15:00:00+00:00', + 'unit': None, + 'value': 'STOPPED', + }), 'estimatedChargingTimeToTargetBatteryChargeLevel': dict({ 'extra_data': dict({ 'updated_at': '2025-07-02T08:51:23Z',