mirror of
https://github.com/thelsing/knx.git
synced 2025-03-27 00:15:15 +01:00
Fix callback sequence (#153)
Save-/restore callbacks need to be defined before knx.readMemory() to ensure the restore callback is called.
This commit is contained in:
parent
616599cf8b
commit
87edd3dfe0
@ -53,6 +53,10 @@ void setup(void)
|
||||
wifiManager.autoConnect("knx-bme680");
|
||||
#endif
|
||||
|
||||
// set save and restore callbacks
|
||||
knx.setSaveCallback(saveBme680State);
|
||||
knx.setRestoreCallback(loadBme680State);
|
||||
|
||||
// read adress table, association table, groupobject table and parameters from eeprom
|
||||
knx.readMemory();
|
||||
|
||||
@ -60,7 +64,6 @@ void setup(void)
|
||||
if(knx.configured())
|
||||
goTriggerSample.callback(triggerCallback);
|
||||
|
||||
|
||||
// Configure Wire pins before this call if needed.
|
||||
Wire.begin();
|
||||
// depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work.
|
||||
@ -87,9 +90,6 @@ void setup(void)
|
||||
BSEC_OUTPUT_GAS_PERCENTAGE
|
||||
};
|
||||
|
||||
knx.setSaveCallback(saveBme680State);
|
||||
knx.setRestoreCallback(loadBme680State);
|
||||
|
||||
if (knx.configured())
|
||||
{
|
||||
cyclSend = knx.paramInt(0);
|
||||
|
Loading…
Reference in New Issue
Block a user