def import_ddb(): """Import registered devices from the DDB.""" print("Import registered devices fom the DDB...") address_origin = AddressOrigin.ogn_ddb counter = update_device_infos(session, address_origin) print("Imported %i devices." % counter)
def import_file(path='tests/custom_ddb.txt'): """Import registered devices from a local file.""" # (flushes previously manually imported entries) print("Import registered devices from '{}'...".format(path)) address_origin = AddressOrigin.user_defined counter = update_device_infos(session, address_origin, csvfile=path) print("Imported %i devices." % counter)