mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Set renault quality scale to platinum (#85753)
* Set renault quality scale to platinum * Ensure coordinators do not run at the same time * Add comment
This commit is contained in:
parent
1918f21fb1
commit
b7f484a84f
@ -7,5 +7,6 @@
|
|||||||
"requirements": ["renault-api==0.1.11"],
|
"requirements": ["renault-api==0.1.11"],
|
||||||
"codeowners": ["@epenet"],
|
"codeowners": ["@epenet"],
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["renault_api"]
|
"loggers": ["renault_api"],
|
||||||
|
"quality_scale": "platinum"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Proxy to handle account communication with Renault servers."""
|
"""Proxy to handle account communication with Renault servers."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
from collections.abc import Awaitable, Callable
|
from collections.abc import Awaitable, Callable
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
@ -18,6 +19,9 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, Upda
|
|||||||
|
|
||||||
T = TypeVar("T", bound=Optional[KamereonVehicleDataAttributes])
|
T = TypeVar("T", bound=Optional[KamereonVehicleDataAttributes])
|
||||||
|
|
||||||
|
# We have potentially 7 coordinators per vehicle
|
||||||
|
_PARALLEL_SEMAPHORE = asyncio.Semaphore(1)
|
||||||
|
|
||||||
|
|
||||||
class RenaultDataUpdateCoordinator(DataUpdateCoordinator[T]):
|
class RenaultDataUpdateCoordinator(DataUpdateCoordinator[T]):
|
||||||
"""Handle vehicle communication with Renault servers."""
|
"""Handle vehicle communication with Renault servers."""
|
||||||
@ -47,6 +51,7 @@ class RenaultDataUpdateCoordinator(DataUpdateCoordinator[T]):
|
|||||||
if self.update_method is None:
|
if self.update_method is None:
|
||||||
raise NotImplementedError("Update method not implemented")
|
raise NotImplementedError("Update method not implemented")
|
||||||
try:
|
try:
|
||||||
|
async with _PARALLEL_SEMAPHORE:
|
||||||
return await self.update_method()
|
return await self.update_method()
|
||||||
except AccessDeniedException as err:
|
except AccessDeniedException as err:
|
||||||
# Disable because the account is not allowed to access this Renault endpoint.
|
# Disable because the account is not allowed to access this Renault endpoint.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user