From b073203039f1bf2a4b45cd48fd4e9ce298f1f34d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Dec 2020 00:19:50 +0100 Subject: [PATCH] Fix Audyssey update crashing when receiver does not return dynamiceq / add MULTI IN + VIRTUAL:X sound mode --- HELP.md | 4 ++-- README.md | 4 ++-- README.rst | 2 +- denonavr/__init__.py | 2 +- denonavr/audyssey.py | 12 +++++++----- denonavr/denonavr.py | 4 ++-- setup.py | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/HELP.md b/HELP.md index 98e9b16..5c2bb01 100644 --- a/HELP.md +++ b/HELP.md @@ -29,7 +29,7 @@ DATA __title__ = 'denonavr' VERSION - 0.9.7 + 0.9.8 ==================================================================================== @@ -736,7 +736,7 @@ CLASSES | set_dynamicvol(self, setting) | Set Dynamic Volume. | - | set_mutlieq(self, setting) + | set_multieq(self, setting) | Set MultiEQ mode. | | set_reflevoffset(self, setting) diff --git a/README.md b/README.md index 13deb72..81b4fa8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # denonavr -[![Version](https://img.shields.io/badge/version-v0.9.7-orange.svg)](https://github.com/scarface-4711/denonavr) +[![Version](https://img.shields.io/badge/version-v0.9.8-orange.svg)](https://github.com/scarface-4711/denonavr) [![Build Status](https://travis-ci.com/scarface-4711/denonavr.svg?branch=master)](https://travis-ci.com/scarface-4711/denonavr) [![PyPi](https://img.shields.io/pypi/v/denonavr.svg)](https://pypi.org/project/denonavr) [![License](https://img.shields.io/github/license/scarface-4711/denonavr.svg)](LICENSE) -Automation Library for Denon AVR receivers - current version 0.9.7 +Automation Library for Denon AVR receivers - current version 0.9.8 ## Installation diff --git a/README.rst b/README.rst index b2f9837..5181d39 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ denonavr .. |Build Status| .. image:: https://travis-ci.com/scarface-4711/denonavr.svg?branch=master :target: https://travis-ci.com/scarface-4711/denonavr -Automation Library for Denon AVR receivers - current version 0.9.7 +Automation Library for Denon AVR receivers - current version 0.9.8 Installation ------------ diff --git a/denonavr/__init__.py b/denonavr/__init__.py index 171d11f..85e7fbc 100644 --- a/denonavr/__init__.py +++ b/denonavr/__init__.py @@ -17,7 +17,7 @@ logging.getLogger(__name__).addHandler(logging.NullHandler()) __title__ = "denonavr" -__version__ = "0.9.7" +__version__ = "0.9.8" def discover(): diff --git a/denonavr/audyssey.py b/denonavr/audyssey.py index ca3f30a..39b29dd 100644 --- a/denonavr/audyssey.py +++ b/denonavr/audyssey.py @@ -106,7 +106,8 @@ def update(self): if param.get("name") == "multeq": self.multeq = MULTI_EQ_MAP.get(param.text) elif param.get("name") == "dynamiceq": - self.dynamiceq = bool(int(param.text)) + self.dynamiceq = bool(int( + param.text)) if param.text is not None else None elif param.get("name") == "reflevoffset": # Reference level offset can only be used with DynamicEQ if self.dynamiceq is False: @@ -115,9 +116,10 @@ def update(self): self.reflevoffset = REF_LVL_OFFSET_MAP.get(param.text) elif param.get("name") == "dynamicvol": self.dynamicvol = DYNAMIC_VOLUME_MAP.get(param.text) - setattr( - self, "{name}_control".format(name=param.get("name")), - bool(int(param.get("control")))) + if param.get("control") is not None: + setattr( + self, "{name}_control".format(name=param.get("name")), + bool(int(param.get("control")))) return True def _set_audyssey(self, parameter, value): @@ -150,7 +152,7 @@ def dynamiceq_on(self): if self._set_audyssey(parameter="dynamiceq", value=1) is True: self.dynamiceq = True - def set_mutlieq(self, setting): + def set_multieq(self, setting): """Set MultiEQ mode.""" if self._set_audyssey( parameter="multeq", value=MULTI_EQ_MAP_LABELS.get(setting) diff --git a/denonavr/denonavr.py b/denonavr/denonavr.py index 026b10d..51db12a 100644 --- a/denonavr/denonavr.py +++ b/denonavr/denonavr.py @@ -63,7 +63,7 @@ 'DTS NEO:X MUSIC', 'DOLBY PL2 MUSIC']), ('MOVIE', ['PLII MOVIE', 'PLII CINEMA', 'DTS NEO:X CINEMA', 'DTS NEO:6 CINEMA', 'DOLBY D +NEO:X C', - 'PLIIX CINEMA', 'DOLBY PLII MOVIE']), + 'PLIIX CINEMA', 'DOLBY PLII MOVIE', 'MULTI IN + VIRTUAL:X']), ('GAME', ['PLII GAME', 'DOLBY D +NEO:X G']), ('AUTO', ['None']), ('STANDARD', ['None2']), @@ -1728,7 +1728,7 @@ def dynamic_volume(self, setting): @multi_eq.setter def multi_eq(self, setting): """Set MultiEQ.""" - self._audyssey.set_mutlieq(setting=setting) + self._audyssey.set_multieq(setting=setting) @input_func.setter def input_func(self, input_func): diff --git a/setup.py b/setup.py index 7521c96..0880a13 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup setup(name='denonavr', - version='0.9.7', + version='0.9.8', description='Automation Library for Denon AVR receivers', long_description='Automation Library for Denon AVR receivers', url='https://github.com/scarface-4711/denonavr',