mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-21 11:01:59 +00:00
Don't allow friendly_name to start with. https://github.com/Koenkk/zigbee2mqtt/commit/d7c74ca3ad65dc8cc0366d321c5494c4f3b7a51b
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ function validateFriendlyName(name) {
|
||||
}
|
||||
|
||||
if (name.length === 0) errors.push(`friendly_name shoud atleast be 1 char long`);
|
||||
if (name.endsWith('/')) errors.push(`friendly_name is not allowed to end with /`);
|
||||
if (name.endsWith('/') || name.startsWith('/')) errors.push(`friendly_name is not allowed to end or start with /`);
|
||||
if (name.endsWith(String.fromCharCode(0))) errors.push(`friendly_name is not allowed to contain null char`);
|
||||
if (endpointNames.includes(name)) errors.push(`Following friendly_name are not allowed: '${endpointNames}'`);
|
||||
if (name.match(/.*\/\d*$/)) errors.push(`Friendly name cannot end with a "/DIGIT" ('${name}')`);
|
||||
|
||||
Reference in New Issue
Block a user