mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 06:05:10 +02:00
Make BaseCoordinatorEntity.should_poll a cached_property since it never changes (#121826)
This commit is contained in:
@@ -6,6 +6,7 @@ from abc import abstractmethod
|
|||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Awaitable, Callable, Coroutine, Generator
|
from collections.abc import Awaitable, Callable, Coroutine, Generator
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
from functools import cached_property
|
||||||
import logging
|
import logging
|
||||||
from random import randint
|
from random import randint
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
@@ -471,7 +472,7 @@ class BaseCoordinatorEntity[
|
|||||||
self.coordinator = coordinator
|
self.coordinator = coordinator
|
||||||
self.coordinator_context = context
|
self.coordinator_context = context
|
||||||
|
|
||||||
@property
|
@cached_property
|
||||||
def should_poll(self) -> bool:
|
def should_poll(self) -> bool:
|
||||||
"""No need to poll. Coordinator notifies entity of updates."""
|
"""No need to poll. Coordinator notifies entity of updates."""
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user