def __init__(self, dev_address, name): super(ZWTransport, self).__init__(dev_address, name) try: pyzwave.setVerbose(0) pyzwave.setdebug(0) except: print "PyZwave module has been updated. Please RE-INSTALL the pyzwave module in the wukong/tools/python/pyzwave" print "Using command: sudo python setup.py install" exit(-1) pyzwave.init(dev_address) try: _addr = pyzwave.getAddr() except: print "PyZwave module has been updated. Please RE-INSTALL the pyzwave module in the wukong/tools/python/pyzwave" print "Using command: sudo python setup.py install" exit(-1) b = _addr[:4] self._network_id = sum(b[i] << ((len(b) - 1 - i) * 8) for i in range(len(b))) self._node_id = _addr[4] logger.info( "transport interface %s initialized on %s with Network ID %s and Node ID %s" % (name, dev_address, hex(self._network_id), hex(self._node_id)))
def __init__(self): self._mode = 'stop' # pyzwave try: pyzwave.init(ZWAVE_GATEWAY_IP) except IOError as e: return False TransportAgent.__init__(self)
def __init__(self): self._mode = 'stop' # pyzwave try: pyzwave.init(ZWAVE_GATEWAY_IP) except IOError as e: return False TransportAgent.__init__(self)
def __init__(self): logging.info('ZwaveAgent constructor') self._mode = 'stop' # pyzwave try: pyzwave.init(ZWAVE_GATEWAY_IP) except IOError as e: return False TransportAgent.__init__(self)
def init(option, debug=False): global pymodule if option == 'zwave' or option == 0: try: pyzwave.init(ZWAVE_GATEWAY_IP) pymodule = pyzwave except IOError as e: print e return None elif option == 'zigbee' or option == 1: pyzigbee.init() pymodule = pyzigbee print 'pynvc debugging' pymodule.setdebug(debug) return True
def init(option, debug=False): global pymodule if option == 'zwave' or option == 0: try: pyzwave.init(ZWAVE_GATEWAY_IP) pymodule = pyzwave except IOError as e: print e return None elif option == 'zigbee' or option == 1: pyzigbee.init() pymodule = pyzigbee print 'pynvc debugging' pymodule.setdebug(debug) return True
def __init__(self): self._mode = 'stop' pyzwave.init(ZWAVE_GATEWAY_IP) TransportAgent.__init__(self)
def __init__(self): self._mode = 'stop' pyzwave.init(ZWAVE_GATEWAY_IP) TransportAgent.__init__(self)
def __init__(self, com_port): pyzwave.init(com_port)
import sys if len(sys.argv) < 2: print "Usagae: python testpyzwave.py port command..." print "\tcommand:" print "\t\treset\t: Factory reset controller" print "\t\tdiscover\t: Print discovered zwaveIDs" print "\t\tgetaddr\t: Get itself zwaveID" print "\t\tbasicset zwaveID value\t: Set certain value onto node with zwaveID" print "\t\tisnodefail zwaveID\t: Test if the node with zwaveID fails" print "\t\tremovefail zwaveID\t: Remove node with zwaveID if it fails" exit(-1) pyzwave.setVerbose(0) pyzwave.setdebug(0) pyzwave.init(sys.argv[1]) gevent.sleep(1) # print "sending packet" # while True: # pyzwave.send(5, [0x88]+[0, 19, 5, 2, 32, 2, 1, 0x1e]) # gevent.sleep(3) # for i in [1,2,3,4,5]: # print "got device type %s from device radio address %X" % (str(pyzwave.getDeviceType(i)), i) if sys.argv[2] == "reset": print "-" * 10 + "pyzwave.hardReset" print str(pyzwave.hardReset()) elif sys.argv[2] == "discover": print "-" * 10 + "pyzwave.discover"
def init(): pyzwave.init(ZWAVE_GATEWAY_IP)