Browse Source

add some better documentation..

main
John-Mark Gurney 8 years ago
parent
commit
e6b3f09f50
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      yadenon.py

+ 10
- 3
yadenon.py View File

@@ -42,7 +42,11 @@ import twisted.internet.serialport
__all__ = [ 'DenonAVR' ] __all__ = [ 'DenonAVR' ]


class DenonAVR(object,basic.LineReceiver): class DenonAVR(object,basic.LineReceiver):
delimiter = '\r'
'''A Twisted Protocol Handler for Denon Receivers. This is not yet
complete, but has basic functionally, and more will be added as
needed.'''

delimiter = '\r' # line delimiter is the CR
timeOut = 1 timeOut = 1


def __init__(self, serdev): def __init__(self, serdev):
@@ -181,7 +185,8 @@ class DenonAVR(object,basic.LineReceiver):
self.sendLine(cmd) self.sendLine(cmd)


def lineReceived(self, event): def lineReceived(self, event):
'''Process a line from the AVR.'''
'''Process a line from the AVR. This is internal and will
be called by LineReceiver.'''


#print 'lR:', `event` #print 'lR:', `event`
if len(event) >= 2: if len(event) >= 2:
@@ -214,7 +219,9 @@ class DenonAVR(object,basic.LineReceiver):
@inlineCallbacks @inlineCallbacks
def update(self): def update(self):
'''Update the status of the AVR. This ensures that the '''Update the status of the AVR. This ensures that the
state of the object matches the amp.'''
state of the object matches the amp. Returns a Deferred.
When the deferred fires, then all the internal state has
been updated and can be examined.'''


d = self._waitfor('PW') d = self._waitfor('PW')




Loading…
Cancel
Save