* Add endpoint matching based on the endpoint names list in the device definition
* Cleanup debug prints
* Correct creating endpoint names list, filter out null elements
* Correct test due to slightly changed behavior
* Fix endpoint name lookup when converter does not provide full name-to-id mapping
* Simplify topic name matching
* Remove obsolete branches, improve code coverage
* Make linter happy
* Make linter happy
* Remove dependency on endpoint names while removing device from all groups
* Get rid of predefined list of endpoints when processing group state update
---------
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
* fix for TypeError: The "path" argument must be of type string in writeDevicesOrGroups
* added test case that produces the error when running on old implementation
Summary of all failing tests
FAIL test/settings.test.js
● Settings › Should add devices even when devices exist empty
TypeError: The "path" argument must be of type string. Received undefined
275 |
276 | jest.mock('../../lib/util/data', () => ({
> 277 | joinPath: (file) => require('path').join(mockDir, file),
| ^
278 | getPath: () => mockDir,
279 | }));
280 |
at Object.join [as joinPath] (test/stub/data.js:277:41)
at joinPath (lib/util/settings.ts:245:38)
at writeDevicesOrGroups (lib/util/settings.ts:250:5)
at Object.write [as addDevice] (lib/util/settings.ts:555:5)
at Object.addDevice (test/settings.test.js:128:18)
* Extract parsing of value reference '!' in settings into a function
* Allow to specify full file name in value reference '!'
This `network_key: '!secret network_key'` is really confusing because
it looks like a YAML tag named 'secret' and a value "network_key".
When we write `network_key: '!secret.yaml network_key'` instead, it's
a little clearer what's going on. Also, it's more consistent with file
references in 'devices' and 'groups'.
* add server, pan_id, ext_pan_id to secrets
* fix tests
* clean secrets before every test run
* add interpolation of mqtt.server, advanced.pan_id, advanced.ext_pan_id and split mqtt.user, mqtt.pass requirement
* remove pan_id and ext_pan_id from secrets processing