From 534f6a00ed5812c9954d5b8b7353528e973cb05d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Jun 2020 04:10:47 +0200 Subject: [PATCH] Use the same logic for receiver names for avr-x-2016 devices as for any others / Add Marantz SR5013 & SR5014 / push to version 0.9.3 --- HELP.md | 2 +- README.md | 2 +- README.rst | 2 +- denonavr/__init__.py | 2 +- denonavr/denonavr.py | 18 ++++++++---------- setup.py | 2 +- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/HELP.md b/HELP.md index 5999623..81d2844 100644 --- a/HELP.md +++ b/HELP.md @@ -29,7 +29,7 @@ DATA __title__ = 'denonavr' VERSION - 0.9.2 + 0.9.3 ==================================================================================== diff --git a/README.md b/README.md index 5497275..a2d3a3e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # denonavr [![Build Status](https://travis-ci.com/scarface-4711/denonavr.svg?branch=master)](https://travis-ci.com/scarface-4711/denonavr) -Automation Library for Denon AVR receivers - current version 0.9.2 +Automation Library for Denon AVR receivers - current version 0.9.3 ## Installation diff --git a/README.rst b/README.rst index 37c0277..da161ab 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.2 +Automation Library for Denon AVR receivers - current version 0.9.3 Installation ------------ diff --git a/denonavr/__init__.py b/denonavr/__init__.py index 00c3246..7f9efd3 100644 --- a/denonavr/__init__.py +++ b/denonavr/__init__.py @@ -17,7 +17,7 @@ logging.getLogger(__name__).addHandler(logging.NullHandler()) __title__ = "denonavr" -__version__ = "0.9.2" +__version__ = "0.9.3" def discover(): diff --git a/denonavr/denonavr.py b/denonavr/denonavr.py index 778e5f8..6748f4f 100644 --- a/denonavr/denonavr.py +++ b/denonavr/denonavr.py @@ -24,7 +24,7 @@ DEVICEINFO_AVR_X_PATTERN = re.compile( r"(.*AV(C|R)-(X|S).*|.*SR500[6-9]|.*SR60(07|08|09|10|11|12|13)|." - r"*SR70(07|08|09|10|11|12|13)|.*NR1604|.*NR1710)") + r"*SR70(07|08|09|10|11|12|13)|.*SR501[3-4]|.*NR1604|.*NR1710)") DEVICEINFO_COMMAPI_PATTERN = re.compile(r"(0210|0300|0301)") @@ -471,7 +471,7 @@ def ensure_configuration(self): executor.submit(self.get_device_info) if self._receiver_type == AVR_X_2016.type: - executor.submit(self._get_zone_name) + executor.submit(self._get_receiver_name_avr_2016) else: executor.submit(self._get_receiver_name) @@ -838,11 +838,11 @@ def _get_receiver_name(self): "Using standard name: Denon AVR.") self._name = "Denon AVR" - def _get_zone_name(self): - """Get receivers zone name if not set yet.""" + def _get_receiver_name_avr_2016(self): + """Get name of receiver from web interface if not set.""" if self._name is None: # Collect tags for AppCommand.xml call - tags = ["GetZoneName"] + tags = ["GetFriendlyName"] # Execute call try: root = self.exec_appcommand_post(tags) @@ -850,15 +850,13 @@ def _get_zone_name(self): root = None # Check result if root is None: - _LOGGER.error("Getting ZoneName failed.") + _LOGGER.error("Getting GetFriendlyName failed.") return - zone = self._get_own_zone() try: - name = root.find( - "./cmd/{zone}".format(zone=zone)).text + name = root.find("./cmd/friendlyname").text except AttributeError: - _LOGGER.error("No ZoneName found for zone %s", self.zone) + _LOGGER.error("No friendlyname found") else: self._name = name.strip() diff --git a/setup.py b/setup.py index c2a5479..c50f8ad 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup setup(name='denonavr', - version='0.9.2', + version='0.9.3', description='Automation Library for Denon AVR receivers', long_description='Automation Library for Denon AVR receivers', url='https://github.com/scarface-4711/denonavr',