reuse code.
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "aqhome/aqhome.h"
|
||||||
#include "aqhome/msg/node/m_value.h"
|
#include "aqhome/msg/node/m_value.h"
|
||||||
#include "aqhome/msg/node/m_node.h"
|
#include "aqhome/msg/node/m_node.h"
|
||||||
|
|
||||||
@@ -102,19 +103,7 @@ uint16_t AQH_ValueMessage_GetValueDenom(const AQH_MESSAGE *msg)
|
|||||||
|
|
||||||
const char *AQH_ValueMessage_GetValueTypeName(const AQH_MESSAGE *msg)
|
const char *AQH_ValueMessage_GetValueTypeName(const AQH_MESSAGE *msg)
|
||||||
{
|
{
|
||||||
uint8_t t;
|
return AQH_ValueModality_toString(AQH_ValueMessage_GetValueType(msg));
|
||||||
|
|
||||||
t=AQH_ValueMessage_GetValueType(msg);
|
|
||||||
switch(t) {
|
|
||||||
case AQH_MSG_VALUE_TYPE_TEMP: return "temperature";
|
|
||||||
case AQH_MSG_VALUE_TYPE_HUMIDITY: return "humidity";
|
|
||||||
case AQH_MSG_VALUE_TYPE_DOOR: return "door_window";
|
|
||||||
case AQH_MSG_VALUE_TYPE_MOTION: return "motion";
|
|
||||||
case AQH_MSG_VALUE_TYPE_CO2: return "CO2";
|
|
||||||
case AQH_MSG_VALUE_TYPE_TVOC: return "TVOC";
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
return "unknown";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user