Package libavg :: Module avg :: Class ConradRelais

Class ConradRelais


Interface to one or more conrad relais cards connected to a serial port. Per card, up to eight 220V devices can be connected.

Instance Methods
 
__init__(AVGPlayer, port)
Opens a connection to the relais card(s) connected to a serial port.
value
get(card, index)
Returns the state of one of the relais.
 
getNumCards()
Returns the number of cards connected to the serial port.
 
set(card, index, value)
Sets or resets one of the relais.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  __instance_size__ = 288
Properties

Inherited from object: __class__

Method Details

__init__(AVGPlayer, port)
(Constructor)

 

Opens a connection to the relais card(s) connected to a serial port.

Parameters:
  • AVGPlayer
  • port - The port the device is connected to. The actual device opened is /dev/ttyS<port>.
Overrides: object.__init__

get(card, index)

 

Returns the state of one of the relais.

Parameters:
  • card - Zero-based index of the card to address.
  • index - Zero-based index of the relais on the card.
Returns: value

set(card, index, value)

 

Sets or resets one of the relais.

Parameters:
  • card - Zero-based index of the card to address.
  • index - Zero-based index of the relais on the card.
  • value - Whether to set (True) or reset (False) the relais.