denonavr 1.2.0__py3-none-any.whl → 1.3.1__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/dirac.py CHANGED
@@ -15,7 +15,7 @@ import attr
15
15
  from .const import (
16
16
  DENON_ATTR_SETATTR,
17
17
  DIRAC_FILTER_MAP,
18
- DIRAC_FILTER_MAP_LABELS,
18
+ DIRAC_FILTER_MAP_REVERSE,
19
19
  DiracFilters,
20
20
  )
21
21
  from .exceptions import AvrCommandError
@@ -29,7 +29,7 @@ class DenonAVRDirac(DenonAVRFoundation):
29
29
  """Dirac Settings."""
30
30
 
31
31
  _dirac_filter: Optional[str] = attr.ib(
32
- converter=attr.converters.optional(str), default=None
32
+ converter=attr.converters.optional(DIRAC_FILTER_MAP.get), default=None
33
33
  )
34
34
  _dirac_filters = get_args(DiracFilters)
35
35
 
@@ -40,8 +40,8 @@ class DenonAVRDirac(DenonAVRFoundation):
40
40
 
41
41
  def _dirac_filter_callback(self, zone: str, event: str, parameter: str) -> None:
42
42
  """Handle Dirac filter change event."""
43
- if event == "PS" and parameter[0:5] == "DIRAC":
44
- self._dirac_filter = DIRAC_FILTER_MAP_LABELS[parameter[6:]]
43
+ if zone == self._device.zone and parameter[0:5] == "DIRAC":
44
+ self._dirac_filter = parameter[6:]
45
45
 
46
46
  ##############
47
47
  # Properties #
@@ -66,7 +66,7 @@ class DenonAVRDirac(DenonAVRFoundation):
66
66
  if dirac_filter not in self._dirac_filters:
67
67
  raise AvrCommandError("Invalid Dirac filter")
68
68
 
69
- mapped_filter = DIRAC_FILTER_MAP[dirac_filter]
69
+ mapped_filter = DIRAC_FILTER_MAP_REVERSE[dirac_filter]
70
70
  if self._device.telnet_available:
71
71
  await self._device.telnet_api.async_send_commands(
72
72
  self._device.telnet_commands.command_dirac_filter.format(