All Projects → scarface-4711 → Denonavr

scarface-4711 / Denonavr

Licence: mit
Automation Library for Denon AVR receivers.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Denonavr

Hadotnet
🏡 A .NET Standard library for Home Assistant.
Stars: ✭ 52 (-50%)
Mutual labels:  api, home-assistant, home-automation
Tiledesk Server
Tiledesk server. Tiledesk is an Open Source Live Chat platform written in NodeJs and MongoDB
Stars: ✭ 94 (-9.62%)
Mutual labels:  api, rest
Tcases
A model-based test case generator
Stars: ✭ 103 (-0.96%)
Mutual labels:  api, rest
Com api
API framework for Joomla
Stars: ✭ 102 (-1.92%)
Mutual labels:  api, rest
Camunda.api.client
Camunda REST API Client for .NET platform
Stars: ✭ 87 (-16.35%)
Mutual labels:  api, rest
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-11.54%)
Mutual labels:  api, rest
Home Card
A quick glance of the state of your home in Home Assistant Lovelace UI.
Stars: ✭ 94 (-9.62%)
Mutual labels:  home-assistant, home-automation
Ha Bt Proximity
Distributed Bluetooth Room Presence Sensor for Home Assistant
Stars: ✭ 77 (-25.96%)
Mutual labels:  home-assistant, home-automation
Appy Backend
A user system to bootstrap your app.
Stars: ✭ 96 (-7.69%)
Mutual labels:  api, rest
Tuyaha
Implements the special Tuya Home Assistant API.
Stars: ✭ 99 (-4.81%)
Mutual labels:  home-assistant, home-automation
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-1.92%)
Mutual labels:  home-assistant, home-automation
Go Whatsapp Rest
Go WhatsApp Implementation in REST API
Stars: ✭ 86 (-17.31%)
Mutual labels:  api, rest
Homeassistant Config
Configuration for @brianjking & @KinnaT's Home Assistant Installation
Stars: ✭ 80 (-23.08%)
Mutual labels:  home-assistant, home-automation
Behat Api Extension
API extension for Behat, used to ease testing of JSON-based APIs
Stars: ✭ 92 (-11.54%)
Mutual labels:  api, rest
Queryql
Easily add filtering, sorting, and pagination to your Node.js REST API through your old friend: the query string!
Stars: ✭ 76 (-26.92%)
Mutual labels:  api, rest
Http restful api
整理HTTP后台端的RESTful API方面的知识
Stars: ✭ 94 (-9.62%)
Mutual labels:  api, rest
Home Assistant Js Websocket
🚡 JavaScript websocket client for Home Assistant
Stars: ✭ 100 (-3.85%)
Mutual labels:  home-assistant, home-automation
Spring Boot Api Project Seed
🌱🚀一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~
Stars: ✭ 8,979 (+8533.65%)
Mutual labels:  api, rest
Huobi golang
Go SDK for Huobi Spot API
Stars: ✭ 76 (-26.92%)
Mutual labels:  api, rest
Frigate
NVR with realtime local object detection for IP cameras
Stars: ✭ 1,329 (+1177.88%)
Mutual labels:  home-assistant, home-automation

denonavr

Version Build Status PyPi License

Automation Library for Denon AVR receivers - current version 0.10.2.dev1

Important change

This library switched to async in version 0.10.0. All sync methods are still available for a while in order not to break too many things. However using those methods is ineffecient, because they use the corresponding async methods by starting and stopping an own asyncio event loop for each command. Please switch to async_ methods instead.

Installation

Use pip:

$ pip install denonavr

or

$ pip install --use-wheel denonavr

Usage

For creation of a device you could use the following lines of codes

import denonavr
d = denonavr.DenonAVR("192.168.0.250", "Name of device (Optional)")

Library is not polling the Denon device. Thus you need to update device information using the update method.

d.update()

Some basic automatic discovery functions for uPnP devices using SSDP broadcast are available. It is either possible to just discover the Denon AVR devices in the LAN zone or to create instances for each discovered device directly.

discovered_devices = denonavr.discover()
instanced_devices = denonavr.init_all_receivers()

In addition to the Main Zone which is always started, Zone2 and Zone3 of the receiver can be started assigning a dictionary to the add_zones parameter when creating the instance of the receiver.

import denonavr
zones = {"Zone2": "Name of Zone2", "Zone3": "Name of Zone 3"}
d = denonavr.DenonAVR("192.168.0.250", name="Name of Main Zone", add_zones=zones)

Each Zone is represented by an own instance which is assigned to the device instance by the zones attribute with type dictionary.

d.zones
{'Zone2': <denonavr.denonavr.DenonAVRZones object at 0x000001F893EB7630>, 'Main': <denonavr.denonavr.DenonAVR object at 0x000001F8964155F8>, 'Zone3': <denonavr.denonavr.DenonAVRZones object at 0x000001F896415320>}

Some code examples for the Main Zone:

>>> import denonavr
>>> d = denonavr.DenonAVR("192.168.0.250")
>>> d.power
'STANDBY'
>>> d.power_on()
True
>>> d.update()
True
>>> d.power
'ON'
>>> d.name
'Denon AVR-X4100W'
>>> d.artist
'Wynton Marsalis'
>>> d.title
"When It's Sleepytime Down South"
>>> d.image_url
'http://192.168.0.250/NetAudio/art.asp-jpg?1480031583'
>>> d.next_track()
True
>>> d.previous_track()
True
>>> d.volume
-43.5
>>> d.volume_up()
True
>>> d.update()
True
>>> d.volume
-43.0
>>> d.volume_down()
True
>>> d.set_volume(-40.0)
True
>>> d.update()
True
>>> d.volume
-40.0
>>> d.mute(True)
True
>>> d.mute(False)
True
>>> d.toggle_play_pause()
>>> d.toggle_play_pause()
>>> d.input_func
'Online Music'
>>> d.input_func_list
['AUX', 'AUX2', 'Blu-ray', 'Bluetooth', 'CBL/SAT', 'CD', 'DVD', 'Game', 'Internet Radio', 'Media Player', 'Media Server', 'Online Music', 'Phono', 'TV Audio', 'Tuner', 'iPod/USB']
>>> d.input_func = "Tuner"
>>> d.input_func
'Tuner'
>>> d.power_off()

>>> discovered_devices = denonavr.discover()
discovered_devices
[{'friendlyName': 'Denon AVR-X4100W', 'host': '192.168.0.250', 'modelName': '*AVR-X4100W', 'presentationURL': 'http://192.168.0.250'}]
>>> discovered_denon = denonavr.DenonAVR(discovered_devices[0]['host'])
>>> discovered_denon.power
'STANDBY'

>>> instanced_devices = denonavr.init_all_receivers()
>>> instanced_devices
[<denonavr.denonavr.DenonAVR object at 0x000001AF8EA63E10>]
>>> instanced_devices[0].power
'STANDBY'
>>> instanced_devices[0].power_on()
True
>>> instanced_devices[0].update()
True
>>> instanced_devices[0].power
'ON'
>>> instanced_devices[0].power_off()
True
>>> instanced_devices[0].power
'STANDBY'

The code examples for the Main Zone instance d from above are working for all zones. The other zones (and Main Zone as well) could be accessed via zones attribute.

d.zones['Zone2'].power
'OFF'
d.zones['Zone2'].power_on()
True
d.zones['Zone2'].update()
True
d.zones['Zone2'].power
'ON'
d.zones['Zone2'].power_off()
True
d.zones['Zone2'].update()
True
d.zones['Zone2'].power
'OFF

License

MIT

Author

@scarface-4711: https://github.com/scarface-4711

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

Users

Home Assistant: https://github.com/home-assistant/home-assistant/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].