Skip to content

Commit

Permalink
Merge branch 'rc_v1.4.1'
Browse files Browse the repository at this point in the history
* rc_v1.4.1:
  backend: Adjusted version number
  Updated README
  Documentation changes
  Added functions for Pioneer
  mail: Added some gmail support
  Backend: Filtered out loggers, if they only have a NullHandler; extended display of shNG version
  Auto-fix incorrect config, added two more commands for Pioneer
  Backend: Basic editing functionallity for items of type list and dict; display of filename that the item is defiined in (for user items)
  fix missing tzinfo with sunrise/sunset times
  Fixed standard ignore responses in yaml
  Fixed debug levels, updated config files and readme, added example item files
  • Loading branch information
msinn committed Dec 23, 2017
2 parents a9c235a + 29cc4e3 commit 034d265
Show file tree
Hide file tree
Showing 31 changed files with 1,027 additions and 255 deletions.
10 changes: 6 additions & 4 deletions avdevice/AVDeviceInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import codecs
import re
import os
import threading
VERBOSE1 = logging.DEBUG - 1
VERBOSE2 = logging.DEBUG - 2
Expand Down Expand Up @@ -305,7 +306,7 @@ def _create_responsecommands(self):
else:
self._special_commands['Input']['Command'].append(response)
self._special_commands['Input']['Ignore'].append(0)
self.logger.log(VERBOSE1, "Initializing {}: Found Input Command and added it to display commands.".format(self._name))
self.logger.log(VERBOSE2, "Initializing {}: Found Input Command and added it to display commands.".format(self._name))
elif (function == 'title' or function == 'station' or function == 'genre'):
if 'Nowplaying' not in self._special_commands:
self._special_commands['Nowplaying'] = {'Command': [response]}
Expand Down Expand Up @@ -340,7 +341,7 @@ def _create_responsecommands(self):
self.logger.log(VERBOSE1, "Initializing {}: Adding additional list to function {} for response {} with value {}.".format(
self._name, function, response, self._response_commands[response]))
except Exception as err:
self.logger.log(VERBOSE1, "Initializing {}: Creating response command for: {}. Message: {}".format(self._name, response, err))
self.logger.log(VERBOSE2, "Initializing {}: Creating response command for: {}. Message: {}".format(self._name, response, err))
self._response_commands[response] = [[
valuelength, commandlength, position, item, function, 'zone{}'.format(zone), inverse, expectedtype, functiontype]]
self._response_commands[response] = sorted(self._response_commands[response], key=lambda x: x[0], reverse=True)
Expand Down Expand Up @@ -372,8 +373,7 @@ def _read_commandfile(self):
try:
self.logger.debug("Initializing {}: Starting to read file {}. Lock is {}".format(
self._name, self._model, self._threadlock_standard.locked()))
filename = '{}/plugins/avdevice/{}.txt'.format(
self._sh.base_dir, self._model)
filename = '{}/{}.txt'.format(os.path.abspath(os.path.dirname(__file__)), self._model)

commands = codecs.open(filename, 'r', 'utf-8')
zones = [0]
Expand Down Expand Up @@ -408,11 +408,13 @@ def _read_commandfile(self):
row.append('bool')
elif i == 8 and ("increase" in function or "decrease" in function):
row.append('int,float')
row[5] = row[5].replace('*', '')
else:
row.append('')
try:
row[8] = row[8].replace('string', 'str')
row[8] = row[8].replace('num', 'int,float')
row[8] = row[8].replace('|', ',')
if row[8] == '':
row[8] = 'bool,int,str'
except Exception:
Expand Down
346 changes: 346 additions & 0 deletions avdevice/Denon_Items.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
%YAML 1.1
---
Denon:
type: foo

Powerall:
type: bool
visu_acl: rw
avdevice_zone0: power

Update:
type: bool
visu_acl: rw
avdevice_zone0: statusupdate
enforce_updates: 'yes'

Power:
type: bool
visu_acl: rw
avdevice_zone1: power

Mute:
type: bool
visu_acl: rw
avdevice_zone1: mute

VolumeFL:
type: num
visu_acl: rw
avdevice_zone1: volumefl
cache: 'True'

VolumeFLUp:
type: bool
visu_acl: rw
avdevice_zone1: volumefl+
enforce_updates: 'yes'

VolumeFLDown:
type: bool
visu_acl: rw
avdevice_zone1: volumefl-
enforce_updates: 'yes'

VolumeFR:
type: num
visu_acl: rw
avdevice_zone1: volumefr
cache: 'True'

VolumeFRUp:
type: bool
visu_acl: rw
avdevice_zone1: volumefr+
enforce_updates: 'yes'

VolumeFRDown:
type: bool
visu_acl: rw
avdevice_zone1: volumefr-
enforce_updates: 'yes'

Volume:
type: num
visu_acl: rw
avdevice_zone1: volume
cache: 'True'

VolumeMax:
type: num
visu_acl: ro
avdevice_zone1: volumemax

VolumeUp:
type: bool
visu_acl: rw
avdevice_zone1: volume+
enforce_updates: 'yes'

VolumeDown:
type: bool
visu_acl: rw
avdevice_zone1: volume-
enforce_updates: 'yes'

VolumeLow:
type: bool
enforce_updates: 'yes'
visu_acl: rw
avdevice_zone1: volumelow

VolumeHigh:
type: bool
enforce_updates: 'yes'
visu_acl: rw
avdevice_zone1: volumehigh

Eco:
type: str
visu_acl: rw
avdevice_zone0: eco

Source:
type: str
visu_acl: rw
avdevice_zone1: input

Music:
type: bool
visu_acl: ro
eval: 1 if ((sh.Denon.Source() == 'DVD' or sh.Denon.Source() == 'CD' or sh.Denon.Source() == 'NET') and sh.Denon.Power()) else 0
eval_trigger:
- Denon.Source
- Denon.Power
enforce_updates: 'yes'

Mode:
type: str
visu_acl: rw
avdevice_zone1: mode

Dialog:
type: num
visu_acl: rw
avdevice_zone1: dialog
enforce_updates: 'no'

Dialogtoggle:
type: bool
visu_acl: rw
avdevice_zone1: dialogtoggle

Subwoofer:
type: num
visu_acl: rw
avdevice_zone1: subwoofer
enforce_updates: 'no'

Subwoofertoggle:
type: bool
visu_acl: rw
avdevice_zone1: subwoofertoggle

CinemaEQ:
type: bool
visu_acl: rw
avdevice_zone1: cinemaeq

Mainspeakers:
type: str
visu_acl: rw
avdevice_zone1: mainspeakers

Sleep:
type: num
visu_acl: rw
avdevice_zone1: sleep

Standby:
type: foo
visu_acl: rw
avdevice_zone1: standby

Bass:
type: num
visu_acl: rw
avdevice_zone1: bass

BassUp:
type: num
visu_acl: rw
avdevice_zone1: bass+
enforce_updates: 'yes'

BassDown:
type: num
visu_acl: rw
avdevice_zone1: bass-
enforce_updates: 'yes'

Tone:
type: bool
visu_acl: rw
avdevice_zone1: tone

Trebble:
type: num
visu_acl: rw
avdevice_zone1: trebble

TrebbleUp:
type: num
visu_acl: rw
avdevice_zone1: trebble+
enforce_updates: 'yes'

TrebbleDown:
type: num
visu_acl: rw
avdevice_zone1: trebble-
enforce_updates: 'yes'

Videoinput:
type: str
visu_acl: rw
avdevice_zone1: videoinput

Audioinput:
type: str
visu_acl: rw
avdevice_zone1: audioinput

Videoparams:
type: str
visu_acl: rw
avdevice_zone1: videoparams

Power2:
type: bool
visu_acl: rw
avdevice_zone2: power

Source2:
type: str
visu_acl: rw
avdevice_zone2: input

Music:
type: bool
visu_acl: ro
eval: 1 if ((sh.Denon.Source2() == 'DVD' or sh.Denon.Source2() == 'CD' or sh.Denon.Source2() == 'NET') and sh.Denon.Power2()) else 0
eval_trigger:
- Denon.Source2
- Denon.Power2

Mute2:
type: bool
visu_acl: rw
avdevice_zone2: mute

Volume2:
type: num
visu_acl: rw
avdevice_zone2: volume

Fading:
type: num

VolumeUp2:
type: bool
visu_acl: rw
avdevice_zone2: volume+
enforce_updates: 'yes'

VolumeDown2:
type: bool
visu_acl: rw
avdevice_zone2: volume-
enforce_updates: 'yes'

VolumeHigh2:
type: bool
visu_acl: rw
avdevice_zone2: volumehigh
enforce_updates: 'yes'

VolumeLow2:
type: bool
visu_acl: rw
avdevice_zone2: volumelow
enforce_updates: 'yes'

Sleep2:
type: num
visu_acl: rw
avdevice_zone2: sleep

Standby2:
type: foo
visu_acl: rw
avdevice_zone2: standby

Power3:
type: bool
visu_acl: rw
avdevice_zone3: power

Source3:
type: str
visu_acl: rw
avdevice_zone3: input

Musik:
type: bool
visu_acl: ro
eval: 1 if ((sh.Denon.Source3() == 'DVD' or sh.Denon.Source3() == 'CD' or sh.Denon.Source3() == 'NET') and sh.Denon.Power3()) else 0
eval_trigger:
- Denon.Source3
- Denon.Power3

Mute3:
type: bool
visu_acl: rw
avdevice_zone3: mute

Volume3:
type: num
visu_acl: rw
avdevice_zone3: volume

Fading:
type: num

VolumeUp3:
type: bool
visu_acl: rw
avdevice_zone3: volume+
enforce_updates: 'yes'

VolumeDown3:
type: bool
visu_acl: rw
avdevice_zone3: volume-
enforce_updates: 'yes'

VolumeHigh3:
type: bool
visu_acl: rw
avdevice_zone3: volumehigh
enforce_updates: 'yes'

VolumeLow3:
type: bool
visu_acl: rw
avdevice_zone3: volumelow
enforce_updates: 'yes'

Sleep3:
type: num
visu_acl: rw
avdevice_zone3: sleep

Standby3:
type: foo
visu_acl: rw
avdevice_zone3: standby
Loading

0 comments on commit 034d265

Please sign in to comment.