Skip to main content

Automation Library for Denon AVR receivers

Project description

denonavr

Release Build Status PyPi License Code style: black

Automation Library for Denon AVR receivers

Installation

Use pip:

$ pip install denonavr

or

$ pip install --use-wheel denonavr

Usage with async

Writing async and await methods are outside the scope of the documentation. You can test async usage from the Python REPL. In a terminal run:

python3 -m asyncio

The asyncio library should automatically be imported in the REPL. Import the denonavr library and set up your receiver. If you know the IP address, enter it below replacing 192.168.1.119.

>>> import asyncio
>>> import denonavr
>>> d = denonavr.DenonAVR("192.168.1.119")
>>> await d.async_setup()
>>> await d.async_update()
>>> print(d.volume)
-36.5

Monitoring with telnet

In addition to retrieving the current device status via HTTP calls, denonavr library also has the ability to setup a task that will connect to the receiver via telnet on TCP port 23 and listen for real-time events to notify of status changes. This provides instant updates via a callback when the device status changes. Receivers support only one active telnet connection.

>>> import asyncio
>>> import denonavr
>>> d = denonavr.DenonAVR("192.168.1.119")
>>> await d.async_setup()
>>> await d.async_telnet_connect()
>>> await d.async_update()
>>> async def update_callback(zone, event, parameter):
>>>>>> print("Zone: " + zone + " Event: " + event + " Parameter: " + parameter)
>>> d.register_callback("ALL", update_callback)

Power & Input

>>> await d.async_power_on()
>>> await d.async_update()
>>> d.power
'ON'

>>> await d.async_power_off()
>>> await d.async_update()
>>> d.power
'OFF'

>>> d.input_func
'Tuner'
>>> await d.async_set_input_func("Phono")
>>> d.input_func
'Phono'

Sound

>>> await d.async_mute(True)
>>> await d.async_mute(False)

Other methods

Other async methods available include:

  • d.async_bass_down
  • d.async_bass_up
  • d.async_treble_down
  • d.async_treble_up
  • d.async_volume_down
  • d.async_volume_up
  • d.async_set_volume(50)

Collection of HTTP calls

For a collection of HTTP calls for Denon receivers please have a look at the doc folder.

License

MIT

Author

@ol-iver: https://github.com/ol-iver

Contributors

@soldag: https://github.com/soldag
@shapiromatron: https://github.com/shapiromatron
@glance-: https://github.com/glance-
@p3dda: https://github.com/p3dda
@russel: https://github.com/russell
@starkillerOG: https://github.com/starkillerOG
@andrewsayre: https://github.com/andrewsayre
@JPHutchins: https://github.com/JPHutchins
@MarBra: https://github.com/MarBra
@dcmeglio: https://github.com/dcmeglio
@bdraco: https://github.com/bdraco

Users

Home Assistant: https://github.com/home-assistant/home-assistant/
denonavr-cli: https://pypi.org/project/denonavr-cli/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

denonavr-1.0.0.tar.gz (182.2 kB view details)

Uploaded Source

Built Distribution

denonavr-1.0.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file denonavr-1.0.0.tar.gz.

File metadata

  • Download URL: denonavr-1.0.0.tar.gz
  • Upload date:
  • Size: 182.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for denonavr-1.0.0.tar.gz
Algorithm Hash digest
SHA256 503a2e0bfa5ea399b10b774a6c705c26418b28fc0ab6611dd18d78ade757abc0
MD5 20277363895ccf56956e44342d0c1fac
BLAKE2b-256 81b5249b25ae9449e4a7cc6c033052c89ad5d0b6389375432cece9383e346d5c

See more details on using hashes here.

File details

Details for the file denonavr-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: denonavr-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for denonavr-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4384b33dd0eec6c96d0d716d6f474fdab5a3a8a0867ff8ac7206bdd6b673ed3a
MD5 ef156ee4d9f94d972c298a4e0e136936
BLAKE2b-256 925259a22dffdde68c99da27fbc2847261f71383dfd9f371ea5be0f77099c676

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page