Fix an error scenario where reading the file fails

When ledcontroller starts, it looks at sysfs entries to
populate its initial D-Bus values. In the case where the
read error's out for any reason, the code sets the initial
state as On

This patch fixes that scenario by putting the default to Off.
Also, this patch will enable a usecase where one wants
to have virtual physical LEDs that are not backed by file system

Tested:

/tmp/phosphor-ledcontroller -p /sys/class/leds/virtual/foo/led &

busctl get-property xyz.openbmc_project.LED.Controller.virtual_foo_led
/xyz/openbmc_project/led/physical/virtual_foo_led
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Off"

busctl set-property xyz.openbmc_project.LED.Controller.virtual_foo_led
/xyz/openbmc_project/led/physical/virtual_foo_led
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Blink"

busctl get-property xyz.openbmc_project.LED.Controller.virtual_foo_led
/xyz/openbmc_project/led/physical/virtual_foo_led
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Blink"

Change-Id: If4c880902a62939197129fc3b7ce8a73f2a7d137
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/physical.cpp b/physical.cpp
index 2be9e14..f4ef8a1 100644
--- a/physical.cpp
+++ b/physical.cpp
@@ -43,7 +43,7 @@
     {
         // Cache current LED state
         auto brightness = led.getBrightness();
-        if (brightness == assert)
+        if (brightness && assert)
         {
             sdbusplus::xyz::openbmc_project::Led::server::Physical::state(
                 Action::On);