Add compatibility with sleeping Shelly gen2 devices with firmware 1.0.0 (#94864)

This commit is contained in:
Maciej Bieniek 2023-06-21 10:01:17 +00:00 committed by GitHub
parent 3bacd9df2f
commit 05039036f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 4 deletions

View file

@ -255,7 +255,11 @@ def get_block_device_sleep_period(settings: dict[str, Any]) -> int:
def get_rpc_device_sleep_period(config: dict[str, Any]) -> int:
"""Return the device sleep period in seconds or 0 for non sleeping devices."""
"""Return the device sleep period in seconds or 0 for non sleeping devices.
sys.sleep.wakeup_period value is deprecated and not available in Shelly
firmware 1.0.0 or later.
"""
return cast(int, config["sys"].get("sleep", {}).get("wakeup_period", 0))