aqhome: write values also to file "value".
- if valueType is known write value into the given file - always write raw value into file "value"
This commit is contained in:
@@ -107,10 +107,19 @@ void _processOutMessage(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
|
|||||||
|
|
||||||
void _processValue2Message(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
|
void _processValue2Message(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
|
||||||
{
|
{
|
||||||
|
const char *sType;
|
||||||
|
|
||||||
|
sType=_valueTypeToString(AQH_Value2Msg_GetValueId(nodeMsg));
|
||||||
|
if (sType && *sType)
|
||||||
|
_writeDouble(ep,
|
||||||
|
AQH_Value2Msg_GetUid(nodeMsg),
|
||||||
|
AQH_Value2Msg_GetValueId(nodeMsg),
|
||||||
|
sType,
|
||||||
|
AQH_Value2Msg_GetValue(nodeMsg));
|
||||||
_writeDouble(ep,
|
_writeDouble(ep,
|
||||||
AQH_Value2Msg_GetUid(nodeMsg),
|
AQH_Value2Msg_GetUid(nodeMsg),
|
||||||
AQH_Value2Msg_GetValueId(nodeMsg),
|
AQH_Value2Msg_GetValueId(nodeMsg),
|
||||||
_valueTypeToString(AQH_Value2Msg_GetValueId(nodeMsg)),
|
"value",
|
||||||
AQH_Value2Msg_GetValue(nodeMsg));
|
AQH_Value2Msg_GetValue(nodeMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +187,8 @@ const char *_valueTypeToString(int t)
|
|||||||
switch(t) {
|
switch(t) {
|
||||||
case AQH_MSG_VALUE2_TYPE_TEMP: return "temperature";
|
case AQH_MSG_VALUE2_TYPE_TEMP: return "temperature";
|
||||||
case AQH_MSG_VALUE2_TYPE_HUMIDITY: return "humidity";
|
case AQH_MSG_VALUE2_TYPE_HUMIDITY: return "humidity";
|
||||||
default: return "unknown";
|
case AQH_MSG_VALUE2_TYPE_DOOR: return "door_window";
|
||||||
|
default: return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user