import csv


def deviceAddressDictionary(addressPointFile):
	"""Create a dictionary containing the mapping of each trend component to its address and device"""

	addressPointDict = dict()
	count = 0

	with open(addressPointFile, 'r') as csvfile:
		reader = csv.reader(csvfile)
		for row in reader:
			#skip the header
			if count == 0:
				count += 1
			else:	

				bacNetAddress = row[0]
				deviceId = row[1]
				pointName = row[2]
				addressPointDict[pointName] = (bacNetAddress, deviceId)

	return addressPointDict