summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2019-02-14 16:07:00 -0600
committerMatthew Barth <msbarth@us.ibm.com>2019-02-18 09:46:13 -0600
commita2bed6ed873b18cd150d3e26845391df03649a78 (patch)
tree164c71c5a25e7ba58451884c07acc0cfac4f3637
parentb390df1ec2d6551419a392cf08e09afdc1d1eae6 (diff)
downloadphosphor-fan-presence-a2bed6ed873b18cd150d3e26845391df03649a78.zip
phosphor-fan-presence-a2bed6ed873b18cd150d3e26845391df03649a78.tar.gz
Initially use default current mode upon restoring
When restoring the persisted current mode, initially set the current mode to what's already provided. When no interface is defined within the zone yaml, a default value of "Default" is already set on the Control.ThermalMode interface. If an interface is provided on the zone yaml, and the Current property is initialized to a value, use this value initially upon restoring. During the restore, this value could change to what was persisted. Tested: Current mode is set correctly upon initialization & restore Change-Id: I0fae247303903d85e95fc044c96fc1809df2fa03 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
-rw-r--r--control/zone.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index d4c7a3c..0278de8 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -674,7 +674,7 @@ void Zone::saveCurrentMode()
void Zone::restoreCurrentMode()
{
- std::string current = "Default";
+ auto current = ThermalObject::current();
fs::path path{CONTROL_PERSIST_ROOT_PATH};
path /= std::to_string(_zoneNum);
path /= "CurrentMode";
@@ -693,7 +693,7 @@ void Zone::restoreCurrentMode()
{
log<level::ERR>(e.what());
fs::remove(path);
- current = "Default";
+ current = ThermalObject::current();
}
this->current(current);
OpenPOWER on IntegriCloud