Default pwm speed to 30%

Before fan control writes pwm, we were seeing some pwm
below the critcal level, make sure they start somewhere
nice.

Tested: systemctl disable phosphor-pid-control, no 0 pwm

Change-Id: I789b25db64fff2f69e0c5a3ee0aef16a0cb0ddae
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/PwmSensor.cpp b/src/PwmSensor.cpp
index d8a7a17..c33f05c 100644
--- a/src/PwmSensor.cpp
+++ b/src/PwmSensor.cpp
@@ -22,6 +22,7 @@
 #include <sdbusplus/asio/object_server.hpp>
 
 static constexpr size_t pwmMax = 255;
+static constexpr double defaultPwm = 30.0;
 
 PwmSensor::PwmSensor(const std::string& name, const std::string& sysPath,
                      sdbusplus::asio::object_server& objectServer,
@@ -35,6 +36,12 @@
         "/xyz/openbmc_project/sensors/fan_pwm/" + name,
         "xyz.openbmc_project.Sensor.Value");
     uint32_t pwmValue = getValue(false);
+    if (!pwmValue)
+    {
+        // default pwm to non 0
+        pwmValue = static_cast<uint32_t>(pwmMax * (defaultPwm / 100));
+        setValue(pwmValue);
+    }
     double fValue = 100.0 * (static_cast<double>(pwmValue) / pwmMax);
     sensorInterface->register_property(
         "Value", fValue,