aqhome-react: more work on modules and networks.
- tested AND network and new suntime units. - add unit XML property "invert" (inverts output for logical units)
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include <gwenhywfar/xml.h>
|
||||
#include <gwenhywfar/text.h>
|
||||
|
||||
//TODO: read modules
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
@@ -486,16 +485,25 @@ AQHREACT_UNIT *_readOneUnitFromXml(AQHOME_REACT *aqh, GWEN_XMLNODE *xmlNode)
|
||||
{
|
||||
const char *id;
|
||||
const char *t;
|
||||
const char *s;
|
||||
|
||||
id=GWEN_XMLNode_GetProperty(xmlNode, "id", NULL);
|
||||
t=GWEN_XMLNode_GetProperty(xmlNode, "type", NULL);
|
||||
s=GWEN_XMLNode_GetProperty(xmlNode, "invert", NULL);
|
||||
|
||||
if (id && t) {
|
||||
AQHREACT_UNIT *subUnit;
|
||||
int rv;
|
||||
|
||||
subUnit=AqHomeReact_CreateUnitByName(aqh, t);
|
||||
if (subUnit==NULL) {
|
||||
DBG_INFO(NULL, "Could not create unit of type \"%s\"", t);
|
||||
return NULL;
|
||||
}
|
||||
AQHREACT_Unit_SetId(subUnit, id);
|
||||
if (s && strcasecmp(s, "TRUE")==0)
|
||||
AQHREACT_Unit_AddFlags(subUnit, AQHREACT_UNIT_FLAGS_INVERT);
|
||||
|
||||
rv=_readParamsFromXml(subUnit, xmlNode, "params");
|
||||
if (rv<0) {
|
||||
DBG_INFO(NULL, "here (%d)", rv);
|
||||
|
||||
Reference in New Issue
Block a user