From 061438b7c82d5cbe235a7e709873c73ebe52899b Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 28 Oct 2024 23:41:27 +0100 Subject: [PATCH] avr, aqhome: added modality MOTION. --- aqhome/aqhome.c | 3 +++ aqhome/aqhome.h | 3 ++- aqhome/msg/msg_value3.c | 1 + aqhome/msg/msg_value3.h | 1 + avr/defs.asm | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/aqhome/aqhome.c b/aqhome/aqhome.c index 7679d84..ef915cd 100644 --- a/aqhome/aqhome.c +++ b/aqhome/aqhome.c @@ -259,6 +259,8 @@ int AQH_ValueModality_fromString(const char *s) return AQH_ValueModality_RGB; else if (strcasecmp(s, "rgbw")==0) return AQH_ValueModality_RGBW; + else if (strcasecmp(s, "motion")==0) + return AQH_ValueModality_Motion; } return AQH_ValueModality_Unknown; } @@ -273,6 +275,7 @@ const char *AQH_ValueModality_toString(int i) case AQH_ValueModality_Door: return "door"; case AQH_ValueModality_RGB: return "rgb"; case AQH_ValueModality_RGBW: return "rgbw"; + case AQH_ValueModality_Motion: return "motion"; case AQH_ValueModality_Unknown: default: return "unknown"; } diff --git a/aqhome/aqhome.h b/aqhome/aqhome.h index 9c49f83..50e6636 100644 --- a/aqhome/aqhome.h +++ b/aqhome/aqhome.h @@ -41,7 +41,8 @@ enum { AQH_ValueModality_Humidity, AQH_ValueModality_Door, AQH_ValueModality_RGB, - AQH_ValueModality_RGBW + AQH_ValueModality_RGBW, + AQH_ValueModality_Motion }; diff --git a/aqhome/msg/msg_value3.c b/aqhome/msg/msg_value3.c index 0399426..ae6fd8d 100644 --- a/aqhome/msg/msg_value3.c +++ b/aqhome/msg/msg_value3.c @@ -122,6 +122,7 @@ const char *AQH_Value3Msg_GetValueTypeName(const GWEN_MSG *msg) case AQH_MSG_VALUE3_TYPE_TEMP: return "temperature"; case AQH_MSG_VALUE3_TYPE_HUMIDITY: return "humidity"; case AQH_MSG_VALUE3_TYPE_DOOR: return "door_window"; + case AQH_MSG_VALUE3_TYPE_MOTION: return "motion"; default: break; } return "unknown"; diff --git a/aqhome/msg/msg_value3.h b/aqhome/msg/msg_value3.h index f59f15a..b01a8bf 100644 --- a/aqhome/msg/msg_value3.h +++ b/aqhome/msg/msg_value3.h @@ -21,6 +21,7 @@ #define AQH_MSG_VALUE3_TYPE_TEMP 1 #define AQH_MSG_VALUE3_TYPE_HUMIDITY 2 #define AQH_MSG_VALUE3_TYPE_DOOR 3 +#define AQH_MSG_VALUE3_TYPE_MOTION 6 AQHOME_API GWEN_MSG *AQH_Value3Msg_new(uint8_t srcAddr, uint8_t destAddr, diff --git a/avr/defs.asm b/avr/defs.asm index da5e517..8c6ff27 100644 --- a/avr/defs.asm +++ b/avr/defs.asm @@ -13,6 +13,9 @@ .equ AQHOME_VALUETYPE_TEMP = 1 .equ AQHOME_VALUETYPE_HUMIDITY = 2 .equ AQHOME_VALUETYPE_DOOR = 3 +.equ AQHOME_VALUETYPE_RGB = 4 +.equ AQHOME_VALUETYPE_RGBW = 5 +.equ AQHOME_VALUETYPE_MOTION = 6 .equ AQHOME_FW_TYPE_ATT84_BASE = 0