def __init__(self): ZBController.__init__(self) self.load_configs() if not self.controller_ip: self.controller_ip = raw_input("Please enter the controller IP: ") self.open(self.controller_ip) if not self.dut_node_id: self.wait_for_joined() if not self.dut_ieee_address: self.dut_ieee_address = raw_input("Please enter ieee address of device under test: ") self.save_configs()
def __init__(self): ZBController.__init__(self) self.load_configs() if not self.controller_ip: self.controller_ip = raw_input("Please enter the controller IP: ") self.open(self.controller_ip) if not self.dut_node_id: self.wait_for_joined() if not self.dut_ieee_address: self.dut_ieee_address = raw_input( "Please enter ieee address of device under test: ") self.save_configs()
def wait_for_joined(self): try: self.enable_permit_join() print "Please initiate the inclusion process on the device" self.dut_node_id = ZBController.wait_for_join(self) self.disable_permit_join() except NetworkOperationError: print "Error joining device. Trying to form a new network" self.form_network() self.enable_permit_join() print "Please initiate the inclusion process on the device" self.dut_node_id = ZBController.wait_for_join(self) self.disable_permit_join()
def configure_reporting(self, *args): ZBController.configure_reporting(self, self.dut_node_id, *args)
def bind_node(self, cluster_id): ZBController.bind_node(self, self.dut_node_id, self.dut_ieee_address, cluster_id)
def write_attribute(self, attribute, value): ZBController.write_attribute(self, self.dut_node_id, attribute, value) time.sleep(4)
def read_attribute(self, attribute): value = ZBController.read_attribute(self, self.dut_node_id, attribute) return value
def send_zcl_command(self, zcl_command, *args, **kwargs): ZBController.send_zcl_command(self, self.dut_node_id, zcl_command, *args, **kwargs) time.sleep(3)