diff --git a/Makefile b/Makefile
index 9ff50ed..eda983b 100644
--- a/Makefile
+++ b/Makefile
@@ -61,5 +61,8 @@
 board_vpd: board_vpd_obj.o
 	$(CC) -o bin/$@.exe obj/board_vpd_obj.o $(OFLAGS) $(CFLAGS)
 
+pcie_slot_present: pcie_slot_present_obj.o gpio.o
+	$(CC) -o bin/$@.exe obj/pcie_slot_present_obj.o obj/gpio.o $(OFLAGS) $(CFLAGS)
+
 
 all: libopenbmc_intf power_control chassis_identify sensor_ambient button_power sensor_host_status control_host fan host_watchdog control_bmc sensor_occ board_vpd
diff --git a/bin/Barreleye.py b/bin/Barreleye.py
index ae48df0..6fb8fb3 100644
--- a/bin/Barreleye.py
+++ b/bin/Barreleye.py
@@ -43,10 +43,18 @@
 		'system_state' : 'STANDBY',
 		'start_process' : True,
 		'monitor_process' : True,
-		'process_name' : 'inventory_manager.py',
+		'process_name' : 'inventory_items.py',
 		'heartbeat' : 'no',
 		'instances' : [	{ 'name' : 'Barreleye' } ]
 	}
+SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
+		'system_state' : 'POWERING_ON',
+		'start_process' : True,
+		'monitor_process' : False,
+		'process_name' : 'pcie_slot_present.exe',
+		'heartbeat' : 'no',
+		'instances' : [	{ 'name' : 'Slots_0' } ]
+	}
 
 
 SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
@@ -140,15 +148,7 @@
 		'monitor_process' : True,
 		'process_name' : 'sensor_host_status.exe',
 		'heartbeat' : "no",
-		'instances' : [ { 'name' : 'HostStatus_0',
-				'properties' : { 
-					'org.openbmc.SensorIpmi': {
-						'sensor_id' : 43,
-					},
-				}
-
-			}
-		]
+		'instances' : [ { 'name' : 'HostStatus_0' } ]
 	}
 SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
 		'system_state' : 'STANDBY',
@@ -224,80 +224,149 @@
 	'name'       : True,
 	'user_label' : True,
 	'location'   : True,
-	'state'   : True,
+	'state'      : True,
 	'cache'      : True
 }
+INVENTORY_ROOT = '/org/openbmc/inventory/items'
 
 FRU_INSTANCES = {
-	'/system' :
+	'<inventory_root>/system' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['SYSTEM'],
-		'fru'	       : True,
+		'fru_type'        : Openbmc.FRU_TYPES['SYSTEM'],
+		'is_fru'       : True,
 	},
-	'/system/motherboard' :
+	'<inventory_root>/system/io_board' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['MAIN_PLANAR'],
+		'fru_type'        : Openbmc.FRU_TYPES['MAIN_PLANAR'],
 		'manufacturer' : 'FOXCONN',
-		'fru'	       : True,
-		'fru_id'       : 31,
-		'location' : 'C0',
+		'is_fru'       : True,
+		'location'     : 'C1',
 	},
-	'/system/fan0' :
+
+	'<inventory_root>/system/motherboard' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['FAN'],
+		'fru_type'        : Openbmc.FRU_TYPES['MAIN_PLANAR'],
+		'manufacturer' : 'FOXCONN',
+		'is_fru'       : True,
+		'location'     : 'C0',
+	},
+	'<inventory_root>/system/fan0' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['FAN'],
 		'manufacturer' : 'DELTA',
-		'fru'	       : True,
-		'location' : 'F0',
+		'is_fru'       : True,
+		'location'     : 'F0',
 	},
-	'/system/fan1' :
+	'<inventory_root>/system/fan1' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['FAN'],
+		'fru_type'        : Openbmc.FRU_TYPES['FAN'],
 		'manufacturer' : 'DELTA',
-		'fru'	       : True,
-		'location' : 'F1',
+		'is_fru'       : True,
+		'location'     : 'F1',
 	},
-	'/system/motherboard/bmc' :
+	'<inventory_root>/system/io_board/bmc' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['BMC'],
+		'fru_type'        : Openbmc.FRU_TYPES['BMC'],
 		'manufacturer' : 'ASPEED',
-		'fru'	       : True,
+		'is_fru'       : False,
 	},
-	'/system/motherboard/cpu0' :
+	'<inventory_root>/system/motherboard/cpu0' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['CPU'],
+		'fru_type'        : Openbmc.FRU_TYPES['CPU'],
 		'manufacturer' : 'IBM',
-		'fru'	       : True,
-		'location' : 'P0',
-		'fru_id'   : 10,
+		'is_fru'       : True,
+		'location'     : 'P0',
 	},
-	'/system/motherboard/cpu0/core0' :
+	'<inventory_root>/system/motherboard/cpu0/core0' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['CORE'],
-		'fru'	       : False,
-		'sensor_id'    : 1,	
+		'fru_type'        : Openbmc.FRU_TYPES['CORE'],
+		'is_fru'       : False,
 	},
-	'/system/motherboard/cpu0/core1' :
+	'<inventory_root>/system/motherboard/cpu0/core1' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['CORE'],
-		'fru'	       : False,
-		'sensor_id'    : 2,	
+		'fru_type'        : Openbmc.FRU_TYPES['CORE'],
+		'is_fru'       : False,
 	},
-	'/system/motherboard/dimm0' :
+	'<inventory_root>/system/motherboard/dimm0' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['DIMM'],
-		'fru'	       : True,
-		'fru_id'       : 12,
-		'sensor_id'    : 20,	
+		'fru_type'        : Openbmc.FRU_TYPES['DIMM'],
+		'is_fru'       : True,
 	},
-	'/system/motherboard/dimm1' :
+	'<inventory_root>/system/motherboard/dimm1' :
 	{
-		'ftype'        : Openbmc.FRU_TYPES['DIMM'],
-		'fru'	       : True,
-		'fru_id'       : 13,
-		'sensor_id'    : 21,	
+		'fru_type'        : Openbmc.FRU_TYPES['DIMM'],
+		'is_fru'       : True,
 	},
+	'<inventory_root>/system/io_board/pcie_left_slot_riser' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['RISER_CARD'],
+		'user_label'      : 'Left Slot Riser',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_right_slot_riser' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['RISER_CARD'],
+		'user_label'      : 'Right Slot Riser',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_x16_slot_riser' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['RISER_CARD'],
+		'user_label'      : 'PCIE x16 Slot Riser',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_slot0' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['PCIE_CARD'],
+		'user_label'      : 'OCP Mezz card 0',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_slot1' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['PCIE_CARD'],
+		'user_label'      : 'OCP Mezz card 1',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_slot2' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['PCIE_CARD'],
+		'user_label'      : 'OCP Mezz card 2',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_mezz0' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['PCIE_CARD'],
+		'user_label'      : 'OCP Mezz card 0',
+		'is_fru'       : True,
+	},
+	'<inventory_root>/system/io_board/pcie_mezz1' :
+	{
+		'fru_type'        : Openbmc.FRU_TYPES['PCIE_CARD'],
+		'user_label'      : 'OCP Mezz card 1',
+		'is_fru'       : True,
+	},
+
 }
 
+ID_LOOKUP = {
+	'FRU' : {
+		'14' : '<inventory_root>/system/motherboard/dimm0',
+	},
+	'SENSOR' : {
+		'21' : '<inventory_root>/system/motherboard/dimm0',
+		'14' : '/org/openbmc/sensors/HostStatus_0',
+	},
+	'GPIO_PRESENT' : {
+		'SLOT0_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_left_slot_riser', 
+		'SLOT1_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_right_slot_riser', 
+		'SLOT2_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_x16_slot_riser',
+		'SLOT0_PRESENT' : '<inventory_root>/system/io_board/pcie_slot0', 
+		'SLOT1_PRESENT' : '<inventory_root>/system/io_board/pcie_slot1', 
+		'SLOT2_PRESENT' : '<inventory_root>/system/io_board/pcie_slot2',
+		'MEZZ0_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz0', 
+		'MEZZ1_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz1',
+	}
+}
 
 GPIO_CONFIG = {}
 GPIO_CONFIG['FSI_CLK']    = { 'gpio_num': 4, 'direction': 'out' }
@@ -307,5 +376,14 @@
 GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out'  }
 GPIO_CONFIG['PGOOD']      = { 'gpio_num': 23, 'direction': 'in'  }
 GPIO_CONFIG['IDENTIFY']   = { 'gpio_num': 34, 'direction': 'out' }
-GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
+GPIO_CONFIG['POWER_BUTTON'] =  { 'gpio_num': 32, 'direction': 'in' }
+GPIO_CONFIG['SLOT0_RISER_PRESENT'] =   { 'gpio_num': 104, 'direction': 'in' }
+GPIO_CONFIG['SLOT1_RISER_PRESENT'] =   { 'gpio_num': 105, 'direction': 'in' }
+GPIO_CONFIG['SLOT2_RISER_PRESENT'] =   { 'gpio_num': 106, 'direction': 'in' }
+GPIO_CONFIG['SLOT0_PRESENT'] =  { 'gpio_num': 107, 'direction': 'in' }
+GPIO_CONFIG['SLOT1_PRESENT'] =  { 'gpio_num': 108, 'direction': 'in' }
+GPIO_CONFIG['SLOT2_PRESENT'] =  { 'gpio_num': 109, 'direction': 'in' }
+GPIO_CONFIG['MEZZ0_PRESENT'] =  { 'gpio_num': 112, 'direction': 'in' }
+GPIO_CONFIG['MEZZ1_PRESENT'] =  { 'gpio_num': 113, 'direction': 'in' }
+
 
diff --git a/bin/Openbmc.py b/bin/Openbmc.py
index 625f36c..af7e79b 100644
--- a/bin/Openbmc.py
+++ b/bin/Openbmc.py
@@ -15,6 +15,7 @@
 	'FAN' : 5,
 	'BMC' : 6,
 	'CORE' : 7,
+	'PCIE_CARD' : 8,
 }
 FRU_STATES = {
 	'NORMAL'            : 0,
@@ -56,30 +57,39 @@
 
 
 def get_objs(bus,bus_name,path,objects):
-	obj = bus.get_object(bus_name,path)
+	#print ">>>>>>>>>>>>>>>>>>>>>>>>>>>> "+bus_name+"; "+path
+	tmp_path = path
+	if (path == ""):
+		tmp_path="/"
+	obj = bus.get_object(bus_name,tmp_path)
 	introspect_iface = dbus.Interface(obj,"org.freedesktop.DBus.Introspectable")
 	#print introspect_iface.Introspect()
  	tree = ET.ElementTree(ET.fromstring(introspect_iface.Introspect()))
  	root = tree.getroot()
+	parent = True
 	for node in root.iter('node'):
-		if (node.attrib.has_key('name') == False):
-			for intf in node.iter('interface'):
-				intf_name = intf.attrib['name']
-				if (intf_name.find(BUS_PREFIX)==0):
-					parts=path.split('/')
-					instance = parts[len(parts)-1]
-					if (objects.has_key(instance) == False):
-						objects[instance] = {}
-						objects[instance]['PATH'] = path
-						objects[instance]['INIT'] = []
-					for method in intf.iter('method'):
-						if (method.attrib['name'] == "init"):
-							objects[instance]['INIT'].append(intf_name)
+		for intf in node.iter('interface'):
+			intf_name = intf.attrib['name']
+			#if (intf_name.find(BUS_PREFIX)==0):
+			parts=path.split('/')
+			instance = parts[len(parts)-1]
+			if (objects.has_key(instance) == False):
+				objects[instance] = {}
+				objects[instance]['PATH'] = path
+				objects[instance]['INIT'] = []
+			for method in intf.iter('method'):
+				if (method.attrib['name'] == "init"):
+					objects[instance]['INIT'].append(intf_name)
 
-		else:
+		if (node.attrib.has_key('name') == True):
 			node_name = node.attrib['name']
-			if (node_name != path):
-				get_objs(bus,bus_name,path+"/"+node.attrib['name'],objects)
+			if (parent == False):
+				get_objs(bus,bus_name,path+"/"+node_name,objects)
+			else:
+				if (node_name != "" and node_name != path):
+					get_objs(bus,bus_name,node_name,objects)
+			
+		parent = False
 
 
 class DbusProperty:
diff --git a/bin/inventory_items.py b/bin/inventory_items.py
new file mode 100644
index 0000000..f679fee
--- /dev/null
+++ b/bin/inventory_items.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import cPickle
+import json
+
+if (len(sys.argv) < 2):
+	print "Usage:  inventory_items.py [system name]"
+	exit(1)
+System = __import__(sys.argv[1])
+import Openbmc
+
+
+INTF_NAME = 'org.openbmc.InventoryItem'
+DBUS_NAME = 'org.openbmc.managers.Inventory'
+
+FRUS = System.FRU_INSTANCES
+FRU_PATH = System.FRU_PATH
+
+class Inventory(dbus.service.Object):
+	def __init__(self,bus,name):
+		dbus.service.Object.__init__(self,bus,name)
+		self.objects = [ ]
+
+	def addItem(self,item):
+		self.objects.append(item)
+
+	@dbus.service.method("org.openbmc.managers.Inventory",
+		in_signature='', out_signature='a{sa{sv}}')
+	def getItems(self):
+		tmp_obj = {}
+		for item in self.objects:
+			tmp_obj[str(item.item['name'])]=item.getItemDict()
+		return tmp_obj
+			
+
+
+class InventoryItem(dbus.service.Object):
+	def __init__(self,bus,name):
+		dbus.service.Object.__init__(self,bus,name)
+		## store all properties in a dict so can easily
+		## send on dbus
+		self.item = {
+			'name' : name,
+			'is_fru' : False,
+			'fru_type' : 0,
+			'state'  : 0,
+			'data' : { 'manufacturer' : "" }
+		}
+		#self.name = name
+		#self.is_fru = False
+		#self.fru_type = 0
+		self.cache = True
+		#self.state = 0
+
+	def getItemDict(self):
+		return self.item
+
+	@dbus.service.signal('org.openbmc.EventLog')
+	def EventLog(self, priority, message, rc):
+        	pass
+		
+	@dbus.service.method('org.openbmc.InventoryItem',
+		in_signature='a{sv}', out_signature='')
+	def update(self,data):
+		## translate dbus data into basic data types
+		for k in data.keys():
+			d = Openbmc.DbusProperty(k,data[k])
+			self.item['data'][str(k)] = d.getBaseValue()
+		self.saveToCache()
+
+	@dbus.service.method("org.openbmc.SensorValue",
+		in_signature='y', out_signature='')
+	def setValue(self,data):
+		self.item['state'] = data
+		#self.saveToCache()
+		print "Update Fru State: "+str(self.item['state'])
+
+	def isCached(self):
+		return self.cache
+
+	def getCacheFilename(self):
+		global FRU_PATH
+		name = self.item['name'].replace('/','.')
+		filename = FRU_PATH+name[1:]+".fru"
+		return filename
+	
+	def saveToCache(self):
+		if (self.isCached() == False):
+			return
+		print "Caching: "+self.item['name']
+		# TODO: error handling
+		output = open(self.getCacheFilename(), 'wb')
+		## just pickle dict not whole object
+		cPickle.dump(self.item['data'],output)
+		output.close()
+
+	def loadFromCache(self):
+		if (self.isCached() == False):
+			return;
+		## overlay with pickled data
+		filename=self.getCacheFilename()
+		if (os.path.isfile(filename)):
+			print "Loading from cache: "+filename
+			# TODO: error handling
+			p = open(filename, 'rb')
+			data2 = cPickle.load(p)
+			for k in data2.keys():
+				self.item['data'][k] = data2[k]
+
+
+
+if __name__ == '__main__':
+    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+    bus = dbus.SessionBus()
+    name = dbus.service.BusName(DBUS_NAME,bus)
+    mainloop = gobject.MainLoop()
+    obj_parent = Inventory(bus, '/org/openbmc/managers/Inventory')
+
+    for f in FRUS.keys():
+	obj_path=f.replace("<inventory_root>",System.INVENTORY_ROOT)
+    	obj = InventoryItem(bus,obj_path)
+	obj.is_fru = FRUS[f]['is_fru']
+	obj.fru_type = FRUS[f]['fru_type']
+	obj.loadFromCache();
+	obj_parent.addItem(obj)
+	
+    print "Running Inventory Manager"
+    mainloop.run()
+
diff --git a/bin/inventory_manager.py b/bin/inventory_manager.py
deleted file mode 100644
index 75cc390..0000000
--- a/bin/inventory_manager.py
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import sys
-import gobject
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-import cPickle
-import json
-
-if (len(sys.argv) < 2):
-	print "Usage:  inventory_manager.py [system name]"
-	exit(1)
-System = __import__(sys.argv[1])
-import Openbmc
-
-DBUS_NAME = 'org.openbmc.managers.Inventory'
-OBJ_NAME = '/org/openbmc/managers/Inventory'
-FRUS = System.FRU_INSTANCES
-FRU_PATH = System.FRU_PATH
-
-## accessor class to FRU data structure
-class Fru:
-	def __init__(self,fru):
-		## validation
-		if (FRUS.has_key(fru) == False):
-			# TODO: event log
-			raise Exception("Invalid FRU path: "+fru)
-		
-		self.fru = fru
-	
-	def getField(self,field):
-		if (FRUS[self.fru].has_key(field) == False):
-			# TODO: event log
-			raise Exception("Invalid field: "+field)
-			
-		return FRUS[self.fru][field]
-
-	def isFru(self):
-		return FRUS[self.fru]['fru']
-
-	def update(self,data):
-		for k in data.keys():
-			FRUS[self.fru][k] = data[k]
-
-	def isCached(self):
-		return True
-
-	def getCacheFilename(self):
-		global FRU_PATH
-		name = self.fru.replace('/','.')
-		filename = FRU_PATH+name[1:]+".fru"
-		return filename
-	
-	def saveToCache(self):
-		if (self.isCached() == False):
-			return
-		print "Caching: "+self.fru
-		# TODO: error handling
-		output = open(self.getCacheFilename(), 'wb')
-		## just pickle dict not whole object
-		cPickle.dump(FRUS[self.fru],output)
-		output.close()
-
-	def loadFromCache(self):
-		if (self.isCached() == False):
-			return;
-		## overlay with pickled data
-		filename=self.getCacheFilename()
-		if (os.path.isfile(filename)):
-			print "Loading from cache: "+filename
-			# TODO: error handling
-			p = open(filename, 'rb')
-			data2 = cPickle.load(p)
-			for k in data2.keys():
-				FRUS[self.fru][k] = data2[k]
-
-	def __str__(self):	
-		r = "Fru: "+str(self.fru_id)+"\n"
-		for f in self.data.keys():
-			r = r+f+" = "+str(self.data[f])+"\n"
-		return r
-
-		
-
-class InventoryManager(dbus.service.Object):
-	def __init__(self,bus,name):
-		dbus.service.Object.__init__(self,bus,name)
-		
-		bus.add_signal_receiver(self.UpdateFruHandler,
-					dbus_interface = "org.openbmc.sensors.IpmiBt", 
-					signal_name = 'UpdateFru')
-
-		bus.add_signal_receiver(self.SetSensorHandler, 
-					dbus_interface = "org.openbmc.sensors.IpmiBt", 
-					signal_name = "SetSensor")
-
-		self.fru_db = {}
-		self.fru_id_lookup = {}
-		self.sensor_id_lookup = {}
-
-		for fru_path in FRUS.keys():
-			self.addFru(fru_path)
-			f = FRUS[fru_path]
-			if (f.has_key('fru_id')):
-				self.fru_id_lookup[f['fru_id']] = fru_path
-			if (f.has_key('sensor_id')):
-				self.sensor_id_lookup[f['sensor_id']] = fru_path
-
-	@dbus.service.signal('org.openbmc.EventLog')
-	def EventLog(self, priority, message, rc):
-        	pass
-		
-	def UpdateFruHandler(self,fru_id,data):
-		self.updateFruFromId(fru_id,data)		
-
-	def SetSensorHandler(self,sensor_id,data):
-		fru_path = self.getFruSensor(sensor_id)
-		if (fru_path != ""):
-			state = { 'state' : data }
-			self.updateFru(fru_path,state)
-			
-	@dbus.service.method(DBUS_NAME,
-		in_signature='y', out_signature='s')	
-	def getFruSensor(self,sensor_id):
-		if (self.sensor_id_lookup.has_key(sensor_id) == False):
-			return ""
-		return self.sensor_id_lookup[sensor_id]
-		
-	def addFru(self,fru_path):
-		new_fru = Fru(fru_path)
-		new_fru.loadFromCache()
-		self.fru_db[fru_path] = new_fru
-				
-	@dbus.service.method(DBUS_NAME,
-		in_signature='ia{sv}', out_signature='')
-	def updateFruFromId(self,fru_id,data):
-		iid = int(fru_id)
-		if (self.fru_id_lookup.has_key(iid) == False):
-			self.EventLog(1,"FRU ID not found: "+str(iid),1)
-		else:
-			self.updateFru(self.fru_id_lookup[iid],data)
-		
-
-	@dbus.service.method(DBUS_NAME,
-		in_signature='sa{sv}', out_signature='')
-	def updateFru(self,fru_path,data):
-		## translate dbus data into basic data types
-		clean_data = {}
-		for k in data.keys():
-			d = Openbmc.DbusProperty(k,data[k])
-			clean_data[str(k)] = d.getBaseValue()
-
-		if (self.fru_db.has_key(fru_path)):
-			## update properties then save to cache
-			print "Updating FRU: "+fru_path
-			self.fru_db[fru_path].update(clean_data)
-			self.fru_db[fru_path].saveToCache()
-
-
-	@dbus.service.method(DBUS_NAME,
-		in_signature='', out_signature='a{sa{sv}}')
-	def getFrus(self):
-		return FRUS
-
-
-if __name__ == '__main__':
-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-    bus = dbus.SessionBus()
-    name = dbus.service.BusName(DBUS_NAME,bus)
-    obj = InventoryManager(bus,OBJ_NAME)
-    mainloop = gobject.MainLoop()
-
-    print "Running Inventory Manager"
-    mainloop.run()
-
diff --git a/bin/ipmi_example.py b/bin/ipmi_example.py
index 1d0061d..290fc33 100644
--- a/bin/ipmi_example.py
+++ b/bin/ipmi_example.py
@@ -10,21 +10,12 @@
 
 import Openbmc
 
-DBUS_NAME = 'org.openbmc.sensors.IpmiBt'
-OBJ_NAME = '/org/openbmc/sensors/IpmiBt'
+SENSOR_INTERFACE = "org.openbmc.SensorValue"
 
 class IpmiBt(dbus.service.Object):
 	def __init__(self,bus,name):
 		dbus.service.Object.__init__(self,bus,name)
 
-	@dbus.service.signal('org.openbmc.sensors.IpmiBt')
-	def SetSensor(self, ipmi_id, value):
-        	pass
-
-	@dbus.service.signal('org.openbmc.sensors.IpmiBt')
-	def UpdateFru(self, ipmi_id, data):
-        	pass
-
 
 def getWatchdog():
 	obj =  bus.get_object('org.openbmc.watchdog.Host',
@@ -47,17 +38,16 @@
 
 
 if __name__ == '__main__':
-	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+	#dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
  	bus = dbus.SessionBus()
-	name = dbus.service.BusName(DBUS_NAME,bus)
-	obj = IpmiBt(bus,OBJ_NAME)
-	mainloop = gobject.MainLoop()
+	#name = dbus.service.BusName(DBUS_NAME,bus)
+	#mainloop = gobject.MainLoop()
 
 	cmd = sys.argv[1]
 	data = None
 	ipmi_id = dbus.Byte(0)
 	if (len(sys.argv) > 2):
-		ipmi_id = dbus.Byte(int(sys.argv[2]))
+		ipmi_id = sys.argv[2]
 	if (len(sys.argv)>3):
 		data = sys.argv[3]
 
@@ -68,18 +58,36 @@
 		intf = getChassisControl()
 		intf.powerOff()
 	elif (cmd == "setsensor"):
-		obj.SetSensor(ipmi_id,dbus.Byte(int(data)))
+		intf_sys = Openbmc.getManagerInterface(bus,"System")
+		obj_info = intf_sys.getObjectFromId("SENSOR",ipmi_id)
+		obj_path = obj_info['obj_path']
+		bus_name = obj_info['bus_name']
+		if (obj_path != "" and bus_name != ""):
+			obj = bus.get_object(bus_name,obj_path)
+			intf = dbus.Interface(obj,SENSOR_INTERFACE)
+			intf.setValue(dbus.Byte(int(data)))	
+			
 	elif (cmd == "getsensors"):
 		intf_sens = Openbmc.getManagerInterface(bus,"Sensors")
 		data = intf_sens.getSensors()
 		prettyPrint(data)
 	elif (cmd == "updatefru"):
 		d = { 'manufacturer' : data }	
-		obj.UpdateFru(ipmi_id,d)
+		intf_sys = Openbmc.getManagerInterface(bus,"System")
+		obj_info = intf_sys.getObjectFromId("FRU",ipmi_id)
+		obj_path = obj_info['obj_path']
+		bus_name = obj_info['bus_name']
+		if (obj_path != "" and bus_name != ""):
+			obj = bus.get_object(bus_name,obj_path)
+			intf = dbus.Interface(obj,"org.openbmc.InventoryItem")
+			intf.update(d)	
+
 	elif (cmd == "getfrus"):
 		intf_fru = Openbmc.getManagerInterface(bus,"Inventory")
-		data = intf_fru.getFrus()
-		prettyPrint(data)
+		data = intf_fru.getItems()
+		for i in data:
+			for k in data[i].keys():
+				print k+" = "+str(data[i][k]) 
 	elif (cmd == "pokewatchdog"):
 		intf = self.getWatchdog()
 		intf.poke()
diff --git a/bin/system_manager.py b/bin/system_manager.py
index 1bc90a3..a5b8023 100644
--- a/bin/system_manager.py
+++ b/bin/system_manager.py
@@ -2,7 +2,6 @@
 
 import sys
 import subprocess
-#from gi.repository import GObject
 import gobject
 import dbus
 import dbus.service
@@ -41,15 +40,23 @@
 					signal_name = "EventLog",
 					path_keyword='path')
 
-
-
 		self.current_state = ""
 		self.system_states = {}
+		self.bus_name_lookup = {}
+
 		for bus_name in System.SYSTEM_CONFIG.keys():
 			sys_state = System.SYSTEM_CONFIG[bus_name]['system_state']
 			if (self.system_states.has_key(sys_state) == False):
 				self.system_states[sys_state] = []
 			self.system_states[sys_state].append(bus_name)
+	
+		## replace symbolic path in ID_LOOKUP
+		for category in System.ID_LOOKUP:
+			for key in System.ID_LOOKUP[category]:
+				val = System.ID_LOOKUP[category][key]
+				new_val = val.replace("<inventory_root>",System.INVENTORY_ROOT)
+				System.ID_LOOKUP[category][key] = new_val
+	
 		self.SystemStateHandler("INIT")
 		print "SystemManager Init Done"
 
@@ -86,7 +93,27 @@
 			method()
 
 		self.current_state = state_name
-			
+		
+	@dbus.service.method(DBUS_NAME,
+		in_signature='ss', out_signature='a{ss}')
+	def getObjectFromId(self,category,key):
+		bus_name = ""
+		obj_path = ""
+
+		if (System.ID_LOOKUP.has_key(category)):
+			if (System.ID_LOOKUP[category].has_key(key)):
+				obj_path = System.ID_LOOKUP[category][key]
+		else:
+			print "ERROR: key not found: "+category+","+key
+
+		if (self.bus_name_lookup.has_key(obj_path)):
+			bus_name = self.bus_name_lookup[obj_path]
+		else:
+			print "ERROR: bus name not found for: "+obj_path
+		r = { 'bus_name' : bus_name, 'obj_path' : obj_path }
+		return r
+	
+	
 	def start_process(self,bus_name):
 		if (System.SYSTEM_CONFIG[bus_name]['start_process'] == True):
 			process_name = System.BIN_PATH+System.SYSTEM_CONFIG[bus_name]['process_name']
@@ -154,11 +181,13 @@
 
 	def NewBusHandler(self, bus_name, a, b):
 		if (len(b) > 0 and bus_name.find(Openbmc.BUS_PREFIX) == 0):
+			objects = {}
+			Openbmc.get_objs(bus,bus_name,"",objects)
+			for instance_name in objects.keys():
+				self.bus_name_lookup[objects[instance_name]['PATH']] = bus_name
+			
 			if (System.SYSTEM_CONFIG.has_key(bus_name)):
 				System.SYSTEM_CONFIG[bus_name]['heartbeat_count'] = 0
-				objects = {}
-				Openbmc.get_objs(bus,bus_name,Openbmc.OBJ_PREFIX,objects)				
-	
 				for instance_name in objects.keys(): 
 					obj_path = objects[instance_name]['PATH']
 					for instance in System.SYSTEM_CONFIG[bus_name]['instances']:
diff --git a/interfaces/openbmc_intf.c b/interfaces/openbmc_intf.c
index 203a0e7..bbe94b7 100644
--- a/interfaces/openbmc_intf.c
+++ b/interfaces/openbmc_intf.c
@@ -3607,10 +3607,41 @@
   FALSE
 };
 
+static const _ExtendedGDBusArgInfo _sensor_value_method_info_set_value_IN_ARG_value =
+{
+  {
+    -1,
+    (gchar *) "value",
+    (gchar *) "v",
+    NULL
+  },
+  FALSE
+};
+
+static const _ExtendedGDBusArgInfo * const _sensor_value_method_info_set_value_IN_ARG_pointers[] =
+{
+  &_sensor_value_method_info_set_value_IN_ARG_value,
+  NULL
+};
+
+static const _ExtendedGDBusMethodInfo _sensor_value_method_info_set_value =
+{
+  {
+    -1,
+    (gchar *) "setValue",
+    (GDBusArgInfo **) &_sensor_value_method_info_set_value_IN_ARG_pointers,
+    NULL,
+    NULL
+  },
+  "handle-set-value",
+  FALSE
+};
+
 static const _ExtendedGDBusMethodInfo * const _sensor_value_method_info_pointers[] =
 {
   &_sensor_value_method_info_init,
   &_sensor_value_method_info_get_value,
+  &_sensor_value_method_info_set_value,
   NULL
 };
 
@@ -3837,6 +3868,7 @@
  * @parent_iface: The parent interface.
  * @handle_get_value: Handler for the #SensorValue::handle-get-value signal.
  * @handle_init: Handler for the #SensorValue::handle-init signal.
+ * @handle_set_value: Handler for the #SensorValue::handle-set-value signal.
  * @get_heatbeat: Getter for the #SensorValue:heatbeat property.
  * @get_poll_interval: Getter for the #SensorValue:poll-interval property.
  * @get_settable: Getter for the #SensorValue:settable property.
@@ -3900,6 +3932,29 @@
     1,
     G_TYPE_DBUS_METHOD_INVOCATION);
 
+  /**
+   * SensorValue::handle-set-value:
+   * @object: A #SensorValue.
+   * @invocation: A #GDBusMethodInvocation.
+   * @arg_value: Argument passed by remote caller.
+   *
+   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-openbmc-SensorValue.setValue">setValue()</link> D-Bus method.
+   *
+   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sensor_value_complete_set_value() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
+   *
+   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
+   */
+  g_signal_new ("handle-set-value",
+    G_TYPE_FROM_INTERFACE (iface),
+    G_SIGNAL_RUN_LAST,
+    G_STRUCT_OFFSET (SensorValueIface, handle_set_value),
+    g_signal_accumulator_true_handled,
+    NULL,
+    g_cclosure_marshal_generic,
+    G_TYPE_BOOLEAN,
+    2,
+    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
+
   /* GObject signals for received D-Bus signals: */
   /**
    * SensorValue::changed:
@@ -4437,6 +4492,104 @@
 }
 
 /**
+ * sensor_value_call_set_value:
+ * @proxy: A #SensorValueProxy.
+ * @arg_value: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorValue.setValue">setValue()</link> D-Bus method on @proxy.
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call sensor_value_call_set_value_finish() to get the result of the operation.
+ *
+ * See sensor_value_call_set_value_sync() for the synchronous, blocking version of this method.
+ */
+void
+sensor_value_call_set_value (
+    SensorValue *proxy,
+    GVariant *arg_value,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data)
+{
+  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+    "setValue",
+    g_variant_new ("(@v)",
+                   arg_value),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    callback,
+    user_data);
+}
+
+/**
+ * sensor_value_call_set_value_finish:
+ * @proxy: A #SensorValueProxy.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_value_call_set_value().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with sensor_value_call_set_value().
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_value_call_set_value_finish (
+    SensorValue *proxy,
+    GAsyncResult *res,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
+ * sensor_value_call_set_value_sync:
+ * @proxy: A #SensorValueProxy.
+ * @arg_value: Argument to pass with the method invocation.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously invokes the <link linkend="gdbus-method-org-openbmc-SensorValue.setValue">setValue()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
+ *
+ * See sensor_value_call_set_value() for the asynchronous version of this method.
+ *
+ * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
+ */
+gboolean
+sensor_value_call_set_value_sync (
+    SensorValue *proxy,
+    GVariant *arg_value,
+    GCancellable *cancellable,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+    "setValue",
+    g_variant_new ("(@v)",
+                   arg_value),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+/**
  * sensor_value_complete_init:
  * @object: A #SensorValue.
  * @invocation: (transfer full): A #GDBusMethodInvocation.
@@ -4475,6 +4628,24 @@
                    value));
 }
 
+/**
+ * sensor_value_complete_set_value:
+ * @object: A #SensorValue.
+ * @invocation: (transfer full): A #GDBusMethodInvocation.
+ *
+ * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-openbmc-SensorValue.setValue">setValue()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
+ *
+ * This method will free @invocation, you cannot use it afterwards.
+ */
+void
+sensor_value_complete_set_value (
+    SensorValue *object,
+    GDBusMethodInvocation *invocation)
+{
+  g_dbus_method_invocation_return_value (invocation,
+    g_variant_new ("()"));
+}
+
 /* ------------------------------------------------------------------------ */
 
 /**
@@ -5541,1110 +5712,6 @@
 }
 
 /* ------------------------------------------------------------------------
- * Code for interface org.openbmc.SensorIpmi
- * ------------------------------------------------------------------------
- */
-
-/**
- * SECTION:SensorIpmi
- * @title: SensorIpmi
- * @short_description: Generated C code for the org.openbmc.SensorIpmi D-Bus interface
- *
- * This section contains code for working with the <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link> D-Bus interface in C.
- */
-
-/* ---- Introspection data for org.openbmc.SensorIpmi ---- */
-
-static const _ExtendedGDBusPropertyInfo _sensor_ipmi_property_info_sensor_id =
-{
-  {
-    -1,
-    (gchar *) "sensor_id",
-    (gchar *) "y",
-    G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE,
-    NULL
-  },
-  "sensor-id",
-  FALSE
-};
-
-static const _ExtendedGDBusPropertyInfo _sensor_ipmi_property_info_entity_id =
-{
-  {
-    -1,
-    (gchar *) "entity_id",
-    (gchar *) "y",
-    G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE,
-    NULL
-  },
-  "entity-id",
-  FALSE
-};
-
-static const _ExtendedGDBusPropertyInfo * const _sensor_ipmi_property_info_pointers[] =
-{
-  &_sensor_ipmi_property_info_sensor_id,
-  &_sensor_ipmi_property_info_entity_id,
-  NULL
-};
-
-static const _ExtendedGDBusInterfaceInfo _sensor_ipmi_interface_info =
-{
-  {
-    -1,
-    (gchar *) "org.openbmc.SensorIpmi",
-    NULL,
-    NULL,
-    (GDBusPropertyInfo **) &_sensor_ipmi_property_info_pointers,
-    NULL
-  },
-  "sensor-ipmi",
-};
-
-
-/**
- * sensor_ipmi_interface_info:
- *
- * Gets a machine-readable description of the <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link> D-Bus interface.
- *
- * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
- */
-GDBusInterfaceInfo *
-sensor_ipmi_interface_info (void)
-{
-  return (GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct;
-}
-
-/**
- * sensor_ipmi_override_properties:
- * @klass: The class structure for a #GObject<!-- -->-derived class.
- * @property_id_begin: The property id to assign to the first overridden property.
- *
- * Overrides all #GObject properties in the #SensorIpmi interface for a concrete class.
- * The properties are overridden in the order they are defined.
- *
- * Returns: The last property id.
- */
-guint
-sensor_ipmi_override_properties (GObjectClass *klass, guint property_id_begin)
-{
-  g_object_class_override_property (klass, property_id_begin++, "sensor-id");
-  g_object_class_override_property (klass, property_id_begin++, "entity-id");
-  return property_id_begin - 1;
-}
-
-
-
-/**
- * SensorIpmi:
- *
- * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>.
- */
-
-/**
- * SensorIpmiIface:
- * @parent_iface: The parent interface.
- * @get_entity_id: Getter for the #SensorIpmi:entity-id property.
- * @get_sensor_id: Getter for the #SensorIpmi:sensor-id property.
- *
- * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>.
- */
-
-typedef SensorIpmiIface SensorIpmiInterface;
-G_DEFINE_INTERFACE (SensorIpmi, sensor_ipmi, G_TYPE_OBJECT);
-
-static void
-sensor_ipmi_default_init (SensorIpmiIface *iface)
-{
-  /* GObject properties for D-Bus properties: */
-  /**
-   * SensorIpmi:sensor-id:
-   *
-   * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorIpmi.sensor_id">"sensor_id"</link>.
-   *
-   * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.
-   */
-  g_object_interface_install_property (iface,
-    g_param_spec_uchar ("sensor-id", "sensor_id", "sensor_id", 0, 255, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-  /**
-   * SensorIpmi:entity-id:
-   *
-   * Represents the D-Bus property <link linkend="gdbus-property-org-openbmc-SensorIpmi.entity_id">"entity_id"</link>.
-   *
-   * Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.
-   */
-  g_object_interface_install_property (iface,
-    g_param_spec_uchar ("entity-id", "entity_id", "entity_id", 0, 255, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-}
-
-/**
- * sensor_ipmi_get_sensor_id: (skip)
- * @object: A #SensorIpmi.
- *
- * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorIpmi.sensor_id">"sensor_id"</link> D-Bus property.
- *
- * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side.
- *
- * Returns: The property value.
- */
-guchar 
-sensor_ipmi_get_sensor_id (SensorIpmi *object)
-{
-  return SENSOR_IPMI_GET_IFACE (object)->get_sensor_id (object);
-}
-
-/**
- * sensor_ipmi_set_sensor_id: (skip)
- * @object: A #SensorIpmi.
- * @value: The value to set.
- *
- * Sets the <link linkend="gdbus-property-org-openbmc-SensorIpmi.sensor_id">"sensor_id"</link> D-Bus property to @value.
- *
- * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side.
- */
-void
-sensor_ipmi_set_sensor_id (SensorIpmi *object, guchar value)
-{
-  g_object_set (G_OBJECT (object), "sensor-id", value, NULL);
-}
-
-/**
- * sensor_ipmi_get_entity_id: (skip)
- * @object: A #SensorIpmi.
- *
- * Gets the value of the <link linkend="gdbus-property-org-openbmc-SensorIpmi.entity_id">"entity_id"</link> D-Bus property.
- *
- * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side.
- *
- * Returns: The property value.
- */
-guchar 
-sensor_ipmi_get_entity_id (SensorIpmi *object)
-{
-  return SENSOR_IPMI_GET_IFACE (object)->get_entity_id (object);
-}
-
-/**
- * sensor_ipmi_set_entity_id: (skip)
- * @object: A #SensorIpmi.
- * @value: The value to set.
- *
- * Sets the <link linkend="gdbus-property-org-openbmc-SensorIpmi.entity_id">"entity_id"</link> D-Bus property to @value.
- *
- * Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side.
- */
-void
-sensor_ipmi_set_entity_id (SensorIpmi *object, guchar value)
-{
-  g_object_set (G_OBJECT (object), "entity-id", value, NULL);
-}
-
-/* ------------------------------------------------------------------------ */
-
-/**
- * SensorIpmiProxy:
- *
- * The #SensorIpmiProxy structure contains only private data and should only be accessed using the provided API.
- */
-
-/**
- * SensorIpmiProxyClass:
- * @parent_class: The parent class.
- *
- * Class structure for #SensorIpmiProxy.
- */
-
-struct _SensorIpmiProxyPrivate
-{
-  GData *qdata;
-};
-
-static void sensor_ipmi_proxy_iface_init (SensorIpmiIface *iface);
-
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-G_DEFINE_TYPE_WITH_CODE (SensorIpmiProxy, sensor_ipmi_proxy, G_TYPE_DBUS_PROXY,
-                         G_ADD_PRIVATE (SensorIpmiProxy)
-                         G_IMPLEMENT_INTERFACE (TYPE_SENSOR_IPMI, sensor_ipmi_proxy_iface_init));
-
-#else
-G_DEFINE_TYPE_WITH_CODE (SensorIpmiProxy, sensor_ipmi_proxy, G_TYPE_DBUS_PROXY,
-                         G_IMPLEMENT_INTERFACE (TYPE_SENSOR_IPMI, sensor_ipmi_proxy_iface_init));
-
-#endif
-static void
-sensor_ipmi_proxy_finalize (GObject *object)
-{
-  SensorIpmiProxy *proxy = SENSOR_IPMI_PROXY (object);
-  g_datalist_clear (&proxy->priv->qdata);
-  G_OBJECT_CLASS (sensor_ipmi_proxy_parent_class)->finalize (object);
-}
-
-static void
-sensor_ipmi_proxy_get_property (GObject      *object,
-  guint         prop_id,
-  GValue       *value,
-  GParamSpec   *pspec G_GNUC_UNUSED)
-{
-  const _ExtendedGDBusPropertyInfo *info;
-  GVariant *variant;
-  g_assert (prop_id != 0 && prop_id - 1 < 2);
-  info = _sensor_ipmi_property_info_pointers[prop_id - 1];
-  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
-  if (info->use_gvariant)
-    {
-      g_value_set_variant (value, variant);
-    }
-  else
-    {
-      if (variant != NULL)
-        g_dbus_gvariant_to_gvalue (variant, value);
-    }
-  if (variant != NULL)
-    g_variant_unref (variant);
-}
-
-static void
-sensor_ipmi_proxy_set_property_cb (GDBusProxy *proxy,
-  GAsyncResult *res,
-  gpointer      user_data)
-{
-  const _ExtendedGDBusPropertyInfo *info = user_data;
-  GError *error;
-  GVariant *_ret;
-  error = NULL;
-  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
-  if (!_ret)
-    {
-      g_warning ("Error setting property '%s' on interface org.openbmc.SensorIpmi: %s (%s, %d)",
-                 info->parent_struct.name, 
-                 error->message, g_quark_to_string (error->domain), error->code);
-      g_error_free (error);
-    }
-  else
-    {
-      g_variant_unref (_ret);
-    }
-}
-
-static void
-sensor_ipmi_proxy_set_property (GObject      *object,
-  guint         prop_id,
-  const GValue *value,
-  GParamSpec   *pspec G_GNUC_UNUSED)
-{
-  const _ExtendedGDBusPropertyInfo *info;
-  GVariant *variant;
-  g_assert (prop_id != 0 && prop_id - 1 < 2);
-  info = _sensor_ipmi_property_info_pointers[prop_id - 1];
-  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
-  g_dbus_proxy_call (G_DBUS_PROXY (object),
-    "org.freedesktop.DBus.Properties.Set",
-    g_variant_new ("(ssv)", "org.openbmc.SensorIpmi", info->parent_struct.name, variant),
-    G_DBUS_CALL_FLAGS_NONE,
-    -1,
-    NULL, (GAsyncReadyCallback) sensor_ipmi_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
-  g_variant_unref (variant);
-}
-
-static void
-sensor_ipmi_proxy_g_signal (GDBusProxy *proxy,
-  const gchar *sender_name G_GNUC_UNUSED,
-  const gchar *signal_name,
-  GVariant *parameters)
-{
-  _ExtendedGDBusSignalInfo *info;
-  GVariantIter iter;
-  GVariant *child;
-  GValue *paramv;
-  guint num_params;
-  guint n;
-  guint signal_id;
-  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct, signal_name);
-  if (info == NULL)
-    return;
-  num_params = g_variant_n_children (parameters);
-  paramv = g_new0 (GValue, num_params + 1);
-  g_value_init (&paramv[0], TYPE_SENSOR_IPMI);
-  g_value_set_object (&paramv[0], proxy);
-  g_variant_iter_init (&iter, parameters);
-  n = 1;
-  while ((child = g_variant_iter_next_value (&iter)) != NULL)
-    {
-      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
-      if (arg_info->use_gvariant)
-        {
-          g_value_init (&paramv[n], G_TYPE_VARIANT);
-          g_value_set_variant (&paramv[n], child);
-          n++;
-        }
-      else
-        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
-      g_variant_unref (child);
-    }
-  signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_IPMI);
-  g_signal_emitv (paramv, signal_id, 0, NULL);
-  for (n = 0; n < num_params + 1; n++)
-    g_value_unset (&paramv[n]);
-  g_free (paramv);
-}
-
-static void
-sensor_ipmi_proxy_g_properties_changed (GDBusProxy *_proxy,
-  GVariant *changed_properties,
-  const gchar *const *invalidated_properties)
-{
-  SensorIpmiProxy *proxy = SENSOR_IPMI_PROXY (_proxy);
-  guint n;
-  const gchar *key;
-  GVariantIter *iter;
-  _ExtendedGDBusPropertyInfo *info;
-  g_variant_get (changed_properties, "a{sv}", &iter);
-  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
-    {
-      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct, key);
-      g_datalist_remove_data (&proxy->priv->qdata, key);
-      if (info != NULL)
-        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
-    }
-  g_variant_iter_free (iter);
-  for (n = 0; invalidated_properties[n] != NULL; n++)
-    {
-      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct, invalidated_properties[n]);
-      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
-      if (info != NULL)
-        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
-    }
-}
-
-static guchar 
-sensor_ipmi_proxy_get_sensor_id (SensorIpmi *object)
-{
-  SensorIpmiProxy *proxy = SENSOR_IPMI_PROXY (object);
-  GVariant *variant;
-  guchar value = 0;
-  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "sensor_id");
-  if (variant != NULL)
-    {
-      value = g_variant_get_byte (variant);
-      g_variant_unref (variant);
-    }
-  return value;
-}
-
-static guchar 
-sensor_ipmi_proxy_get_entity_id (SensorIpmi *object)
-{
-  SensorIpmiProxy *proxy = SENSOR_IPMI_PROXY (object);
-  GVariant *variant;
-  guchar value = 0;
-  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "entity_id");
-  if (variant != NULL)
-    {
-      value = g_variant_get_byte (variant);
-      g_variant_unref (variant);
-    }
-  return value;
-}
-
-static void
-sensor_ipmi_proxy_init (SensorIpmiProxy *proxy)
-{
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-  proxy->priv = sensor_ipmi_proxy_get_instance_private (proxy);
-#else
-  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SENSOR_IPMI_PROXY, SensorIpmiProxyPrivate);
-#endif
-
-  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sensor_ipmi_interface_info ());
-}
-
-static void
-sensor_ipmi_proxy_class_init (SensorIpmiProxyClass *klass)
-{
-  GObjectClass *gobject_class;
-  GDBusProxyClass *proxy_class;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize     = sensor_ipmi_proxy_finalize;
-  gobject_class->get_property = sensor_ipmi_proxy_get_property;
-  gobject_class->set_property = sensor_ipmi_proxy_set_property;
-
-  proxy_class = G_DBUS_PROXY_CLASS (klass);
-  proxy_class->g_signal = sensor_ipmi_proxy_g_signal;
-  proxy_class->g_properties_changed = sensor_ipmi_proxy_g_properties_changed;
-
-  sensor_ipmi_override_properties (gobject_class, 1);
-
-#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
-  g_type_class_add_private (klass, sizeof (SensorIpmiProxyPrivate));
-#endif
-}
-
-static void
-sensor_ipmi_proxy_iface_init (SensorIpmiIface *iface)
-{
-  iface->get_sensor_id = sensor_ipmi_proxy_get_sensor_id;
-  iface->get_entity_id = sensor_ipmi_proxy_get_entity_id;
-}
-
-/**
- * sensor_ipmi_proxy_new:
- * @connection: A #GDBusConnection.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>. See g_dbus_proxy_new() for more details.
- *
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call sensor_ipmi_proxy_new_finish() to get the result of the operation.
- *
- * See sensor_ipmi_proxy_new_sync() for the synchronous, blocking version of this constructor.
- */
-void
-sensor_ipmi_proxy_new (
-    GDBusConnection     *connection,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GAsyncReadyCallback  callback,
-    gpointer             user_data)
-{
-  g_async_initable_new_async (TYPE_SENSOR_IPMI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIpmi", NULL);
-}
-
-/**
- * sensor_ipmi_proxy_new_finish:
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_ipmi_proxy_new().
- * @error: Return location for error or %NULL
- *
- * Finishes an operation started with sensor_ipmi_proxy_new().
- *
- * Returns: (transfer full) (type SensorIpmiProxy): The constructed proxy object or %NULL if @error is set.
- */
-SensorIpmi *
-sensor_ipmi_proxy_new_finish (
-    GAsyncResult        *res,
-    GError             **error)
-{
-  GObject *ret;
-  GObject *source_object;
-  source_object = g_async_result_get_source_object (res);
-  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
-  g_object_unref (source_object);
-  if (ret != NULL)
-    return SENSOR_IPMI (ret);
-  else
-    return NULL;
-}
-
-/**
- * sensor_ipmi_proxy_new_sync:
- * @connection: A #GDBusConnection.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL
- *
- * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>. See g_dbus_proxy_new_sync() for more details.
- *
- * The calling thread is blocked until a reply is received.
- *
- * See sensor_ipmi_proxy_new() for the asynchronous version of this constructor.
- *
- * Returns: (transfer full) (type SensorIpmiProxy): The constructed proxy object or %NULL if @error is set.
- */
-SensorIpmi *
-sensor_ipmi_proxy_new_sync (
-    GDBusConnection     *connection,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GError             **error)
-{
-  GInitable *ret;
-  ret = g_initable_new (TYPE_SENSOR_IPMI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIpmi", NULL);
-  if (ret != NULL)
-    return SENSOR_IPMI (ret);
-  else
-    return NULL;
-}
-
-
-/**
- * sensor_ipmi_proxy_new_for_bus:
- * @bus_type: A #GBusType.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: A bus name (well-known or unique).
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
- * @user_data: User data to pass to @callback.
- *
- * Like sensor_ipmi_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
- *
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call sensor_ipmi_proxy_new_for_bus_finish() to get the result of the operation.
- *
- * See sensor_ipmi_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
- */
-void
-sensor_ipmi_proxy_new_for_bus (
-    GBusType             bus_type,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GAsyncReadyCallback  callback,
-    gpointer             user_data)
-{
-  g_async_initable_new_async (TYPE_SENSOR_IPMI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIpmi", NULL);
-}
-
-/**
- * sensor_ipmi_proxy_new_for_bus_finish:
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sensor_ipmi_proxy_new_for_bus().
- * @error: Return location for error or %NULL
- *
- * Finishes an operation started with sensor_ipmi_proxy_new_for_bus().
- *
- * Returns: (transfer full) (type SensorIpmiProxy): The constructed proxy object or %NULL if @error is set.
- */
-SensorIpmi *
-sensor_ipmi_proxy_new_for_bus_finish (
-    GAsyncResult        *res,
-    GError             **error)
-{
-  GObject *ret;
-  GObject *source_object;
-  source_object = g_async_result_get_source_object (res);
-  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
-  g_object_unref (source_object);
-  if (ret != NULL)
-    return SENSOR_IPMI (ret);
-  else
-    return NULL;
-}
-
-/**
- * sensor_ipmi_proxy_new_for_bus_sync:
- * @bus_type: A #GBusType.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: A bus name (well-known or unique).
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL
- *
- * Like sensor_ipmi_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
- *
- * The calling thread is blocked until a reply is received.
- *
- * See sensor_ipmi_proxy_new_for_bus() for the asynchronous version of this constructor.
- *
- * Returns: (transfer full) (type SensorIpmiProxy): The constructed proxy object or %NULL if @error is set.
- */
-SensorIpmi *
-sensor_ipmi_proxy_new_for_bus_sync (
-    GBusType             bus_type,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GError             **error)
-{
-  GInitable *ret;
-  ret = g_initable_new (TYPE_SENSOR_IPMI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.openbmc.SensorIpmi", NULL);
-  if (ret != NULL)
-    return SENSOR_IPMI (ret);
-  else
-    return NULL;
-}
-
-
-/* ------------------------------------------------------------------------ */
-
-/**
- * SensorIpmiSkeleton:
- *
- * The #SensorIpmiSkeleton structure contains only private data and should only be accessed using the provided API.
- */
-
-/**
- * SensorIpmiSkeletonClass:
- * @parent_class: The parent class.
- *
- * Class structure for #SensorIpmiSkeleton.
- */
-
-struct _SensorIpmiSkeletonPrivate
-{
-  GValue *properties;
-  GList *changed_properties;
-  GSource *changed_properties_idle_source;
-  GMainContext *context;
-  GMutex lock;
-};
-
-static void
-_sensor_ipmi_skeleton_handle_method_call (
-  GDBusConnection *connection G_GNUC_UNUSED,
-  const gchar *sender G_GNUC_UNUSED,
-  const gchar *object_path G_GNUC_UNUSED,
-  const gchar *interface_name,
-  const gchar *method_name,
-  GVariant *parameters,
-  GDBusMethodInvocation *invocation,
-  gpointer user_data)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (user_data);
-  _ExtendedGDBusMethodInfo *info;
-  GVariantIter iter;
-  GVariant *child;
-  GValue *paramv;
-  guint num_params;
-  guint num_extra;
-  guint n;
-  guint signal_id;
-  GValue return_value = G_VALUE_INIT;
-  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
-  g_assert (info != NULL);
-  num_params = g_variant_n_children (parameters);
-  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
-  n = 0;
-  g_value_init (&paramv[n], TYPE_SENSOR_IPMI);
-  g_value_set_object (&paramv[n++], skeleton);
-  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
-  g_value_set_object (&paramv[n++], invocation);
-  if (info->pass_fdlist)
-    {
-#ifdef G_OS_UNIX
-      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
-      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
-#else
-      g_assert_not_reached ();
-#endif
-    }
-  g_variant_iter_init (&iter, parameters);
-  while ((child = g_variant_iter_next_value (&iter)) != NULL)
-    {
-      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
-      if (arg_info->use_gvariant)
-        {
-          g_value_init (&paramv[n], G_TYPE_VARIANT);
-          g_value_set_variant (&paramv[n], child);
-          n++;
-        }
-      else
-        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
-      g_variant_unref (child);
-    }
-  signal_id = g_signal_lookup (info->signal_name, TYPE_SENSOR_IPMI);
-  g_value_init (&return_value, G_TYPE_BOOLEAN);
-  g_signal_emitv (paramv, signal_id, 0, &return_value);
-  if (!g_value_get_boolean (&return_value))
-    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
-  g_value_unset (&return_value);
-  for (n = 0; n < num_params + num_extra; n++)
-    g_value_unset (&paramv[n]);
-  g_free (paramv);
-}
-
-static GVariant *
-_sensor_ipmi_skeleton_handle_get_property (
-  GDBusConnection *connection G_GNUC_UNUSED,
-  const gchar *sender G_GNUC_UNUSED,
-  const gchar *object_path G_GNUC_UNUSED,
-  const gchar *interface_name G_GNUC_UNUSED,
-  const gchar *property_name,
-  GError **error,
-  gpointer user_data)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (user_data);
-  GValue value = G_VALUE_INIT;
-  GParamSpec *pspec;
-  _ExtendedGDBusPropertyInfo *info;
-  GVariant *ret;
-  ret = NULL;
-  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct, property_name);
-  g_assert (info != NULL);
-  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
-  if (pspec == NULL)
-    {
-      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
-    }
-  else
-    {
-      g_value_init (&value, pspec->value_type);
-      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
-      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
-      g_value_unset (&value);
-    }
-  return ret;
-}
-
-static gboolean
-_sensor_ipmi_skeleton_handle_set_property (
-  GDBusConnection *connection G_GNUC_UNUSED,
-  const gchar *sender G_GNUC_UNUSED,
-  const gchar *object_path G_GNUC_UNUSED,
-  const gchar *interface_name G_GNUC_UNUSED,
-  const gchar *property_name,
-  GVariant *variant,
-  GError **error,
-  gpointer user_data)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (user_data);
-  GValue value = G_VALUE_INIT;
-  GParamSpec *pspec;
-  _ExtendedGDBusPropertyInfo *info;
-  gboolean ret;
-  ret = FALSE;
-  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sensor_ipmi_interface_info.parent_struct, property_name);
-  g_assert (info != NULL);
-  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
-  if (pspec == NULL)
-    {
-      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
-    }
-  else
-    {
-      if (info->use_gvariant)
-        g_value_set_variant (&value, variant);
-      else
-        g_dbus_gvariant_to_gvalue (variant, &value);
-      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
-      g_value_unset (&value);
-      ret = TRUE;
-    }
-  return ret;
-}
-
-static const GDBusInterfaceVTable _sensor_ipmi_skeleton_vtable =
-{
-  _sensor_ipmi_skeleton_handle_method_call,
-  _sensor_ipmi_skeleton_handle_get_property,
-  _sensor_ipmi_skeleton_handle_set_property,
-  {NULL}
-};
-
-static GDBusInterfaceInfo *
-sensor_ipmi_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
-{
-  return sensor_ipmi_interface_info ();
-}
-
-static GDBusInterfaceVTable *
-sensor_ipmi_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
-{
-  return (GDBusInterfaceVTable *) &_sensor_ipmi_skeleton_vtable;
-}
-
-static GVariant *
-sensor_ipmi_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (_skeleton);
-
-  GVariantBuilder builder;
-  guint n;
-  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
-  if (_sensor_ipmi_interface_info.parent_struct.properties == NULL)
-    goto out;
-  for (n = 0; _sensor_ipmi_interface_info.parent_struct.properties[n] != NULL; n++)
-    {
-      GDBusPropertyInfo *info = _sensor_ipmi_interface_info.parent_struct.properties[n];
-      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
-        {
-          GVariant *value;
-          value = _sensor_ipmi_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.openbmc.SensorIpmi", info->name, NULL, skeleton);
-          if (value != NULL)
-            {
-              g_variant_take_ref (value);
-              g_variant_builder_add (&builder, "{sv}", info->name, value);
-              g_variant_unref (value);
-            }
-        }
-    }
-out:
-  return g_variant_builder_end (&builder);
-}
-
-static gboolean _sensor_ipmi_emit_changed (gpointer user_data);
-
-static void
-sensor_ipmi_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (_skeleton);
-  gboolean emit_changed = FALSE;
-
-  g_mutex_lock (&skeleton->priv->lock);
-  if (skeleton->priv->changed_properties_idle_source != NULL)
-    {
-      g_source_destroy (skeleton->priv->changed_properties_idle_source);
-      skeleton->priv->changed_properties_idle_source = NULL;
-      emit_changed = TRUE;
-    }
-  g_mutex_unlock (&skeleton->priv->lock);
-
-  if (emit_changed)
-    _sensor_ipmi_emit_changed (skeleton);
-}
-
-static void sensor_ipmi_skeleton_iface_init (SensorIpmiIface *iface);
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-G_DEFINE_TYPE_WITH_CODE (SensorIpmiSkeleton, sensor_ipmi_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
-                         G_ADD_PRIVATE (SensorIpmiSkeleton)
-                         G_IMPLEMENT_INTERFACE (TYPE_SENSOR_IPMI, sensor_ipmi_skeleton_iface_init));
-
-#else
-G_DEFINE_TYPE_WITH_CODE (SensorIpmiSkeleton, sensor_ipmi_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
-                         G_IMPLEMENT_INTERFACE (TYPE_SENSOR_IPMI, sensor_ipmi_skeleton_iface_init));
-
-#endif
-static void
-sensor_ipmi_skeleton_finalize (GObject *object)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  guint n;
-  for (n = 0; n < 2; n++)
-    g_value_unset (&skeleton->priv->properties[n]);
-  g_free (skeleton->priv->properties);
-  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
-  if (skeleton->priv->changed_properties_idle_source != NULL)
-    g_source_destroy (skeleton->priv->changed_properties_idle_source);
-  g_main_context_unref (skeleton->priv->context);
-  g_mutex_clear (&skeleton->priv->lock);
-  G_OBJECT_CLASS (sensor_ipmi_skeleton_parent_class)->finalize (object);
-}
-
-static void
-sensor_ipmi_skeleton_get_property (GObject      *object,
-  guint         prop_id,
-  GValue       *value,
-  GParamSpec   *pspec G_GNUC_UNUSED)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  g_assert (prop_id != 0 && prop_id - 1 < 2);
-  g_mutex_lock (&skeleton->priv->lock);
-  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
-  g_mutex_unlock (&skeleton->priv->lock);
-}
-
-static gboolean
-_sensor_ipmi_emit_changed (gpointer user_data)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (user_data);
-  GList *l;
-  GVariantBuilder builder;
-  GVariantBuilder invalidated_builder;
-  guint num_changes;
-
-  g_mutex_lock (&skeleton->priv->lock);
-  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
-  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
-  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
-    {
-      ChangedProperty *cp = l->data;
-      GVariant *variant;
-      const GValue *cur_value;
-
-      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
-      if (!_g_value_equal (cur_value, &cp->orig_value))
-        {
-          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
-          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
-          g_variant_unref (variant);
-          num_changes++;
-        }
-    }
-  if (num_changes > 0)
-    {
-      GList *connections, *ll;
-      GVariant *signal_variant;
-      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.openbmc.SensorIpmi",
-                                           &builder, &invalidated_builder));
-      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
-      for (ll = connections; ll != NULL; ll = ll->next)
-        {
-          GDBusConnection *connection = ll->data;
-
-          g_dbus_connection_emit_signal (connection,
-                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
-                                         "org.freedesktop.DBus.Properties",
-                                         "PropertiesChanged",
-                                         signal_variant,
-                                         NULL);
-        }
-      g_variant_unref (signal_variant);
-      g_list_free_full (connections, g_object_unref);
-    }
-  else
-    {
-      g_variant_builder_clear (&builder);
-      g_variant_builder_clear (&invalidated_builder);
-    }
-  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
-  skeleton->priv->changed_properties = NULL;
-  skeleton->priv->changed_properties_idle_source = NULL;
-  g_mutex_unlock (&skeleton->priv->lock);
-  return FALSE;
-}
-
-static void
-_sensor_ipmi_schedule_emit_changed (SensorIpmiSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
-{
-  ChangedProperty *cp;
-  GList *l;
-  cp = NULL;
-  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
-    {
-      ChangedProperty *i_cp = l->data;
-      if (i_cp->info == info)
-        {
-          cp = i_cp;
-          break;
-        }
-    }
-  if (cp == NULL)
-    {
-      cp = g_new0 (ChangedProperty, 1);
-      cp->prop_id = prop_id;
-      cp->info = info;
-      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
-      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
-      g_value_copy (orig_value, &cp->orig_value);
-    }
-}
-
-static void
-sensor_ipmi_skeleton_notify (GObject      *object,
-  GParamSpec *pspec G_GNUC_UNUSED)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  g_mutex_lock (&skeleton->priv->lock);
-  if (skeleton->priv->changed_properties != NULL &&
-      skeleton->priv->changed_properties_idle_source == NULL)
-    {
-      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
-      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
-      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _sensor_ipmi_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
-      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
-      g_source_unref (skeleton->priv->changed_properties_idle_source);
-    }
-  g_mutex_unlock (&skeleton->priv->lock);
-}
-
-static void
-sensor_ipmi_skeleton_set_property (GObject      *object,
-  guint         prop_id,
-  const GValue *value,
-  GParamSpec   *pspec)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  g_assert (prop_id != 0 && prop_id - 1 < 2);
-  g_mutex_lock (&skeleton->priv->lock);
-  g_object_freeze_notify (object);
-  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
-    {
-      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
-        _sensor_ipmi_schedule_emit_changed (skeleton, _sensor_ipmi_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
-      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
-      g_object_notify_by_pspec (object, pspec);
-    }
-  g_mutex_unlock (&skeleton->priv->lock);
-  g_object_thaw_notify (object);
-}
-
-static void
-sensor_ipmi_skeleton_init (SensorIpmiSkeleton *skeleton)
-{
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-  skeleton->priv = sensor_ipmi_skeleton_get_instance_private (skeleton);
-#else
-  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SENSOR_IPMI_SKELETON, SensorIpmiSkeletonPrivate);
-#endif
-
-  g_mutex_init (&skeleton->priv->lock);
-  skeleton->priv->context = g_main_context_ref_thread_default ();
-  skeleton->priv->properties = g_new0 (GValue, 2);
-  g_value_init (&skeleton->priv->properties[0], G_TYPE_UCHAR);
-  g_value_init (&skeleton->priv->properties[1], G_TYPE_UCHAR);
-}
-
-static guchar 
-sensor_ipmi_skeleton_get_sensor_id (SensorIpmi *object)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  guchar value;
-  g_mutex_lock (&skeleton->priv->lock);
-  value = g_value_get_uchar (&(skeleton->priv->properties[0]));
-  g_mutex_unlock (&skeleton->priv->lock);
-  return value;
-}
-
-static guchar 
-sensor_ipmi_skeleton_get_entity_id (SensorIpmi *object)
-{
-  SensorIpmiSkeleton *skeleton = SENSOR_IPMI_SKELETON (object);
-  guchar value;
-  g_mutex_lock (&skeleton->priv->lock);
-  value = g_value_get_uchar (&(skeleton->priv->properties[1]));
-  g_mutex_unlock (&skeleton->priv->lock);
-  return value;
-}
-
-static void
-sensor_ipmi_skeleton_class_init (SensorIpmiSkeletonClass *klass)
-{
-  GObjectClass *gobject_class;
-  GDBusInterfaceSkeletonClass *skeleton_class;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = sensor_ipmi_skeleton_finalize;
-  gobject_class->get_property = sensor_ipmi_skeleton_get_property;
-  gobject_class->set_property = sensor_ipmi_skeleton_set_property;
-  gobject_class->notify       = sensor_ipmi_skeleton_notify;
-
-
-  sensor_ipmi_override_properties (gobject_class, 1);
-
-  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
-  skeleton_class->get_info = sensor_ipmi_skeleton_dbus_interface_get_info;
-  skeleton_class->get_properties = sensor_ipmi_skeleton_dbus_interface_get_properties;
-  skeleton_class->flush = sensor_ipmi_skeleton_dbus_interface_flush;
-  skeleton_class->get_vtable = sensor_ipmi_skeleton_dbus_interface_get_vtable;
-
-#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
-  g_type_class_add_private (klass, sizeof (SensorIpmiSkeletonPrivate));
-#endif
-}
-
-static void
-sensor_ipmi_skeleton_iface_init (SensorIpmiIface *iface)
-{
-  iface->get_sensor_id = sensor_ipmi_skeleton_get_sensor_id;
-  iface->get_entity_id = sensor_ipmi_skeleton_get_entity_id;
-}
-
-/**
- * sensor_ipmi_skeleton_new:
- *
- * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>.
- *
- * Returns: (transfer full) (type SensorIpmiSkeleton): The skeleton object.
- */
-SensorIpmi *
-sensor_ipmi_skeleton_new (void)
-{
-  return SENSOR_IPMI (g_object_new (TYPE_SENSOR_IPMI_SKELETON, NULL));
-}
-
-/* ------------------------------------------------------------------------
  * Code for interface org.openbmc.SensorThreshold
  * ------------------------------------------------------------------------
  */
@@ -24442,15 +23509,6 @@
   g_object_interface_install_property (iface, g_param_spec_object ("sensor-value", "sensor-value", "sensor-value", TYPE_SENSOR_VALUE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
 
   /**
-   * Object:sensor-ipmi:
-   *
-   * The #SensorIpmi instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link>, if any.
-   *
-   * Connect to the #GObject::notify signal to get informed of property changes.
-   */
-  g_object_interface_install_property (iface, g_param_spec_object ("sensor-ipmi", "sensor-ipmi", "sensor-ipmi", TYPE_SENSOR_IPMI, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
-
-  /**
    * Object:sensor-threshold:
    *
    * The #SensorThreshold instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorThreshold.top_of_page">org.openbmc.SensorThreshold</link>, if any.
@@ -24621,23 +23679,6 @@
 }
 
 /**
- * object_get_sensor_ipmi:
- * @object: A #Object.
- *
- * Gets the #SensorIpmi instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link> on @object, if any.
- *
- * Returns: (transfer full): A #SensorIpmi that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
- */
-SensorIpmi *object_get_sensor_ipmi (Object *object)
-{
-  GDBusInterface *ret;
-  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIpmi");
-  if (ret == NULL)
-    return NULL;
-  return SENSOR_IPMI (ret);
-}
-
-/**
  * object_get_sensor_threshold:
  * @object: A #Object.
  *
@@ -24920,26 +23961,6 @@
 }
 
 /**
- * object_peek_sensor_ipmi: (skip)
- * @object: A #Object.
- *
- * Like object_get_sensor_ipmi() but doesn't increase the reference count on the returned object.
- *
- * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
- *
- * Returns: (transfer none): A #SensorIpmi or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
- */
-SensorIpmi *object_peek_sensor_ipmi (Object *object)
-{
-  GDBusInterface *ret;
-  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIpmi");
-  if (ret == NULL)
-    return NULL;
-  g_object_unref (ret);
-  return SENSOR_IPMI (ret);
-}
-
-/**
  * object_peek_sensor_threshold: (skip)
  * @object: A #Object.
  *
@@ -25282,71 +24303,66 @@
       break;
 
     case 4:
-      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIpmi");
-      g_value_take_object (value, interface);
-      break;
-
-    case 5:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorThreshold");
       g_value_take_object (value, interface);
       break;
 
-    case 6:
+    case 5:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorI2c");
       g_value_take_object (value, interface);
       break;
 
-    case 7:
+    case 6:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorMatch");
       g_value_take_object (value, interface);
       break;
 
-    case 8:
+    case 7:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Process");
       g_value_take_object (value, interface);
       break;
 
-    case 9:
+    case 8:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Control");
       g_value_take_object (value, interface);
       break;
 
-    case 10:
+    case 9:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Bmc");
       g_value_take_object (value, interface);
       break;
 
-    case 11:
+    case 10:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Host");
       g_value_take_object (value, interface);
       break;
 
-    case 12:
+    case 11:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Power");
       g_value_take_object (value, interface);
       break;
 
-    case 13:
+    case 12:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Watchdog");
       g_value_take_object (value, interface);
       break;
 
-    case 14:
+    case 13:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
       g_value_take_object (value, interface);
       break;
 
-    case 15:
+    case 14:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
       g_value_take_object (value, interface);
       break;
 
-    case 16:
+    case 15:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
       g_value_take_object (value, interface);
       break;
 
-    case 17:
+    case 16:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
       g_value_take_object (value, interface);
       break;
@@ -25368,20 +24384,19 @@
   g_object_class_override_property (gobject_class, 1, "occ");
   g_object_class_override_property (gobject_class, 2, "fan");
   g_object_class_override_property (gobject_class, 3, "sensor-value");
-  g_object_class_override_property (gobject_class, 4, "sensor-ipmi");
-  g_object_class_override_property (gobject_class, 5, "sensor-threshold");
-  g_object_class_override_property (gobject_class, 6, "sensor-i2c");
-  g_object_class_override_property (gobject_class, 7, "sensor-match");
-  g_object_class_override_property (gobject_class, 8, "process");
-  g_object_class_override_property (gobject_class, 9, "control");
-  g_object_class_override_property (gobject_class, 10, "control-bmc");
-  g_object_class_override_property (gobject_class, 11, "control-host");
-  g_object_class_override_property (gobject_class, 12, "control-power");
-  g_object_class_override_property (gobject_class, 13, "watchdog");
-  g_object_class_override_property (gobject_class, 14, "event-log");
-  g_object_class_override_property (gobject_class, 15, "flash");
-  g_object_class_override_property (gobject_class, 16, "button");
-  g_object_class_override_property (gobject_class, 17, "led");
+  g_object_class_override_property (gobject_class, 4, "sensor-threshold");
+  g_object_class_override_property (gobject_class, 5, "sensor-i2c");
+  g_object_class_override_property (gobject_class, 6, "sensor-match");
+  g_object_class_override_property (gobject_class, 7, "process");
+  g_object_class_override_property (gobject_class, 8, "control");
+  g_object_class_override_property (gobject_class, 9, "control-bmc");
+  g_object_class_override_property (gobject_class, 10, "control-host");
+  g_object_class_override_property (gobject_class, 11, "control-power");
+  g_object_class_override_property (gobject_class, 12, "watchdog");
+  g_object_class_override_property (gobject_class, 13, "event-log");
+  g_object_class_override_property (gobject_class, 14, "flash");
+  g_object_class_override_property (gobject_class, 15, "button");
+  g_object_class_override_property (gobject_class, 16, "led");
 }
 
 /**
@@ -25491,19 +24506,6 @@
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
-          g_warn_if_fail (IS_SENSOR_IPMI (interface));
-          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
-        }
-      else
-        {
-          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.openbmc.SensorIpmi");
-        }
-      break;
-
-    case 5:
-      interface = g_value_get_object (value);
-      if (interface != NULL)
-        {
           g_warn_if_fail (IS_SENSOR_THRESHOLD (interface));
           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
         }
@@ -25513,7 +24515,7 @@
         }
       break;
 
-    case 6:
+    case 5:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25526,7 +24528,7 @@
         }
       break;
 
-    case 7:
+    case 6:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25539,7 +24541,7 @@
         }
       break;
 
-    case 8:
+    case 7:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25552,7 +24554,7 @@
         }
       break;
 
-    case 9:
+    case 8:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25565,7 +24567,7 @@
         }
       break;
 
-    case 10:
+    case 9:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25578,7 +24580,7 @@
         }
       break;
 
-    case 11:
+    case 10:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25591,7 +24593,7 @@
         }
       break;
 
-    case 12:
+    case 11:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25604,7 +24606,7 @@
         }
       break;
 
-    case 13:
+    case 12:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25617,7 +24619,7 @@
         }
       break;
 
-    case 14:
+    case 13:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25630,7 +24632,7 @@
         }
       break;
 
-    case 15:
+    case 14:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25643,7 +24645,7 @@
         }
       break;
 
-    case 16:
+    case 15:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25656,7 +24658,7 @@
         }
       break;
 
-    case 17:
+    case 16:
       interface = g_value_get_object (value);
       if (interface != NULL)
         {
@@ -25702,71 +24704,66 @@
       break;
 
     case 4:
-      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorIpmi");
-      g_value_take_object (value, interface);
-      break;
-
-    case 5:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorThreshold");
       g_value_take_object (value, interface);
       break;
 
-    case 6:
+    case 5:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorI2c");
       g_value_take_object (value, interface);
       break;
 
-    case 7:
+    case 6:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.SensorMatch");
       g_value_take_object (value, interface);
       break;
 
-    case 8:
+    case 7:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Process");
       g_value_take_object (value, interface);
       break;
 
-    case 9:
+    case 8:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Control");
       g_value_take_object (value, interface);
       break;
 
-    case 10:
+    case 9:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Bmc");
       g_value_take_object (value, interface);
       break;
 
-    case 11:
+    case 10:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Host");
       g_value_take_object (value, interface);
       break;
 
-    case 12:
+    case 11:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.control.Power");
       g_value_take_object (value, interface);
       break;
 
-    case 13:
+    case 12:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Watchdog");
       g_value_take_object (value, interface);
       break;
 
-    case 14:
+    case 13:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.EventLog");
       g_value_take_object (value, interface);
       break;
 
-    case 15:
+    case 14:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Flash");
       g_value_take_object (value, interface);
       break;
 
-    case 16:
+    case 15:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Button");
       g_value_take_object (value, interface);
       break;
 
-    case 17:
+    case 16:
       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.openbmc.Led");
       g_value_take_object (value, interface);
       break;
@@ -25788,20 +24785,19 @@
   g_object_class_override_property (gobject_class, 1, "occ");
   g_object_class_override_property (gobject_class, 2, "fan");
   g_object_class_override_property (gobject_class, 3, "sensor-value");
-  g_object_class_override_property (gobject_class, 4, "sensor-ipmi");
-  g_object_class_override_property (gobject_class, 5, "sensor-threshold");
-  g_object_class_override_property (gobject_class, 6, "sensor-i2c");
-  g_object_class_override_property (gobject_class, 7, "sensor-match");
-  g_object_class_override_property (gobject_class, 8, "process");
-  g_object_class_override_property (gobject_class, 9, "control");
-  g_object_class_override_property (gobject_class, 10, "control-bmc");
-  g_object_class_override_property (gobject_class, 11, "control-host");
-  g_object_class_override_property (gobject_class, 12, "control-power");
-  g_object_class_override_property (gobject_class, 13, "watchdog");
-  g_object_class_override_property (gobject_class, 14, "event-log");
-  g_object_class_override_property (gobject_class, 15, "flash");
-  g_object_class_override_property (gobject_class, 16, "button");
-  g_object_class_override_property (gobject_class, 17, "led");
+  g_object_class_override_property (gobject_class, 4, "sensor-threshold");
+  g_object_class_override_property (gobject_class, 5, "sensor-i2c");
+  g_object_class_override_property (gobject_class, 6, "sensor-match");
+  g_object_class_override_property (gobject_class, 7, "process");
+  g_object_class_override_property (gobject_class, 8, "control");
+  g_object_class_override_property (gobject_class, 9, "control-bmc");
+  g_object_class_override_property (gobject_class, 10, "control-host");
+  g_object_class_override_property (gobject_class, 11, "control-power");
+  g_object_class_override_property (gobject_class, 12, "watchdog");
+  g_object_class_override_property (gobject_class, 13, "event-log");
+  g_object_class_override_property (gobject_class, 14, "flash");
+  g_object_class_override_property (gobject_class, 15, "button");
+  g_object_class_override_property (gobject_class, 16, "led");
 }
 
 /**
@@ -25856,18 +24852,6 @@
 }
 
 /**
- * object_skeleton_set_sensor_ipmi:
- * @object: A #ObjectSkeleton.
- * @interface_: (allow-none): A #SensorIpmi or %NULL to clear the interface.
- *
- * Sets the #SensorIpmi instance for the D-Bus interface <link linkend="gdbus-interface-org-openbmc-SensorIpmi.top_of_page">org.openbmc.SensorIpmi</link> on @object.
- */
-void object_skeleton_set_sensor_ipmi (ObjectSkeleton *object, SensorIpmi *interface_)
-{
-  g_object_set (G_OBJECT (object), "sensor-ipmi", interface_, NULL);
-}
-
-/**
  * object_skeleton_set_sensor_threshold:
  * @object: A #ObjectSkeleton.
  * @interface_: (allow-none): A #SensorThreshold or %NULL to clear the interface.
@@ -26088,7 +25072,6 @@
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.Occ", GSIZE_TO_POINTER (TYPE_OCC_PROXY));
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.Fan", GSIZE_TO_POINTER (TYPE_FAN_PROXY));
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorValue", GSIZE_TO_POINTER (TYPE_SENSOR_VALUE_PROXY));
-      g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorIpmi", GSIZE_TO_POINTER (TYPE_SENSOR_IPMI_PROXY));
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorThreshold", GSIZE_TO_POINTER (TYPE_SENSOR_THRESHOLD_PROXY));
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorI2c", GSIZE_TO_POINTER (TYPE_SENSOR_I2C_PROXY));
       g_hash_table_insert (lookup_hash, (gpointer) "org.openbmc.SensorMatch", GSIZE_TO_POINTER (TYPE_SENSOR_MATCH_PROXY));
diff --git a/interfaces/openbmc_intf.h b/interfaces/openbmc_intf.h
index af4d22e..3ba6a29 100644
--- a/interfaces/openbmc_intf.h
+++ b/interfaces/openbmc_intf.h
@@ -475,6 +475,11 @@
     SensorValue *object,
     GDBusMethodInvocation *invocation);
 
+  gboolean (*handle_set_value) (
+    SensorValue *object,
+    GDBusMethodInvocation *invocation,
+    GVariant *arg_value);
+
   gint  (*get_heatbeat) (SensorValue *object);
 
   gint  (*get_poll_interval) (SensorValue *object);
@@ -515,6 +520,10 @@
     GDBusMethodInvocation *invocation,
     GVariant *value);
 
+void sensor_value_complete_set_value (
+    SensorValue *object,
+    GDBusMethodInvocation *invocation);
+
 
 
 /* D-Bus signal emissions functions: */
@@ -567,6 +576,24 @@
     GCancellable *cancellable,
     GError **error);
 
+void sensor_value_call_set_value (
+    SensorValue *proxy,
+    GVariant *arg_value,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data);
+
+gboolean sensor_value_call_set_value_finish (
+    SensorValue *proxy,
+    GAsyncResult *res,
+    GError **error);
+
+gboolean sensor_value_call_set_value_sync (
+    SensorValue *proxy,
+    GVariant *arg_value,
+    GCancellable *cancellable,
+    GError **error);
+
 
 
 /* D-Bus property accessors: */
@@ -685,138 +712,6 @@
 
 
 /* ------------------------------------------------------------------------ */
-/* Declarations for org.openbmc.SensorIpmi */
-
-#define TYPE_SENSOR_IPMI (sensor_ipmi_get_type ())
-#define SENSOR_IPMI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_IPMI, SensorIpmi))
-#define IS_SENSOR_IPMI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_IPMI))
-#define SENSOR_IPMI_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SENSOR_IPMI, SensorIpmiIface))
-
-struct _SensorIpmi;
-typedef struct _SensorIpmi SensorIpmi;
-typedef struct _SensorIpmiIface SensorIpmiIface;
-
-struct _SensorIpmiIface
-{
-  GTypeInterface parent_iface;
-
-  guchar  (*get_entity_id) (SensorIpmi *object);
-
-  guchar  (*get_sensor_id) (SensorIpmi *object);
-
-};
-
-GType sensor_ipmi_get_type (void) G_GNUC_CONST;
-
-GDBusInterfaceInfo *sensor_ipmi_interface_info (void);
-guint sensor_ipmi_override_properties (GObjectClass *klass, guint property_id_begin);
-
-
-/* D-Bus property accessors: */
-guchar sensor_ipmi_get_sensor_id (SensorIpmi *object);
-void sensor_ipmi_set_sensor_id (SensorIpmi *object, guchar value);
-
-guchar sensor_ipmi_get_entity_id (SensorIpmi *object);
-void sensor_ipmi_set_entity_id (SensorIpmi *object, guchar value);
-
-
-/* ---- */
-
-#define TYPE_SENSOR_IPMI_PROXY (sensor_ipmi_proxy_get_type ())
-#define SENSOR_IPMI_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_IPMI_PROXY, SensorIpmiProxy))
-#define SENSOR_IPMI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_IPMI_PROXY, SensorIpmiProxyClass))
-#define SENSOR_IPMI_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_IPMI_PROXY, SensorIpmiProxyClass))
-#define IS_SENSOR_IPMI_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_IPMI_PROXY))
-#define IS_SENSOR_IPMI_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_IPMI_PROXY))
-
-typedef struct _SensorIpmiProxy SensorIpmiProxy;
-typedef struct _SensorIpmiProxyClass SensorIpmiProxyClass;
-typedef struct _SensorIpmiProxyPrivate SensorIpmiProxyPrivate;
-
-struct _SensorIpmiProxy
-{
-  /*< private >*/
-  GDBusProxy parent_instance;
-  SensorIpmiProxyPrivate *priv;
-};
-
-struct _SensorIpmiProxyClass
-{
-  GDBusProxyClass parent_class;
-};
-
-GType sensor_ipmi_proxy_get_type (void) G_GNUC_CONST;
-
-void sensor_ipmi_proxy_new (
-    GDBusConnection     *connection,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GAsyncReadyCallback  callback,
-    gpointer             user_data);
-SensorIpmi *sensor_ipmi_proxy_new_finish (
-    GAsyncResult        *res,
-    GError             **error);
-SensorIpmi *sensor_ipmi_proxy_new_sync (
-    GDBusConnection     *connection,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GError             **error);
-
-void sensor_ipmi_proxy_new_for_bus (
-    GBusType             bus_type,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GAsyncReadyCallback  callback,
-    gpointer             user_data);
-SensorIpmi *sensor_ipmi_proxy_new_for_bus_finish (
-    GAsyncResult        *res,
-    GError             **error);
-SensorIpmi *sensor_ipmi_proxy_new_for_bus_sync (
-    GBusType             bus_type,
-    GDBusProxyFlags      flags,
-    const gchar         *name,
-    const gchar         *object_path,
-    GCancellable        *cancellable,
-    GError             **error);
-
-
-/* ---- */
-
-#define TYPE_SENSOR_IPMI_SKELETON (sensor_ipmi_skeleton_get_type ())
-#define SENSOR_IPMI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SENSOR_IPMI_SKELETON, SensorIpmiSkeleton))
-#define SENSOR_IPMI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SENSOR_IPMI_SKELETON, SensorIpmiSkeletonClass))
-#define SENSOR_IPMI_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SENSOR_IPMI_SKELETON, SensorIpmiSkeletonClass))
-#define IS_SENSOR_IPMI_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SENSOR_IPMI_SKELETON))
-#define IS_SENSOR_IPMI_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SENSOR_IPMI_SKELETON))
-
-typedef struct _SensorIpmiSkeleton SensorIpmiSkeleton;
-typedef struct _SensorIpmiSkeletonClass SensorIpmiSkeletonClass;
-typedef struct _SensorIpmiSkeletonPrivate SensorIpmiSkeletonPrivate;
-
-struct _SensorIpmiSkeleton
-{
-  /*< private >*/
-  GDBusInterfaceSkeleton parent_instance;
-  SensorIpmiSkeletonPrivate *priv;
-};
-
-struct _SensorIpmiSkeletonClass
-{
-  GDBusInterfaceSkeletonClass parent_class;
-};
-
-GType sensor_ipmi_skeleton_get_type (void) G_GNUC_CONST;
-
-SensorIpmi *sensor_ipmi_skeleton_new (void);
-
-
-/* ------------------------------------------------------------------------ */
 /* Declarations for org.openbmc.SensorThreshold */
 
 #define TYPE_SENSOR_THRESHOLD (sensor_threshold_get_type ())
@@ -3323,7 +3218,6 @@
 Occ *object_get_occ (Object *object);
 Fan *object_get_fan (Object *object);
 SensorValue *object_get_sensor_value (Object *object);
-SensorIpmi *object_get_sensor_ipmi (Object *object);
 SensorThreshold *object_get_sensor_threshold (Object *object);
 SensorI2c *object_get_sensor_i2c (Object *object);
 SensorMatch *object_get_sensor_match (Object *object);
@@ -3340,7 +3234,6 @@
 Occ *object_peek_occ (Object *object);
 Fan *object_peek_fan (Object *object);
 SensorValue *object_peek_sensor_value (Object *object);
-SensorIpmi *object_peek_sensor_ipmi (Object *object);
 SensorThreshold *object_peek_sensor_threshold (Object *object);
 SensorI2c *object_peek_sensor_i2c (Object *object);
 SensorMatch *object_peek_sensor_match (Object *object);
@@ -3409,7 +3302,6 @@
 void object_skeleton_set_occ (ObjectSkeleton *object, Occ *interface_);
 void object_skeleton_set_fan (ObjectSkeleton *object, Fan *interface_);
 void object_skeleton_set_sensor_value (ObjectSkeleton *object, SensorValue *interface_);
-void object_skeleton_set_sensor_ipmi (ObjectSkeleton *object, SensorIpmi *interface_);
 void object_skeleton_set_sensor_threshold (ObjectSkeleton *object, SensorThreshold *interface_);
 void object_skeleton_set_sensor_i2c (ObjectSkeleton *object, SensorI2c *interface_);
 void object_skeleton_set_sensor_match (ObjectSkeleton *object, SensorMatch *interface_);
diff --git a/objects/button_power_obj.c b/objects/button_power_obj.c
index 4cd9b8d..33cd466 100644
--- a/objects/button_power_obj.c
+++ b/objects/button_power_obj.c
@@ -8,6 +8,9 @@
 
 static GDBusObjectManagerServer *manager = NULL;
 
+//This object will use these GPIOs
+GPIO button    = (GPIO){ "POWER_BUTTON" };
+
 static gboolean
 on_is_on       (Button          *btn,
                 GDBusMethodInvocation  *invocation,
@@ -20,15 +23,13 @@
 }
 
 static gboolean
-on_sim_button_press       (Button          *btn,
+on_button_press       (Button          *btn,
                 GDBusMethodInvocation  *invocation,
                 gpointer                user_data)
 {
-  g_print("Simulating button pressed\n");
-  button_emit_button_pressed(btn);
-  button_complete_sim_button_press(btn,invocation);
-  return TRUE;
-
+	button_emit_button_pressed(btn);
+	button_complete_sim_button_press(btn,invocation);
+	return TRUE;
 }
 
 static void 
@@ -64,9 +65,11 @@
                     NULL); /* user_data */
 		g_signal_connect (button,
                     "handle-sim-button-press",
-                    G_CALLBACK (on_sim_button_press),
+                    G_CALLBACK (on_button_press),
                     NULL); /* user_data */
 
+		
+
 		/* Export the object (@manager takes its own reference to @object) */
 		g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
 		g_object_unref (object);
diff --git a/objects/chassis_identify_obj.c b/objects/chassis_identify_obj.c
index a747d36..4a66515 100644
--- a/objects/chassis_identify_obj.c
+++ b/objects/chassis_identify_obj.c
@@ -17,9 +17,18 @@
 {
 	g_print("Turn on chassis identify led\n");
 	led_complete_set_on(led,invocation);
-	gpio_open(&led_gpio);
-	gpio_write(&led_gpio,1); 
+	int rc = GPIO_OK;
+	do {
+		rc = gpio_open(&led_gpio);
+		if (rc != GPIO_OK) { break; }
+		rc = gpio_write(&led_gpio,1); 
+		if (rc != GPIO_OK) { break; }
+	} while(0);
 	gpio_close(&led_gpio);
+	if (rc != GPIO_OK)
+	{
+		g_print("GPIO Error: %d\n",rc);
+	}
 
 	return TRUE;
 
@@ -32,10 +41,18 @@
 {
 	g_print("Turn off chassis identify led\n");
 	led_complete_set_off(led,invocation);
-	gpio_open(&led_gpio);
-	gpio_write(&led_gpio,0); 
+	int rc = GPIO_OK;
+	do {
+		rc = gpio_open(&led_gpio);
+		if (rc != GPIO_OK) { break; }
+		rc = gpio_write(&led_gpio,0); 
+		if (rc != GPIO_OK) { break; }
+	} while(0);
 	gpio_close(&led_gpio);
-
+	if (rc != GPIO_OK)
+	{
+		g_print("GPIO Error: %d\n",rc);
+	}
 	return TRUE;
 }
 
@@ -46,7 +63,6 @@
 {
 	ObjectSkeleton *object;
 
-	//g_print ("Acquired a message bus connection: %s\n",name);
 	cmdline *cmd = user_data;
 	if (cmd->argc < 2)
 	{
@@ -95,7 +111,6 @@
                   const gchar     *name,
                   gpointer         user_data)
 {
-  //g_print ("Acquired the name %s\n", name);
 }
 
 static void
@@ -103,7 +118,6 @@
               const gchar     *name,
               gpointer         user_data)
 {
- // g_print ("Lost the name %s\n", name);
 }
 
 
diff --git a/objects/pcie_slot_present_obj.c b/objects/pcie_slot_present_obj.c
new file mode 100644
index 0000000..8105f6f
--- /dev/null
+++ b/objects/pcie_slot_present_obj.c
@@ -0,0 +1,168 @@
+#include "interfaces/openbmc_intf.h"
+#include "openbmc.h"
+#include "gpio.h"
+#define NUM_SLOTS 8
+GPIO slots[NUM_SLOTS] = {
+	{ "SLOT0_RISER_PRESENT" },
+	{ "SLOT1_RISER_PRESENT" },
+	{ "SLOT2_RISER_PRESENT" },
+	{ "SLOT0_PRESENT" },
+	{ "SLOT1_PRESENT" },
+	{ "SLOT2_PRESENT" },
+	{ "MEZZ0_PRESENT" },
+	{ "MEZZ1_PRESENT" },
+};
+
+typedef struct {
+	const char* bus_name;
+	const char* path;
+} object_info;
+	
+
+
+/* ---------------------------------------------------------------------------------------------------- */
+int get_object(GDBusProxy *proxy, GPIO* gpio, object_info* obj_info)
+{
+	g_print("Here: %s\n",gpio->name);
+ 	GError *error;
+	GVariant *parm;
+	GVariant *result;
+
+	error = NULL;
+	parm = g_variant_new("(ss)","GPIO_PRESENT",gpio->name);
+	result = g_dbus_proxy_call_sync (proxy,
+                                   "getObjectFromId",
+				   parm,
+                                   G_DBUS_CALL_FLAGS_NONE,
+                                   -1,
+                                   NULL,
+                                   &error);
+	g_assert_no_error (error);
+	const gchar* bus_name;
+	const gchar* obj_path;
+	gsize bus_name_size;
+	gsize obj_path_size;
+	GVariantIter *iter = g_variant_iter_new(result);
+	GVariant* dict = g_variant_iter_next_value(iter);
+
+	GVariant* b = g_variant_lookup_value(dict,"bus_name",(const GVariantType *) "s");
+	bus_name = g_variant_get_string(b,&bus_name_size);
+	GVariant* o = g_variant_lookup_value(dict,"obj_path",(const GVariantType *) "s");
+	obj_path = g_variant_get_string(o,&obj_path_size);
+
+	int rc = 0;
+	if (bus_name_size ==  0 || obj_path_size == 0) {
+		g_print("ERROR: gpio %s not found in lookup\n",gpio->name);
+		rc = 1;
+
+	} else {
+		obj_info->bus_name = bus_name;
+		obj_info->path = obj_path;
+	}
+	g_variant_unref(b);
+	g_variant_unref(o);
+	g_variant_unref(dict);
+	g_variant_unref(result);
+
+	return rc;
+}
+
+int get_presence(GDBusConnection* connection, GPIO* gpio, uint8_t* present)
+{
+	int rc = GPIO_OK;
+	do {
+		rc = gpio_init(connection,gpio);
+		if (rc != GPIO_OK) { break; }
+		uint8_t gpio_val;
+		rc = gpio_open(gpio);
+		if (rc != GPIO_OK) { break; }
+		rc = gpio_read(gpio,&gpio_val);
+		if (rc != GPIO_OK) { gpio_close(gpio); break; }
+		gpio_close(gpio);
+		*present = gpio_val;	
+	} while(0);
+	if (rc != GPIO_OK)
+	{
+		g_print("ERROR: gpio error %s\n",gpio->name);
+	}
+	return rc; 
+}
+
+void update_fru_obj(GDBusConnection* connection, object_info* obj_info, uint8_t state)
+{
+	GDBusProxy *proxy;
+ 	GError *error;
+	GVariant *parm;
+	GVariant *result;
+
+	error = NULL;
+	proxy = g_dbus_proxy_new_sync (connection,
+                             G_DBUS_PROXY_FLAGS_NONE,
+                             NULL,                      /* GDBusInterfaceInfo* */
+                             obj_info->bus_name, /* name */
+                             obj_info->path, /* object path */
+                             "org.openbmc.SensorValue",        /* interface name */
+                             NULL,                      /* GCancellable */
+                             &error);
+	g_assert_no_error (error);
+
+	error = NULL;
+	parm = g_variant_new("(y)",state);
+	
+	result = g_dbus_proxy_call_sync (proxy,
+                                   "setValue",
+				   parm,
+                                   G_DBUS_CALL_FLAGS_NONE,
+                                   -1,
+                                   NULL,
+                                   &error);
+
+	g_assert_no_error (error);
+}
+
+gint
+main (gint argc, gchar *argv[])
+{
+	GMainLoop *loop;
+	GDBusConnection *c;
+	GDBusProxy *sys_proxy;
+ 	GError *error;
+	GVariant *parm;
+	GVariant *result;
+
+	loop = g_main_loop_new (NULL, FALSE);
+
+	error = NULL;
+	c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
+
+	error = NULL;
+	sys_proxy = g_dbus_proxy_new_sync (c,
+                             G_DBUS_PROXY_FLAGS_NONE,
+                             NULL,                      /* GDBusInterfaceInfo* */
+                             "org.openbmc.managers.System", /* name */
+                             "/org/openbmc/managers/System", /* object path */
+                             "org.openbmc.managers.System",        /* interface name */
+                             NULL,                      /* GCancellable */
+                             &error);
+	g_assert_no_error (error);
+
+	int i = 0;
+	int rc = 0;	
+	for (i=0;i<NUM_SLOTS;i++)
+	{
+		object_info obj_info;
+		uint8_t present;
+		do {
+			rc = get_object(sys_proxy,&slots[i],&obj_info);
+			if (rc) { break; }
+			rc = get_presence(c,&slots[i],&present);
+			if (rc) { break; }
+			// TODO: send correct state
+			update_fru_obj(c,&obj_info,present);
+		} while(0);
+	}
+
+	g_object_unref(c);
+ 	g_main_loop_unref (loop);
+ 	return 0;
+}
diff --git a/objects/power_control_obj.c b/objects/power_control_obj.c
index bb0eaec..481c0d7 100644
--- a/objects/power_control_obj.c
+++ b/objects/power_control_obj.c
@@ -76,10 +76,8 @@
 		}
 	} else {
 		event_log_emit_event_log(event_log, LOG_ALERT, "GPIO read error",rc);
-		//return FALSE;
 	}
 	//pgood is not at desired state yet
-	//g_print("GPIO: %d;  %d\n",gpio,control_power_get_state(control_power));
 	if (gpio != control_power_get_state(control_power) &&
 		control_power_get_pgood_timeout(control_power) > 0)
 	{
@@ -120,22 +118,19 @@
 	}
 	else
 	{
-		g_print("Set power state: %d\n",state);
-		//temporary until real hardware works
-		//tmp_pgood = state;
 		int error = 0;
 		do {
+			if (state == 1) {
+				control_emit_goto_system_state(control,"POWERING_ON");
+			} else {
+				control_emit_goto_system_state(control,"POWERING_OFF");
+			}
 			error = gpio_open(&power_pin);
 			if (error != GPIO_OK) { break;	}
 			error = gpio_write(&power_pin,!state);
 			if (error != GPIO_OK) { break;	}
 			gpio_close(&power_pin);
 			control_power_set_state(pwr,state);
-			if (state == 1) {
-				control_emit_goto_system_state(control,"POWERING_ON");
-			} else {
-				control_emit_goto_system_state(control,"POWERING_OFF");
-			}
 		} while(0);
 		if (error != GPIO_OK)
 		{
diff --git a/objects/sensor_host_status_obj.c b/objects/sensor_host_status_obj.c
index 05e02b2..825117a 100644
--- a/objects/sensor_host_status_obj.c
+++ b/objects/sensor_host_status_obj.c
@@ -27,41 +27,31 @@
 	control_complete_init(control,invocation);
 	return TRUE;
 }
-
-static void
-on_set_ipmi (GDBusConnection* connection,
-               const gchar* sender_name,
-               const gchar* object_path,
-               const gchar* interface_name,
-               const gchar* signal_name,
-               GVariant* parameters,
-               gpointer user_data) 
+static gboolean
+on_set_value    (SensorValue *sen,
+                GDBusMethodInvocation  *invocation,
+		guchar                  host_status,
+                gpointer                user_data)
 {
+	SensorValue *v = object_get_sensor_value((Object*)user_data);
 	SensorMatch *match = object_get_sensor_match((Object*)user_data);
-	SensorValue *sen = object_get_sensor_value((Object*)user_data);
-	SensorIpmi *ipmi = object_get_sensor_ipmi((Object*)user_data);
 	Control* control = object_get_control((Object*)user_data);
 	
-	guchar sensor_id;
-	guchar host_status;
-	g_variant_get (parameters, "(yy)", &sensor_id,&host_status);
-	guchar my_sensor_id = sensor_ipmi_get_sensor_id(ipmi);
-	if (my_sensor_id == sensor_id)
+	GVariant *old_value = sensor_value_get_value(sen);
+	GVariant *value = NEW_VARIANT_B(host_status);
+	if (VARIANT_COMPARE(old_value,value) != 0)
 	{
-		GVariant *old_value = sensor_value_get_value(sen);
-		GVariant *value = NEW_VARIANT_B(host_status);
-		if (VARIANT_COMPARE(old_value,value) != 0)
+		sensor_value_set_value(sen, value);
+		sensor_value_emit_changed(sen, value, "");
+		if (host_status == BOOTED)
 		{
-			sensor_value_set_value(sen, value);
-			sensor_value_emit_changed(sen, value, "");
-			if (host_status == BOOTED)
-			{
-				sensor_match_set_state(match,host_status);
-				sensor_match_emit_sensor_match(match,host_status);
-				control_emit_goto_system_state(control,"BOOTED");
-			}
+			sensor_match_set_state(match,host_status);
+			sensor_match_emit_sensor_match(match,host_status);
+			control_emit_goto_system_state(control,"BOOTED");
 		}
 	}
+	sensor_value_complete_set_value(sen,invocation);
+	return TRUE;
 }
 
 static void 
@@ -94,10 +84,6 @@
   		object_skeleton_set_sensor_match (object, match);
   		g_object_unref (match);
 
-		SensorIpmi *ipmi = sensor_ipmi_skeleton_new ();
-  		object_skeleton_set_sensor_ipmi (object, ipmi);
-  		g_object_unref (ipmi);
-
 		Control *control = control_skeleton_new ();
   		object_skeleton_set_control (object, control);
   		g_object_unref (control);
@@ -113,7 +99,7 @@
 		sensor_value_emit_changed(sensor,v,"");
 
 		//signal handlers
-		g_dbus_connection_signal_subscribe(connection,
+		/*g_dbus_connection_signal_subscribe(connection,
                                    "org.openbmc.sensors.IpmiBt",
                                    "org.openbmc.sensors.IpmiBt",
                                    "SetSensor",
@@ -123,6 +109,7 @@
                                    (GDBusSignalCallback) on_set_ipmi,
                                    object,
                                    NULL );
+		*/
   		//define method callbacks here
   		g_signal_connect (sensor,
                     "handle-init",
@@ -134,10 +121,10 @@
                     G_CALLBACK (on_init_control),
                     NULL); /* user_data */
 
-		//g_signal_connect (sensor,
-                  //  "handle-set-value",
-                  //  G_CALLBACK (on_set_value),
-                  //  object); /* user_data */
+		g_signal_connect (sensor,
+                    "handle-set-value",
+                    G_CALLBACK (on_set_value),
+                    object); /* user_data */
 
 
   		/* Export the object (@manager takes its own reference to @object) */
diff --git a/xml/openbmc_intf.xml b/xml/openbmc_intf.xml
index 62884d5..cf4f795 100644
--- a/xml/openbmc_intf.xml
+++ b/xml/openbmc_intf.xml
@@ -30,6 +30,9 @@
 		<method name="getValue">
 			<arg name="value" type="v" direction="out"/>
 		</method>
+		<method name="setValue">
+			<arg name="value" type="v" direction="in"/>
+		</method>
 
                 <property name="value" type="v" access="read"/>
 		<property name="units" type="s" access="read"/>
@@ -46,10 +49,6 @@
 			<arg name="bus_name" type="s"/>
 		</signal>
 	</interface>
-	<interface name="org.openbmc.SensorIpmi">
-		<property name="sensor_id" type="y" access="readwrite"/>
-		<property name="entity_id" type="y" access="readwrite"/>
-	</interface>
 	<interface name="org.openbmc.SensorThreshold">
 		<method name="getState">
 			<arg name="state" type="y" direction="out"/>
