Introduce ignoreFailIfHostOff config setting

Some sensors only provide valid readings when the host is powered on.
This change introduces the `ignoreFailIfHostOff` configuration option to
differentiate between unavailable readings based on host state.

- Host OFF: Sensor unavailable is acceptable and will not be treated as
a failure.
- Host ON (running): Sensor unavailable is unexpected, and the failsafe
mode will be triggered.

This ensures that sensors dependent on host power state are handled
correctly without causing unnecessary failsafe triggers during host-off.

Tested on Catalina: failsafe mode is not triggered when the host is off.
- config.json example: add `ignoreFailIfHostOff` for sensors only
available when the host is on.
```
{
    "sensors": [
        ......
        {
            "name": "HDDBOARD_SSD0_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/HDDBOARD_SSD0_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "HDDBOARD_SSD2_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/HDDBOARD_SSD2_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "PDB_P48V_HSC1_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/PDB_P48V_HSC1_TEMP_C",
            "timeout": 0,
            "ignoreDbusMinMax": true
        },
        {
            "name": "PDB_VR_P12V_N1_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/PDB_VR_P12V_N1_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "PDB_VR_P12V_N2_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/PDB_VR_P12V_N2_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "IOB0_NIC0_OSFP_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/IOB0_NIC0_OSFP_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "IOB0_NIC1_OSFP_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/IOB0_NIC1_OSFP_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "IOB1_NIC0_OSFP_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/IOB1_NIC0_OSFP_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        {
            "name": "IOB1_NIC1_OSFP_TEMP_C",
            "type": "temp",
            "readPath": "/xyz/openbmc_project/sensors/temperature/IOB1_NIC1_OSFP_TEMP_C",
            "timeout": 0,
            "ignoreFailIfHostOff": true,
            "ignoreDbusMinMax": true
        },
        ......
    ],

    "zones": [
        ......
    ]
}
```

Change-Id: I5355c453ca3c6d918c197dcd2cc9119e471d615d
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/main.cpp b/main.cpp
index d4bfaae..d50bfbd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -19,6 +19,7 @@
 #include "conf.hpp"
 #include "dbus/dbusconfiguration.hpp"
 #include "failsafeloggers/builder.hpp"
+#include "hoststatemonitor.hpp"
 #include "pid/builder.hpp"
 #include "pid/buildjson.hpp"
 #include "pid/pidloop.hpp"
@@ -94,6 +95,7 @@
 static sdbusplus::asio::connection modeControlBus(io);
 static sdbusplus::asio::connection hostBus(io, sdbusplus::bus::new_bus());
 static sdbusplus::asio::connection passiveBus(io, sdbusplus::bus::new_bus());
+static sdbusplus::asio::connection hostMatchBus(io, sdbusplus::bus::new_bus());
 
 namespace pid_control
 {
@@ -426,6 +428,10 @@
 
     pid_control::tryRestartControlLoops();
 
+    /* setup host state monitor */
+    auto& monitor = HostStateMonitor::getInstance(hostMatchBus);
+    monitor.startMonitoring();
+
     io.run();
     return 0;
 }