mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 07:05:48 +01:00
Enable volvo engine status for all engine types (#158437)
This commit is contained in:
@@ -297,9 +297,9 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
||||
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 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
||||
|
||||
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(
|
||||
|
||||
@@ -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': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'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': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
|
||||
'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': <ANY>,
|
||||
'entity_id': 'binary_sensor.volvo_ex30_engine_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'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': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'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': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
|
||||
'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': <ANY>,
|
||||
'entity_id': 'binary_sensor.volvo_xc40_engine_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensor[xc40_electric_2024][binary_sensor.volvo_xc40_fog_light_front-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user