aqhome-react: peridocally write vars.

This commit is contained in:
Martin Preuss
2024-05-19 01:35:42 +02:00
parent dde9106a5d
commit a3bf403ac0
5 changed files with 78 additions and 2 deletions

View File

@@ -25,6 +25,8 @@
#include "aqhome-react/units/u_timeprogram.h"
#include "aqhome-react/units/u_statfns.h"
#include "aqhome/data/vars_dbwrite.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
@@ -295,6 +297,22 @@ int AqHomeReact_DecIntValue(AQHOME_REACT *aqh, const char *path, int startValue,
int AqHomeReact_WriteVarsFile(AQHOME_REACT *aqh)
{
if (aqh && aqh->localVars && aqh->varsFile) {
int rv;
rv=AQH_Vars_WriteDbFile(aqh->localVars, aqh->varsFile);
if (rv<0) {
DBG_INFO(NULL, "here (%d)", rv);
return rv;
}
}
return 0;
}
AQHREACT_UNIT *AqHomeReact_CreateUnitByName(AQHOME_REACT *aqh, const char *unitType)
{
/* this does not include u_timer and u_varchanges, because those are only created once globally in init.c */