Fix properties missing when debounce is used under some conditions #9658 (#9682)

* Add logging

* Kill bugs

* Updates
This commit is contained in:
Koen Kanters
2021-11-17 17:59:00 +00:00
committed by GitHub
parent 64154e0cb2
commit cc03be46df
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -276,7 +276,7 @@ class Controller {
}
}
this.eventBus.emitPublishEntityState({entity, message, stateChangeReason});
this.eventBus.emitPublishEntityState({entity, message, stateChangeReason, payload});
}
async iteratePayloadAttributeOutput(topicRoot: string, payload: KeyValue, options: MQTTOptions): Promise<void> {
+1 -1
View File
@@ -24,7 +24,7 @@ export default class Receive extends Extension {
*/
if (data.entity.isDevice() && this.debouncers[data.entity.ieeeAddr] &&
data.stateChangeReason !== 'publishDebounce' && data.stateChangeReason !== 'lastSeenChanged') {
for (const key of Object.keys(data.message)) {
for (const key of Object.keys(data.payload)) {
delete this.debouncers[data.entity.ieeeAddr].payload[key];
}
}
+2 -1
View File
@@ -145,7 +145,8 @@ declare global {
type DeviceLeave = { ieeeAddr: string, name: string };
type GroupMembersChanged = {group: Group, action: 'remove' | 'add' | 'remove_all',
endpoint: zh.Endpoint, skipDisableReporting: boolean };
type PublishEntityState = {entity: Group | Device, message: KeyValue, stateChangeReason: StateChangeReason };
type PublishEntityState = {entity: Group | Device, message: KeyValue, stateChangeReason: StateChangeReason,
payload: KeyValue};
type DeviceMessage = {
type: ZHEvents.MessagePayloadType;
device: Device;