def test_integration(): cube = objects.from_parsed_data(parsing.start(RAW_DATA)) tools.assert_equal('0113', cube.firmware_version) tools.assert_equal('JEQ0543545', cube.serial) tools.assert_equal('03f6c9', cube.address) tools.assert_equal(2, len(cube.rooms)) tools.assert_equal(3, len(cube.devices)) output.display(cube)
def main(): print('parsing ', repr(sys.argv[1])) message = parsing.parse(bytes(sys.argv[1], "utf-8")) output.display(message[0]) if message[0] is None: f = open('log.txt', 'a') # f.write(repr(sys.argv[1]) + '\n') f.close() elif message[0].msg_type == b's:' or message[0].msg_type == b'S:' : f = open('log.txt', 'a') #f.write(message[0].__dict__ + '\n') f.write(repr(sys.argv[1]) + '\n') pprint(message[0].__dict__, f) f.close()
def main(): cube = objects.MaxCube(sys.argv[1], int(sys.argv[2])) cube.connect() output.display(cube)
def main(): raw_data = network.read_raw_data(sys.argv[1], int(sys.argv[2])) cube = objects.from_parsed_data(parsing.start(raw_data)) output.display(cube)