Make BaseCoordinatorEntity.should_poll a cached_property since it never changes (#121826)

This commit is contained in:
J. Nick Koston
2024-07-12 00:39:22 -05:00
committed by GitHub
parent cdb26ef8a3
commit cdf7ecebc0

View File

@@ -6,6 +6,7 @@ from abc import abstractmethod
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Generator
from datetime import datetime, timedelta
from functools import cached_property
import logging
from random import randint
from time import monotonic
@@ -471,7 +472,7 @@ class BaseCoordinatorEntity[
self.coordinator = coordinator
self.coordinator_context = context
@property
@cached_property
def should_poll(self) -> bool:
"""No need to poll. Coordinator notifies entity of updates."""
return False