Skip to content

Commit

Permalink
Use the same logic for receiver names for avr-x-2016 devices as for a…
Browse files Browse the repository at this point in the history
…ny others / Add Marantz SR5013 & SR5014 / push to version 0.9.3
  • Loading branch information
ol-iver committed Jun 8, 2020
1 parent 739db2b commit 534f6a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DATA
__title__ = 'denonavr'

VERSION
0.9.2
0.9.3

====================================================================================

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
2 changes: 1 addition & 1 deletion denonavr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
logging.getLogger(__name__).addHandler(logging.NullHandler())

__title__ = "denonavr"
__version__ = "0.9.2"
__version__ = "0.9.3"


def discover():
Expand Down
18 changes: 8 additions & 10 deletions denonavr/denonavr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)")

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -838,27 +838,25 @@ 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)
except requests.exceptions.ConnectTimeout:
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()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 534f6a0

Please sign in to comment.