mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 05:52:20 +00:00
* Allow filtering of attributes in mqtt json payload or published attributes * Add test for mqtt_attribute_filter Just doing attribute_and_json should be fine as the code changes are run before this. Doing this tests lets us varify both json or seperate topic get properly filtered. * Add test for mqtt_attribute_filter on group * Rename mqtt_attribute_filter to filtered_attributes
This commit is contained in:
1 parent
68750fade0
commit
658cc21b4d
4 files changed
+38
No files matched your search
@@ -285,6 +285,11 @@ class Controller {
|
||||
attributes.forEach((a) => messagePayload.device[a] = device[a]);
|
||||
}
|
||||
|
||||
// filter mqtt message attributes
|
||||
if (entity.settings.filtered_attributes) {
|
||||
entity.settings.filtered_attributes.forEach((a) => delete messagePayload[a]);
|
||||
}
|
||||
|
||||
this.eventBus.emit('publishEntityState', {payload: messagePayload, entity});
|
||||
|
||||
if (Object.entries(messagePayload).length) {
|
||||
|
||||
Reference in new issue
Block a user