Example #1
0
    def __init__(self, *args, **kwargs):
        Switch.__init__(self, *args, **kwargs)

        if type(self.number) == type(''):
            self.number = eval(self.number)
        
        self.house = housemap[self.house.capitalize()]
        self.number = devicemap[self.number]

        self.port = int(self.port)

        # start in off state, must be a way of determining device State ..
        self._power = 'Off'

        try:
            self._port = serial.Serial(self.port,
                                       baudrate = 4800,
                                       bytesize = serial.EIGHTBITS,
                                       parity = serial.PARITY_NONE, 
                                       stopbits = serial.STOPBITS_ONE,
                                       timeout = 1,
                                       xonxoff = 0,
                                       rtscts = 0)
        except serial.SerialException:
            self._port = None
 def __init__(self,
              host_ip,
              hostname,
              ip_def_gateway,
              vlan_first,
              vlan_end,
              transit_vlan="none",
              transit_vlan_end="none",
              ip_snmp_server="192.168.0.1",
              timezone="5"):
     Switch.__init__(self, host_ip, hostname, ip_def_gateway, vlan_first,
                     vlan_end, transit_vlan, transit_vlan_end,
                     ip_snmp_server, timezone)
Example #3
0
    def __init__(self, *args, **kwargs):
        Switch.__init__(self, *args, **kwargs)

        self._power = False

        try:
            self._port = serial.Serial(
                self.port,
                baudrate=19200,
                bytesize=serial.EIGHTBITS,
                parity=serial.PARITY_NONE,
                stopbits=serial.STOPBITS_ONE,
                timeout=0.1,
                xonxoff=0,
                rtscts=0,
            )
        except serial.SerialException:
            self._port = None
Example #4
0
	def __init__(self, name, addr):
		Switch.__init__(self, name, addr)
Example #5
0
 def __init__(self, house, xml):
     Switch.__init__(self, house, xml)
Example #6
0
 def __init__(self, name, addr):
     Switch.__init__(self, name, addr)
Example #7
0
 def __init__(self,parent,mapping):
     self.parent = parent
     Switch.__init__(self,mapping)