diff options
-rw-r--r-- | control/zone.cpp | 12 | ||||
-rw-r--r-- | control/zone.hpp | 9 |
2 files changed, 21 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}; diff --git a/control/zone.hpp b/control/zone.hpp index 3774d76..73761d0 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -468,6 +468,15 @@ class Zone : public ThermalObject const std::string& intf, int32_t depth); + /** + * @brief Overridden thermal object's set 'Current' property function + * + * @param[in] value - Value to set 'Current' to + * + * @return - The updated value of the 'Current' property + */ + virtual std::string current(std::string value); + private: /** |