Merge pull request #10706 from s-hadinger/zigbee_so_syn

Add Zigbee SetOption synonyms
This commit is contained in:
s-hadinger 2021-01-26 19:37:18 +01:00 committed by GitHub
commit 61e13b79f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -529,6 +529,12 @@
// Commands xdrv_23_zigbee.ino
#define D_PRFX_ZB "Zb"
#define D_SO_ZIGBEE_NAMEKEY "NameKey"
#define D_SO_ZIGBEE_DEVICETOPIC "DeviceTopic"
#define D_SO_ZIGBEE_NOPREFIX "NoPrefix"
#define D_SO_ZIGBEE_ENDPOINTSUFFIX "EndpointSuffix"
#define D_SO_ZIGBEE_NOAUTOBIND "NoAutoBind"
#define D_SO_ZIGBEE_NAMETOPIC "NameTopic"
#define D_ZIGBEE_NOT_STARTED "Zigbee not started"
#define D_CMND_ZIGBEE_PERMITJOIN "PermitJoin"
#define D_CMND_ZIGBEE_STATUS "Status"

View File

@ -24,6 +24,9 @@
#include "UnishoxStrings.h"
const char kZbCommands[] PROGMEM = D_PRFX_ZB "|" // prefix
// SetOption synonyms
D_SO_ZIGBEE_NAMEKEY "|" D_SO_ZIGBEE_DEVICETOPIC "|" D_SO_ZIGBEE_NOPREFIX "|" D_SO_ZIGBEE_ENDPOINTSUFFIX "|" D_SO_ZIGBEE_NOAUTOBIND "|"
D_SO_ZIGBEE_NAMETOPIC "|"
#ifdef USE_ZIGBEE_ZNP
D_CMND_ZIGBEEZNPSEND "|" D_CMND_ZIGBEEZNPRECEIVE "|"
#endif // USE_ZIGBEE_ZNP
@ -39,6 +42,12 @@ const char kZbCommands[] PROGMEM = D_PRFX_ZB "|" // prefix
D_CMND_ZIGBEE_CONFIG "|" D_CMND_ZIGBEE_DATA
;
const uint8_t kZbSynonyms[] PROGMEM = {
6, // number of synonyms
83, 89, 100, 101, 110,
112,
};
void (* const ZigbeeCommand[])(void) PROGMEM = {
#ifdef USE_ZIGBEE_ZNP
&CmndZbZNPSend, &CmndZbZNPReceive,
@ -2182,7 +2191,7 @@ bool Xdrv23(uint8_t function)
ZigbeeInit();
break;
case FUNC_COMMAND:
result = DecodeCommand(kZbCommands, ZigbeeCommand);
result = DecodeCommand(kZbCommands, ZigbeeCommand, kZbSynonyms);
break;
case FUNC_SAVE_BEFORE_RESTART:
#ifdef USE_ZIGBEE_EZSP