Move status iface creation into sensor object

For sensors that have a status interface created with a functional
property set according to its fault sysfs file value, the object
associated with the sensor should contain the creation of this
interface.

Tested:
    No change in status interface creation for sensors

Change-Id: Ic3c0a81c661ac481b90ad9bd4c8bf415dae3520e
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index c7ede15..be9b680 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -288,7 +288,9 @@
         return {};
     }
 
-    auto sensorObj = std::make_unique<sensor::Sensor>(sensor.first);
+    auto sensorObj = std::make_unique<sensor::Sensor>(sensor.first,
+                                                      ioAccess,
+                                                      _devPath);
 
     // Get list of return codes for removing sensors on device
     auto devRmRCs = env::getEnv("REMOVERCS");
@@ -314,7 +316,7 @@
     try
     {
         // Add status interface based on _fault file being present
-        sensor::addStatus(sensor.first, ioAccess, _devPath, info);
+        sensorObj->addStatus(info);
         valueInterface = addValue(sensor.first, retryIO, ioAccess, info);
     }
     catch (const std::system_error& e)