summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--control/zone.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index b844793..d4c7a3c 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -640,12 +640,14 @@ const std::string& Zone::addServices(const std::string& path,
std::string Zone::current(std::string value)
{
- auto current = value;
- if (current != ThermalObject::current())
+ auto current = ThermalObject::current();
+ std::transform(value.begin(), value.end(), value.begin(), toupper);
+
+ if (value != current)
{
current = ThermalObject::current(value);
saveCurrentMode();
- // Trigger event(s) for custom mode property change
+ // Trigger event(s) for current mode property change
auto eData = _objects[_path]
["xyz.openbmc_project.Control.ThermalMode"]
["Current"];
@@ -655,6 +657,7 @@ std::string Zone::current(std::string value)
handleEvent(nullMsg, eData);
}
}
+
return current;
}
OpenPOWER on IntegriCloud