mirror of
https://github.com/home-assistant/core.git
synced 2025-12-20 02:48:57 +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
|
from .const import DATA_BATTERY_CAPACITY, DOMAIN
|
||||||
|
|
||||||
VERY_SLOW_INTERVAL = 60
|
VERY_SLOW_INTERVAL = 30
|
||||||
SLOW_INTERVAL = 15
|
SLOW_INTERVAL = 15
|
||||||
MEDIUM_INTERVAL = 2
|
MEDIUM_INTERVAL = 2
|
||||||
FAST_INTERVAL = 1
|
FAST_INTERVAL = 1
|
||||||
@@ -214,11 +214,8 @@ class VolvoVerySlowIntervalCoordinator(VolvoBaseCoordinator):
|
|||||||
api = self.context.api
|
api = self.context.api
|
||||||
|
|
||||||
return [
|
return [
|
||||||
api.async_get_brakes_status,
|
api.async_get_command_accessibility,
|
||||||
api.async_get_diagnostics,
|
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_tyre_states,
|
||||||
api.async_get_warnings,
|
api.async_get_warnings,
|
||||||
]
|
]
|
||||||
@@ -260,16 +257,17 @@ class VolvoSlowIntervalCoordinator(VolvoBaseCoordinator):
|
|||||||
self,
|
self,
|
||||||
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
||||||
api = self.context.api
|
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()
|
location = await api.async_get_location()
|
||||||
|
|
||||||
if location.get("location") is not None:
|
if location.get("location") is not None:
|
||||||
api_calls.append(api.async_get_location)
|
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
|
return api_calls
|
||||||
|
|
||||||
|
|
||||||
@@ -299,7 +297,10 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
|||||||
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
) -> list[Callable[[], Coroutine[Any, Any, Any]]]:
|
||||||
api = self.context.api
|
api = self.context.api
|
||||||
vehicle = self.context.vehicle
|
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():
|
if vehicle.has_battery_engine():
|
||||||
capabilities = await api.async_get_energy_capabilities()
|
capabilities = await api.async_get_energy_capabilities()
|
||||||
@@ -317,6 +318,9 @@ class VolvoMediumIntervalCoordinator(VolvoBaseCoordinator):
|
|||||||
|
|
||||||
api_calls.append(self._async_get_energy_state)
|
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
|
return api_calls
|
||||||
|
|
||||||
async def _async_get_energy_state(
|
async def _async_get_energy_state(
|
||||||
|
|||||||
@@ -95,6 +95,27 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
'Volvo medium interval coordinator': dict({
|
'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({
|
'batteryChargeLevel': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
'updated_at': '2025-07-02T08:51:23Z',
|
'updated_at': '2025-07-02T08:51:23Z',
|
||||||
@@ -158,6 +179,13 @@
|
|||||||
'unit': None,
|
'unit': None,
|
||||||
'value': 'AC',
|
'value': 'AC',
|
||||||
}),
|
}),
|
||||||
|
'distanceToEmptyBattery': dict({
|
||||||
|
'extra_data': dict({
|
||||||
|
}),
|
||||||
|
'timestamp': '2024-12-30T14:30:08.338000+00:00',
|
||||||
|
'unit': 'km',
|
||||||
|
'value': 250,
|
||||||
|
}),
|
||||||
'electricRange': dict({
|
'electricRange': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
'updated_at': '2025-07-02T08:51:23Z',
|
'updated_at': '2025-07-02T08:51:23Z',
|
||||||
@@ -192,14 +220,35 @@
|
|||||||
'unit': 'percentage',
|
'unit': 'percentage',
|
||||||
'value': 90,
|
'value': 90,
|
||||||
}),
|
}),
|
||||||
}),
|
'tripMeterAutomatic': dict({
|
||||||
'Volvo slow interval coordinator': dict({
|
|
||||||
'availabilityStatus': dict({
|
|
||||||
'extra_data': 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,
|
'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({
|
'location': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
@@ -218,41 +267,34 @@
|
|||||||
}),
|
}),
|
||||||
'type': 'Feature',
|
'type': 'Feature',
|
||||||
}),
|
}),
|
||||||
}),
|
'odometer': dict({
|
||||||
'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({
|
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||||
'unit': 'km/h',
|
'unit': 'km',
|
||||||
'value': 53,
|
'value': 30000,
|
||||||
}),
|
}),
|
||||||
'averageSpeedAutomatic': dict({
|
'oilLevelWarning': 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({
|
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
||||||
'unit': None,
|
'unit': None,
|
||||||
'value': 'NO_WARNING',
|
'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({
|
'brakeLightCenterWarning': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
@@ -288,13 +330,6 @@
|
|||||||
'unit': None,
|
'unit': None,
|
||||||
'value': 'NO_WARNING',
|
'value': 'NO_WARNING',
|
||||||
}),
|
}),
|
||||||
'distanceToEmptyBattery': dict({
|
|
||||||
'extra_data': dict({
|
|
||||||
}),
|
|
||||||
'timestamp': '2024-12-30T14:30:08.338000+00:00',
|
|
||||||
'unit': 'km',
|
|
||||||
'value': 250,
|
|
||||||
}),
|
|
||||||
'distanceToService': dict({
|
'distanceToService': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
@@ -302,13 +337,6 @@
|
|||||||
'unit': 'km',
|
'unit': 'km',
|
||||||
'value': 29000,
|
'value': 29000,
|
||||||
}),
|
}),
|
||||||
'engineCoolantLevelWarning': dict({
|
|
||||||
'extra_data': dict({
|
|
||||||
}),
|
|
||||||
'timestamp': '2024-12-30T14:18:56.849000+00:00',
|
|
||||||
'unit': None,
|
|
||||||
'value': 'NO_WARNING',
|
|
||||||
}),
|
|
||||||
'engineHoursToService': dict({
|
'engineHoursToService': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
@@ -379,20 +407,6 @@
|
|||||||
'unit': None,
|
'unit': None,
|
||||||
'value': 'NO_WARNING',
|
'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({
|
'positionLightFrontLeftWarning': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
@@ -470,20 +484,6 @@
|
|||||||
'unit': 'months',
|
'unit': 'months',
|
||||||
'value': 23,
|
'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({
|
'turnIndicationFrontLeftWarning': dict({
|
||||||
'extra_data': dict({
|
'extra_data': dict({
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user