Tolerate missing sensors on startup

Instead of crashing if one of the sensors listed in the symbol table
isn't on D-Bus yet, return quiet_NaN for its value instead.  A quiet_NaN
is what most of the sensor applications (all of the dbus-sensors ones)
return anyway when they are not able to read the device, and this can be
considered similar to that - that the device isn't accessible yet.

This eases the dependencies necessary in the service file, as the
service file as it stands now doesn't wait for any sensor providing
services to start, and even if it did different virtual sensors could
require different dependencies.

An alternative would be to have the code not even put the virtual sensor
on D-Bus until all of its required sensors are available, but that adds
quite a bit of complexity when usually there will just be a small window
after a reboot when the services area all starting up that this would
occur.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ifc9b010774fa1a703ff660abe57c57220cc907b3
diff --git a/dbusSensor.hpp b/dbusSensor.hpp
index 4756cad..faba2c6 100644
--- a/dbusSensor.hpp
+++ b/dbusSensor.hpp
@@ -31,6 +31,15 @@
     /** @brief Get sensor value property from D-bus interface */
     double getSensorValue()
     {
+        if (servName.empty())
+        {
+            servName = getService(bus, path, sensorIntf);
+            if (servName.empty())
+            {
+                return std::numeric_limits<double>::quiet_NaN();
+            }
+        }
+
         return getDbusProperty<double>(bus, servName, path, sensorIntf,
                                        "Value");
     }