Skip to content

Commit

Permalink
Fix tone control update / Add COMMAPI patterns for avr-x support
Browse files Browse the repository at this point in the history
  • Loading branch information
ol-iver committed Jan 3, 2021
1 parent 9eb0a0f commit 2cb0ebf
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 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.9
0.9.10

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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# denonavr
[![Version](https://img.shields.io/badge/version-v0.9.9-orange.svg)](https://github.com/scarface-4711/denonavr)
[![Version](https://img.shields.io/badge/version-v0.9.10-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.9
Automation Library for Denon AVR receivers - current version 0.9.10

## 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.9
Automation Library for Denon AVR receivers - current version 0.9.10

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.9"
__version__ = "0.9.10"


def discover():
Expand Down
16 changes: 9 additions & 7 deletions denonavr/denonavr.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
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)|.*SR501[3-4]|.*NR1604|.*NR1710)")

DEVICEINFO_COMMAPI_PATTERN = re.compile(r"(0210|0300|0301)")
DEVICEINFO_COMMAPI_PATTERN = re.compile(r"(0210|0220|0250|0300|0301)")

ReceiverType = namedtuple('ReceiverType', ["type", "port"])
AVR = ReceiverType(type="avr", port=80)
Expand Down Expand Up @@ -920,7 +920,8 @@ def _update_tone_control(self, root=None):
return False

try:
self._tone_control_status = bool(int(root[0].find('status').text))
self._tone_control_status = bool(
int(root.find('./cmd/status').text))
except (AttributeError, IndexError, TypeError):
return False

Expand All @@ -935,11 +936,12 @@ def _update_tone_control(self, root=None):
return False

try:
self._tone_control_adjust = bool(int(root[0].find('adjust').text))
self._bass = int(root[0].find('bassvalue').text)
self._bass_level = root[0].find('basslevel').text
self._treble = int(root[0].find('treblevalue').text)
self._treble_level = root[0].find('treblelevel').text
self._tone_control_adjust = bool(
int(root.find('./cmd/adjust').text))
self._bass = int(root.find('./cmd/bassvalue').text)
self._bass_level = root.find('./cmd/basslevel').text
self._treble = int(root.find('./cmd/treblevalue').text)
self._treble_level = root.find('./cmd/treblelevel').text
except (AttributeError, IndexError, TypeError):
_LOGGER.error("Incomplete/no information found for tone control")
return False
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests
netifaces
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.9',
version='0.9.10',
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 2cb0ebf

Please sign in to comment.