mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Merge pull request #9150 from s-hadinger/zigbee_27_dev
Zigbee limit friendly name to 32 bytes
This commit is contained in:
commit
95cd82a54f
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user