* Add device info for Zigbee Groups
* Move Scene and getScenes to utils.ts
* Add auto-discovery for group scenes
* Update scene auto-discovery on change
* Add support for single endpoint scenes
* Add test for onScenesChanged
* Move Scene to types.d.ts
* Allow optional object_id_postfix key in payload
* Add scene name to object_id for nicer HA entity_id
* Use QOS1 for rarely sent messages
Specifically discovery and availability depending on the set up, it's possible for these messages to be silently discarded by the broker.
Sending them as QOS1 means the mqtt library used will resend them until it gets an ACK.
Ensuring delivery is particularly important for messages that are rarely sent like discovery or availability as they are only sent when there are changes, and nondelivery or dropped messages for them impede proper functioning in home assistant.
* Fix tests for discovery and availability using QOS1
* Fixed caching problem where old messages were sent out if long debounce values is used for sensor.
* Fixed caching problem where old messages were sent out if long debounce values is used for sensor
* State cache updated during debounce IF cache is enabled in configuration.
* Fixed code styles
* Implemented test case for testing State cache is updated correctly during debouncing
* If-statement was obsolete as cache can be update right away.
---------
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)
* Fix extension path to make debugginge easier in VScode
* Fix linting error
* Add setting "cache_state_persist_on_leave" (default false)
This setting does not remove a device from State if it leaves the network
* Merge from upstream kk/dev
* Re-define cache_state_persist_on_leave to be a timeout
Allows the config to specify how long the state should be held (and the device to re-join & maintain the state).
Remove all pending deletions if the system is stopped
* Add debug. Fix "time" test
* Disable esline warnings for long debug lines
* Simplify state maintenance for leave/join devices
* Restore default configuration.yaml
* Don't track device presence via events, but examine herdsman on system stop
* Update configuration.yaml
* Update state.ts
* Update state.ts
* Update controller.test.js
* Update eventBus.ts
* Update eventBus.ts
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>