summaryrefslogtreecommitdiffstats
path: root/control/zone.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2019-01-22 09:26:09 -0600
committerMatthew Barth <msbarth@us.ibm.com>2019-02-13 14:31:44 -0600
commit6faf8943ddb3888485a50269fe43a6d5b6f68afc (patch)
treeb5c1b0195684699de1e5be2e6dd43c399ccd3c6f /control/zone.cpp
parent9e4db25cdf7d02878aab1d485b20235c147fbe4a (diff)
downloadphosphor-fan-presence-6faf8943ddb3888485a50269fe43a6d5b6f68afc.tar.gz
phosphor-fan-presence-6faf8943ddb3888485a50269fe43a6d5b6f68afc.zip
Override setting Current mode property
When the Current mode property changes, the persisted value is updated. Change-Id: I319fbe2afb8112f7425dc0a1d765fe8f1c408bae Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.cpp')
-rw-r--r--control/zone.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index 8408e8d..bc40b7e 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -604,6 +604,18 @@ const std::string& Zone::addServices(const std::string& path,
return empty;
}
+std::string Zone::current(std::string value)
+{
+ auto current = value;
+ if (current != ThermalObject::current())
+ {
+ current = ThermalObject::current(value);
+ saveCurrentMode();
+ // TODO Trigger event(s) for mode property change
+ }
+ return current;
+}
+
void Zone::saveCurrentMode()
{
fs::path path{CONTROL_PERSIST_ROOT_PATH};
OpenPOWER on IntegriCloud