mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 14:01:20 +00:00
Refuse to start when friendly_name ends with /DIGIT. #2645
This commit is contained in:
1 parent
407d329d4f
commit
4d54e5038b
2 files changed
+13
No files matched your search
@@ -512,6 +512,18 @@ describe('Settings', () => {
|
||||
}).toThrowError(`Duplicate friendly_name 'myname' found`);
|
||||
});
|
||||
|
||||
it('Configuration shouldnt be valid when friendly_name ends with /DIGIT', async () => {
|
||||
write(configurationFile, {
|
||||
devices: {'0x0017880104e45519': {friendly_name: 'myname/123', retain: false}},
|
||||
});
|
||||
|
||||
settings._reRead();
|
||||
|
||||
expect(() => {
|
||||
settings.validate();
|
||||
}).toThrowError(`Friendly name cannot end with a "/DIGIT" ('myname/123')`);
|
||||
});
|
||||
|
||||
it('Configuration shouldnt be valid when friendly_name is a postfix', async () => {
|
||||
write(configurationFile, {
|
||||
devices: {'0x0017880104e45519': {friendly_name: 'left', retain: false}},
|
||||
|
||||
Reference in new issue
Block a user