button_handler: use CurrentHostState for powered on checking

Current poweredOn() function is based on chassis CurrentPowerState, so
it does not turn on the host when chassis is powered on and host state
is off.
Switch to use CurrentHostState property for system powered on checking.

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: Ife184a718944f6f318fad4494d077251c250b7c8
diff --git a/src/button_handler.cpp b/src/button_handler.cpp
index 38649f0..27a9333 100644
--- a/src/button_handler.cpp
+++ b/src/button_handler.cpp
@@ -172,19 +172,18 @@
 }
 bool Handler::poweredOn(size_t hostNumber) const
 {
-    auto chassisObjectName =
-        CHASSIS_STATE_OBJECT_NAME + std::to_string(hostNumber);
-    auto service = getService(chassisObjectName.c_str(), chassisIface);
-    auto method = bus.new_method_call(
-        service.c_str(), chassisObjectName.c_str(), propertyIface, "Get");
-    method.append(chassisIface, "CurrentPowerState");
+    auto hostObjectName = HOST_STATE_OBJECT_NAME + std::to_string(hostNumber);
+    auto service = getService(hostObjectName.c_str(), hostIface);
+    auto method = bus.new_method_call(service.c_str(), hostObjectName.c_str(),
+                                      propertyIface, "Get");
+    method.append(hostIface, "CurrentHostState");
     auto result = bus.call(method);
 
     std::variant<std::string> state;
     result.read(state);
 
-    return Chassis::PowerState::On ==
-           Chassis::convertPowerStateFromString(std::get<std::string>(state));
+    return Host::HostState::Off !=
+           Host::convertHostStateFromString(std::get<std::string>(state));
 }
 
 void Handler::handlePowerEvent(PowerEvent powerEventType)