From ed4fc1852af4cb1fc5adaf6f79d178e55a547e7f Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Tue, 19 Mar 2024 23:48:05 +0100 Subject: [PATCH] added function AqHomeReact_AddUnit(). --- apps/aqhome-react/aqhome_react.c | 8 ++++++++ apps/aqhome-react/aqhome_react.h | 1 + 2 files changed, 9 insertions(+) diff --git a/apps/aqhome-react/aqhome_react.c b/apps/aqhome-react/aqhome_react.c index 16133a5..dd43675 100644 --- a/apps/aqhome-react/aqhome_react.c +++ b/apps/aqhome-react/aqhome_react.c @@ -162,6 +162,14 @@ AQHREACT_UNIT *AqHomeReact_FindUnitByNetNameAndUnitId(const AQHOME_REACT *aqh, c +void AqHomeReact_AddUnit(AQHOME_REACT *aqh, AQHREACT_UNIT *unit) +{ + if (aqh && unit) + AQHREACT_Unit_List_Add(unit, aqh->unitList); +} + + + 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 */ diff --git a/apps/aqhome-react/aqhome_react.h b/apps/aqhome-react/aqhome_react.h index 39b1db5..5b8b0a6 100644 --- a/apps/aqhome-react/aqhome_react.h +++ b/apps/aqhome-react/aqhome_react.h @@ -38,6 +38,7 @@ void AqHomeReact_AddUnitNet(AQHOME_REACT *aqh, AQHREACT_UNIT_NET *unitNet); AQHREACT_UNIT_NET *AqHomeReact_GetUnitNetById(const AQHOME_REACT *aqh); AQHREACT_UNIT *AqHomeReact_FindUnitByNetNameAndUnitId(const AQHOME_REACT *aqh, const char *netName, const char *unitId); +void AqHomeReact_AddUnit(AQHOME_REACT *aqh, AQHREACT_UNIT *unit); AQHREACT_UNIT *AqHomeReact_CreateUnitByName(AQHOME_REACT *aqh, const char *unitType);