mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add parallel updates to Fritz (#142409)
* Add parallel updates to Fritz * apply review comment * tweak
This commit is contained in:
parent
9a897d5e12
commit
e96f2f06fb
@ -20,6 +20,9 @@ from .entity import FritzBoxBaseCoordinatorEntity, FritzEntityDescription
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Coordinator is used to centralize the data updates
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True, kw_only=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class FritzBinarySensorEntityDescription(
|
class FritzBinarySensorEntityDescription(
|
||||||
|
@ -31,6 +31,9 @@ from .entity import FritzDeviceBase
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Set a sane value to avoid too many updates
|
||||||
|
PARALLEL_UPDATES = 5
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True, kw_only=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class FritzButtonDescription(ButtonEntityDescription):
|
class FritzButtonDescription(ButtonEntityDescription):
|
||||||
|
@ -22,6 +22,9 @@ from .entity import FritzDeviceBase
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Coordinator is used to centralize the data updates
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
@ -18,6 +18,9 @@ from .entity import FritzBoxBaseEntity
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Coordinator is used to centralize the data updates
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
@ -33,9 +33,7 @@ rules:
|
|||||||
entity-unavailable: done
|
entity-unavailable: done
|
||||||
integration-owner: done
|
integration-owner: done
|
||||||
log-when-unavailable: done
|
log-when-unavailable: done
|
||||||
parallel-updates:
|
parallel-updates: done
|
||||||
status: todo
|
|
||||||
comment: not set at the moment, we use a coordinator
|
|
||||||
reauthentication-flow: done
|
reauthentication-flow: done
|
||||||
test-coverage:
|
test-coverage:
|
||||||
status: todo
|
status: todo
|
||||||
|
@ -32,6 +32,9 @@ from .entity import FritzBoxBaseCoordinatorEntity, FritzEntityDescription
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Coordinator is used to centralize the data updates
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
def _uptime_calculation(seconds_uptime: float, last_value: datetime | None) -> datetime:
|
def _uptime_calculation(seconds_uptime: float, last_value: datetime | None) -> datetime:
|
||||||
"""Calculate uptime with deviation."""
|
"""Calculate uptime with deviation."""
|
||||||
|
@ -38,6 +38,9 @@ from .entity import FritzBoxBaseEntity, FritzDeviceBase
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Set a sane value to avoid too many updates
|
||||||
|
PARALLEL_UPDATES = 5
|
||||||
|
|
||||||
|
|
||||||
async def _async_deflection_entities_list(
|
async def _async_deflection_entities_list(
|
||||||
avm_wrapper: AvmWrapper, device_friendly_name: str
|
avm_wrapper: AvmWrapper, device_friendly_name: str
|
||||||
|
@ -20,6 +20,9 @@ from .entity import FritzBoxBaseCoordinatorEntity, FritzEntityDescription
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Set a sane value to avoid too many updates
|
||||||
|
PARALLEL_UPDATES = 5
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True, kw_only=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class FritzUpdateEntityDescription(UpdateEntityDescription, FritzEntityDescription):
|
class FritzUpdateEntityDescription(UpdateEntityDescription, FritzEntityDescription):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user