control: Update zone target on startup
To handle restarting of the fan control service, set the zone's target
to what's initialized on one of the fan's target that's included in the
zone.
Change-Id: I88c598e817c1dbbd42d82265b8378dc78d3946d2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/zone.cpp b/control/json/zone.cpp
index 90aeb66..4d353d5 100644
--- a/control/json/zone.cpp
+++ b/control/json/zone.cpp
@@ -91,7 +91,7 @@
void Zone::setTarget(uint64_t target)
{
- if (_isActive)
+ if (_isActive && _target != target)
{
_target = target;
for (auto& fan : _fans)