denonavr 1.1.2__py3-none-any.whl → 1.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- denonavr/__init__.py +1 -1
- denonavr/api.py +150 -115
- denonavr/appcommand.py +48 -12
- denonavr/audyssey.py +28 -29
- denonavr/const.py +520 -126
- denonavr/decorators.py +2 -3
- denonavr/denonavr.py +198 -100
- denonavr/dirac.py +7 -11
- denonavr/foundation.py +587 -363
- denonavr/input.py +110 -71
- denonavr/soundmode.py +164 -66
- denonavr/ssdp.py +12 -11
- denonavr/tonecontrol.py +2 -6
- denonavr/volume.py +47 -66
- {denonavr-1.1.2.dist-info → denonavr-1.3.0.dist-info}/METADATA +2 -1
- denonavr-1.3.0.dist-info/RECORD +20 -0
- {denonavr-1.1.2.dist-info → denonavr-1.3.0.dist-info}/WHEEL +1 -1
- denonavr-1.1.2.dist-info/RECORD +0 -20
- {denonavr-1.1.2.dist-info → denonavr-1.3.0.dist-info}/licenses/LICENSE +0 -0
- {denonavr-1.1.2.dist-info → denonavr-1.3.0.dist-info}/top_level.txt +0 -0
denonavr/decorators.py
CHANGED
|
@@ -9,7 +9,6 @@ This module implements the REST API to Denon AVR receivers.
|
|
|
9
9
|
|
|
10
10
|
import inspect
|
|
11
11
|
import logging
|
|
12
|
-
import time
|
|
13
12
|
from functools import wraps
|
|
14
13
|
from typing import Callable, TypeVar
|
|
15
14
|
|
|
@@ -64,7 +63,7 @@ def cache_result(func: Callable[..., AnyT]) -> Callable[..., AnyT]:
|
|
|
64
63
|
"""
|
|
65
64
|
Decorate a function to cache its results with an lru_cache of maxsize 32.
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
The cache is only used if the "cache_id" keyword argument is set.
|
|
68
67
|
"""
|
|
69
68
|
if inspect.signature(func).parameters.get("cache_id") is None:
|
|
70
69
|
raise AttributeError(
|
|
@@ -77,7 +76,7 @@ def cache_result(func: Callable[..., AnyT]) -> Callable[..., AnyT]:
|
|
|
77
76
|
@wraps(func)
|
|
78
77
|
async def wrapper(*args, **kwargs):
|
|
79
78
|
if kwargs.get("cache_id") is None:
|
|
80
|
-
|
|
79
|
+
return await func(*args, **kwargs)
|
|
81
80
|
|
|
82
81
|
return await cached_func(*args, **kwargs)
|
|
83
82
|
|