mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-30 21:28:27 +00:00
Stabilise on_since value for smart devices (#1144)
Caches the `on_since` value to prevent jitter caused by the device calculations.
This commit is contained in:
@@ -435,7 +435,11 @@ class Device(ABC):
|
||||
@property
|
||||
@abstractmethod
|
||||
def on_since(self) -> datetime | None:
|
||||
"""Return the time that the device was turned on or None if turned off."""
|
||||
"""Return the time that the device was turned on or None if turned off.
|
||||
|
||||
This returns a cached value if the device reported value difference is under
|
||||
five seconds to avoid device-caused jitter.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def wifi_scan(self) -> list[WifiNetwork]:
|
||||
|
||||
Reference in New Issue
Block a user