From 715adf44f1b1ab0b58e6688d49fee6c206208389 Mon Sep 17 00:00:00 2001 From: Gregg Date: Fri, 17 Dec 2021 06:44:27 -0600 Subject: [PATCH] Added setDescription(const char *) method to SpanCharacteristic This allows you to add an optional "description" to a Characteristic. This is not the same as the name of a Service and is generally not used by the Home App. However, it appears to be consumed by the Eve app, which can be helpful in some circumstances when developing custom characteristics. --- src/HomeSpan.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/HomeSpan.h b/src/HomeSpan.h index 664d4b9..40f872a 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -601,6 +601,12 @@ struct SpanCharacteristic{ return(setPerms(perms&(~dPerms))); } + SpanCharacteristic *setDescription(const char *c){ + desc = (char *)realloc(desc, strlen(c) + 1); + strcpy(desc, c); + return(this); + } + }; ///////////////////////////////