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/audyssey.py
CHANGED
|
@@ -17,14 +17,17 @@ from .appcommand import AppCommandCmd, AppCommandCmdParam, AppCommands
|
|
|
17
17
|
from .const import (
|
|
18
18
|
DENON_ATTR_SETATTR,
|
|
19
19
|
DYNAMIC_VOLUME_MAP,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
DYNAMIC_VOLUME_MAP_REVERSE_APPCOMMAND,
|
|
21
|
+
DYNAMIC_VOLUME_MAP_REVERSE_TELNET,
|
|
22
22
|
MULTI_EQ_MAP,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
MULTI_EQ_MAP_REVERSE_APPCOMMAND,
|
|
24
|
+
MULTI_EQ_MAP_REVERSE_TELNET,
|
|
25
25
|
REF_LVL_OFFSET_MAP,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
REF_LVL_OFFSET_MAP_REVERSE_APPCOMMAND,
|
|
27
|
+
REF_LVL_OFFSET_MAP_REVERSE_TELNET,
|
|
28
|
+
DynamicVolumeSettings,
|
|
29
|
+
MultiEQModes,
|
|
30
|
+
ReferenceLevelOffsets,
|
|
28
31
|
)
|
|
29
32
|
from .exceptions import AvrCommandError, AvrProcessingError
|
|
30
33
|
from .foundation import DenonAVRFoundation, convert_string_int_bool
|
|
@@ -77,15 +80,11 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
77
80
|
for tag in self.appcommand0300_attrs:
|
|
78
81
|
self._device.api.add_appcommand0300_update_tag(tag)
|
|
79
82
|
|
|
80
|
-
self._device.telnet_api.register_callback(
|
|
81
|
-
"PS", self._async_sound_detail_callback
|
|
82
|
-
)
|
|
83
|
+
self._device.telnet_api.register_callback("PS", self._sound_detail_callback)
|
|
83
84
|
|
|
84
85
|
self._is_setup = True
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
self, zone: str, event: str, parameter: str
|
|
88
|
-
) -> None:
|
|
87
|
+
def _sound_detail_callback(self, zone: str, event: str, parameter: str) -> None:
|
|
89
88
|
"""Handle a sound detail change event."""
|
|
90
89
|
if self._device.zone != zone:
|
|
91
90
|
return
|
|
@@ -171,8 +170,8 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
171
170
|
def reference_level_offset_setting_list(self) -> List[str]:
|
|
172
171
|
"""Return a list of available reference level offset settings."""
|
|
173
172
|
if self._device.telnet_available:
|
|
174
|
-
return list(
|
|
175
|
-
return list(
|
|
173
|
+
return list(REF_LVL_OFFSET_MAP_REVERSE_TELNET.keys())
|
|
174
|
+
return list(REF_LVL_OFFSET_MAP_REVERSE_APPCOMMAND.keys())
|
|
176
175
|
|
|
177
176
|
@property
|
|
178
177
|
def dynamic_volume(self) -> Optional[str]:
|
|
@@ -183,8 +182,8 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
183
182
|
def dynamic_volume_setting_list(self) -> List[str]:
|
|
184
183
|
"""Return a list of available Dynamic Volume settings."""
|
|
185
184
|
if self._device.telnet_available:
|
|
186
|
-
return list(
|
|
187
|
-
return list(
|
|
185
|
+
return list(DYNAMIC_VOLUME_MAP_REVERSE_TELNET.keys())
|
|
186
|
+
return list(DYNAMIC_VOLUME_MAP_REVERSE_APPCOMMAND.keys())
|
|
188
187
|
|
|
189
188
|
@property
|
|
190
189
|
def multi_eq(self) -> Optional[str]:
|
|
@@ -195,8 +194,8 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
195
194
|
def multi_eq_setting_list(self) -> List[str]:
|
|
196
195
|
"""Return a list of available MultiEQ settings."""
|
|
197
196
|
if self._device.telnet_available:
|
|
198
|
-
return list(
|
|
199
|
-
return list(
|
|
197
|
+
return list(MULTI_EQ_MAP_REVERSE_TELNET.keys())
|
|
198
|
+
return list(MULTI_EQ_MAP_REVERSE_APPCOMMAND.keys())
|
|
200
199
|
|
|
201
200
|
@property
|
|
202
201
|
def lfc(self) -> Optional[bool]:
|
|
@@ -227,7 +226,7 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
227
226
|
return
|
|
228
227
|
cmd = attr.evolve(
|
|
229
228
|
AppCommands.SetAudysseyDynamicEQ,
|
|
230
|
-
param_list=(AppCommandCmdParam(name="dynamiceq", text=0),),
|
|
229
|
+
param_list=(AppCommandCmdParam(name="dynamiceq", text="0"),),
|
|
231
230
|
)
|
|
232
231
|
await self._async_set_audyssey(cmd)
|
|
233
232
|
|
|
@@ -239,21 +238,21 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
239
238
|
return
|
|
240
239
|
cmd = attr.evolve(
|
|
241
240
|
AppCommands.SetAudysseyDynamicEQ,
|
|
242
|
-
param_list=(AppCommandCmdParam(name="dynamiceq", text=1),),
|
|
241
|
+
param_list=(AppCommandCmdParam(name="dynamiceq", text="1"),),
|
|
243
242
|
)
|
|
244
243
|
await self._async_set_audyssey(cmd)
|
|
245
244
|
|
|
246
|
-
async def async_set_multieq(self, value:
|
|
245
|
+
async def async_set_multieq(self, value: MultiEQModes) -> None:
|
|
247
246
|
"""Set MultiEQ mode."""
|
|
248
247
|
if self._device.telnet_available:
|
|
249
|
-
setting =
|
|
248
|
+
setting = MULTI_EQ_MAP_REVERSE_TELNET.get(value)
|
|
250
249
|
if setting is None:
|
|
251
250
|
raise AvrCommandError(f"Value {value} not known for MultiEQ")
|
|
252
251
|
telnet_command = self._device.telnet_commands.command_multieq + setting
|
|
253
252
|
await self._device.telnet_api.async_send_commands(telnet_command)
|
|
254
253
|
return
|
|
255
254
|
|
|
256
|
-
setting =
|
|
255
|
+
setting = MULTI_EQ_MAP_REVERSE_APPCOMMAND.get(value)
|
|
257
256
|
if setting is None:
|
|
258
257
|
raise AvrCommandError(f"Value {value} not known for MultiEQ")
|
|
259
258
|
cmd = attr.evolve(
|
|
@@ -262,7 +261,7 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
262
261
|
)
|
|
263
262
|
await self._async_set_audyssey(cmd)
|
|
264
263
|
|
|
265
|
-
async def async_set_reflevoffset(self, value:
|
|
264
|
+
async def async_set_reflevoffset(self, value: ReferenceLevelOffsets) -> None:
|
|
266
265
|
"""Set Reference Level Offset."""
|
|
267
266
|
# Reference level offset can only be used with DynamicEQ
|
|
268
267
|
if not self._dynamiceq:
|
|
@@ -270,7 +269,7 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
270
269
|
"Reference level could only be set when DynamicEQ is active"
|
|
271
270
|
)
|
|
272
271
|
if self._device.telnet_available:
|
|
273
|
-
setting =
|
|
272
|
+
setting = REF_LVL_OFFSET_MAP_REVERSE_TELNET.get(value)
|
|
274
273
|
if setting is None:
|
|
275
274
|
raise AvrCommandError(
|
|
276
275
|
f"Value {value} not known for Reference level offset"
|
|
@@ -279,7 +278,7 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
279
278
|
await self._device.telnet_api.async_send_commands(telnet_command)
|
|
280
279
|
return
|
|
281
280
|
|
|
282
|
-
setting =
|
|
281
|
+
setting = REF_LVL_OFFSET_MAP_REVERSE_APPCOMMAND.get(value)
|
|
283
282
|
if setting is None:
|
|
284
283
|
raise AvrCommandError(f"Value {value} not known for Reference level offset")
|
|
285
284
|
cmd = attr.evolve(
|
|
@@ -288,17 +287,17 @@ class DenonAVRAudyssey(DenonAVRFoundation):
|
|
|
288
287
|
)
|
|
289
288
|
await self._async_set_audyssey(cmd)
|
|
290
289
|
|
|
291
|
-
async def async_set_dynamicvol(self, value:
|
|
290
|
+
async def async_set_dynamicvol(self, value: DynamicVolumeSettings) -> None:
|
|
292
291
|
"""Set Dynamic Volume."""
|
|
293
292
|
if self._device.telnet_available:
|
|
294
|
-
setting =
|
|
293
|
+
setting = DYNAMIC_VOLUME_MAP_REVERSE_TELNET.get(value)
|
|
295
294
|
if setting is None:
|
|
296
295
|
raise AvrCommandError(f"Value {value} not known for Dynamic Volume")
|
|
297
296
|
telnet_command = self._device.telnet_commands.command_dynamicvol + setting
|
|
298
297
|
await self._device.telnet_api.async_send_commands(telnet_command)
|
|
299
298
|
return
|
|
300
299
|
|
|
301
|
-
setting =
|
|
300
|
+
setting = DYNAMIC_VOLUME_MAP_REVERSE_APPCOMMAND.get(value)
|
|
302
301
|
if setting is None:
|
|
303
302
|
raise AvrCommandError(f"Value {value} not known for Dynamic Volume")
|
|
304
303
|
cmd = attr.evolve(
|