From 86982d00002524bbe98bd4872a2647695bb46e49 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sun, 6 Jul 2025 14:39:16 +0200 Subject: [PATCH] reuse code. --- aqhome/msg/node/m_value.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/aqhome/msg/node/m_value.c b/aqhome/msg/node/m_value.c index 01a0f58..a8cf759 100644 --- a/aqhome/msg/node/m_value.c +++ b/aqhome/msg/node/m_value.c @@ -12,6 +12,7 @@ +#include "aqhome/aqhome.h" #include "aqhome/msg/node/m_value.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) { - uint8_t t; - - 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"; + return AQH_ValueModality_toString(AQH_ValueMessage_GetValueType(msg)); }