From bc6f2b066fd1e6b3893ce6ef2df239c7d6103787 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Tue, 26 Jan 2021 19:24:13 +0100 Subject: [PATCH] Add Zigbee SetOption synonyms Add commands ``ZbNameKey``, ``ZbDeviceTopic``, ``ZbNoPrefix``, ``ZbEndpointSuffix``, ``ZbNoAutoBind``, ``ZbNameTopic`` as synonyms for ``SetOption83, 89, 100, 101, 110 and 112`` respectively --- tasmota/i18n.h | 6 ++++++ tasmota/xdrv_23_zigbee_A_impl.ino | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 9f2b3ab7a..70329cfa2 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -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" diff --git a/tasmota/xdrv_23_zigbee_A_impl.ino b/tasmota/xdrv_23_zigbee_A_impl.ino index 0333c8d81..b2209d2f0 100644 --- a/tasmota/xdrv_23_zigbee_A_impl.ino +++ b/tasmota/xdrv_23_zigbee_A_impl.ino @@ -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