Merge branch 'zigbee_27_dev' of https://github.com/s-hadinger/Tasmota into zigbee_28_dev

This commit is contained in:
Stephan Hadinger 2020-08-23 15:26:49 +02:00
commit da4e29a14b
1 changed files with 1 additions and 0 deletions

View File

@ -978,6 +978,7 @@ void CmndZbName(void) {
const char * friendlyName = zigbee_devices.getFriendlyName(shortaddr); const char * friendlyName = zigbee_devices.getFriendlyName(shortaddr);
Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, friendlyName ? friendlyName : ""); Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, friendlyName ? friendlyName : "");
} else { } else {
if (strlen(p) > 32) { p[32] = 0x00; } // truncate to 32 chars max
zigbee_devices.setFriendlyName(shortaddr, p); zigbee_devices.setFriendlyName(shortaddr, p);
Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, p); Response_P(PSTR("{\"0x%04X\":{\"" D_JSON_ZIGBEE_NAME "\":\"%s\"}}"), shortaddr, p);
} }