mirror of
https://github.com/home-assistant/core.git
synced 2025-12-19 18:38:58 +00:00
Adjust volvo update interval (#159200)
This commit is contained in:
@@ -27,7 +27,7 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, Upda
|
||||
|
||||
from .const import DATA_BATTERY_CAPACITY, DOMAIN
|
||||
|
||||
VERY_SLOW_INTERVAL = 60
|
||||
VERY_SLOW_INTERVAL = 30
|
||||
SLOW_INTERVAL = 15
|
||||
MEDIUM_INTERVAL = 2
|
||||
FAST_INTERVAL = 1
|
||||
@@ -214,11 +214,8 @@ class VolvoVerySlowIntervalCoordinator(VolvoBaseCoordinator):
|
||||
api = self.context.api
|
||||
|
||||
return [
|
||||
api.async_get_brakes_status,
|
||||
api.async_get_command_accessibility,
|
||||
api.async_get_diagnostics,
|
||||
api.async_get_engine_warnings,
|
||||
api.async_get_odometer,
|
||||
api.async_get_statistics,
|
||||
api.async_get_tyre_states,
|
||||
api.async_get_warnings,
|
||||
]
|
||||
@@ -260,16 +257,17 @@ class VolvoSlowIntervalCoordinator(VolvoBaseCoordinator):
|
||||
self,
|
||||
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
||||
api = self.context.api
|
||||
api_calls: list[Any] = [api.async_get_command_accessibility]
|
||||
api_calls: list[Any] = [
|
||||
api.async_get_brakes_status,
|
||||
api.async_get_engine_warnings,
|
||||
api.async_get_odometer,
|
||||
]
|
||||
|
||||
location = await api.async_get_location()
|
||||
|
||||
if location.get("location") is not None:
|
||||
api_calls.append(api.async_get_location)
|
||||
|
||||
if self.context.vehicle.has_combustion_engine():
|
||||
api_calls.append(api.async_get_fuel_status)
|
||||
|
||||
return api_calls
|
||||
|
||||
|
||||
@@ -299,7 +297,10 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
||||
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
||||
api = self.context.api
|
||||
vehicle = self.context.vehicle
|
||||
api_calls: list[Any] = [api.async_get_engine_status]
|
||||
api_calls: list[Any] = [
|
||||
api.async_get_engine_status,
|
||||
api.async_get_statistics,
|
||||
]
|
||||
|
||||
if vehicle.has_battery_engine():
|
||||
capabilities = await api.async_get_energy_capabilities()
|
||||
@@ -317,6 +318,9 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
||||
|
||||
api_calls.append(self._async_get_energy_state)
|
||||
|
||||
if self.context.vehicle.has_combustion_engine():
|
||||
api_calls.append(api.async_get_fuel_status)
|
||||
|
||||
return api_calls
|
||||
|
||||
async def _async_get_energy_state(
|
||||
|
||||
@@ -95,6 +95,27 @@
|
||||
}),
|
||||
}),
|
||||
'Volvo medium interval coordinator': dict({
|
||||
'averageEnergyConsumption': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:53:44.785000+00:00',
|
||||
'unit': 'kWh/100km',
|
||||
'value': 22.6,
|
||||
}),
|
||||
'averageSpeed': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km/h',
|
||||
'value': 53,
|
||||
}),
|
||||
'averageSpeedAutomatic': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km/h',
|
||||
'value': 26,
|
||||
}),
|
||||
'batteryChargeLevel': dict({
|
||||
'extra_data': dict({
|
||||
'updated_at': '2025-07-02T08:51:23Z',
|
||||
@@ -158,6 +179,13 @@
|
||||
'unit': None,
|
||||
'value': 'AC',
|
||||
}),
|
||||
'distanceToEmptyBattery': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:30:08.338000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 250,
|
||||
}),
|
||||
'electricRange': dict({
|
||||
'extra_data': dict({
|
||||
'updated_at': '2025-07-02T08:51:23Z',
|
||||
@@ -192,14 +220,35 @@
|
||||
'unit': 'percentage',
|
||||
'value': 90,
|
||||
}),
|
||||
}),
|
||||
'Volvo slow interval coordinator': dict({
|
||||
'availabilityStatus': dict({
|
||||
'tripMeterAutomatic': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:32:26.169000+00:00',
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 18.2,
|
||||
}),
|
||||
'tripMeterManual': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 3822.9,
|
||||
}),
|
||||
}),
|
||||
'Volvo slow interval coordinator': dict({
|
||||
'brakeFluidLevelWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': None,
|
||||
'value': 'AVAILABLE',
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'engineCoolantLevelWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'location': dict({
|
||||
'extra_data': dict({
|
||||
@@ -218,41 +267,34 @@
|
||||
}),
|
||||
'type': 'Feature',
|
||||
}),
|
||||
}),
|
||||
'Volvo very slow interval coordinator': dict({
|
||||
'averageEnergyConsumption': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:53:44.785000+00:00',
|
||||
'unit': 'kWh/100km',
|
||||
'value': 22.6,
|
||||
}),
|
||||
'averageSpeed': dict({
|
||||
'odometer': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km/h',
|
||||
'value': 53,
|
||||
'unit': 'km',
|
||||
'value': 30000,
|
||||
}),
|
||||
'averageSpeedAutomatic': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km/h',
|
||||
'value': 26,
|
||||
}),
|
||||
'battery_capacity_kwh': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'value': 81.608,
|
||||
}),
|
||||
'brakeFluidLevelWarning': dict({
|
||||
'oilLevelWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
}),
|
||||
'Volvo very slow interval coordinator': dict({
|
||||
'availabilityStatus': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:32:26.169000+00:00',
|
||||
'unit': None,
|
||||
'value': 'AVAILABLE',
|
||||
}),
|
||||
'battery_capacity_kwh': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'value': 81.608,
|
||||
}),
|
||||
'brakeLightCenterWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
@@ -288,13 +330,6 @@
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'distanceToEmptyBattery': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:30:08.338000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 250,
|
||||
}),
|
||||
'distanceToService': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
@@ -302,13 +337,6 @@
|
||||
'unit': 'km',
|
||||
'value': 29000,
|
||||
}),
|
||||
'engineCoolantLevelWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'engineHoursToService': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
@@ -379,20 +407,6 @@
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'odometer': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 30000,
|
||||
}),
|
||||
'oilLevelWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': None,
|
||||
'value': 'NO_WARNING',
|
||||
}),
|
||||
'positionLightFrontLeftWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
@@ -470,20 +484,6 @@
|
||||
'unit': 'months',
|
||||
'value': 23,
|
||||
}),
|
||||
'tripMeterAutomatic': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 18.2,
|
||||
}),
|
||||
'tripMeterManual': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||
'unit': 'km',
|
||||
'value': 3822.9,
|
||||
}),
|
||||
'turnIndicationFrontLeftWarning': dict({
|
||||
'extra_data': dict({
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user