Skip to content

Commit

Permalink
use save Config and use load() directly
Browse files Browse the repository at this point in the history
  • Loading branch information
naheedsa committed May 20, 2024
1 parent b2c3229 commit a222915
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions indi-armadillo-platypus/dragonfly_dome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ bool DragonFlyDome::initProperties()
FirmwareVersionTP.fill(getDeviceName(), "DOME_FIRMWARE", "Firmware", MAIN_CONTROL_TAB,
IP_RO, 0, IPS_IDLE);

// Load Configuration
PerPortSP.load();

///////////////////////////////////////////////////////////////////////////////////////////////
// #5 Misc.
///////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -169,7 +172,6 @@ void DragonFlyDome::ISGetProperties(const char *dev)
INDI::Dome::ISGetProperties(dev);

defineProperty(PerPortSP);
loadConfig(true, PerPortSP.getName());
}

bool DragonFlyDome::updateProperties()
Expand Down Expand Up @@ -281,7 +283,7 @@ bool DragonFlyDome::ISNewSwitch(const char *dev, const char *name, ISState *stat
PerPortSP.update(states, names, n);
PerPortSP.setState(IPS_OK);
PerPortSP.apply();
saveConfig(true, PerPortSP.getName());
saveConfig(PerPortSP);
return true;
}
/////////////////////////////////////////////
Expand Down Expand Up @@ -333,7 +335,7 @@ bool DragonFlyDome::ISNewNumber(const char *dev, const char *name, double values
DomeControlSensorNP.update(values, names, n);
DomeControlSensorNP.setState(IPS_OK);
DomeControlSensorNP.apply();
saveConfig(true, DomeControlSensorNP.getName());
saveConfig(DomeControlSensorNP);
return true;
}
}
Expand Down

0 comments on commit a222915

Please sign in to comment.