Skip to content

Commit

Permalink
fix(switch)!: Insert trigger message in top level not in payload
Browse files Browse the repository at this point in the history
BREAKING CHANGE: When use the service nodered.trigger the message object will to merge at the top level. Before it was added at msg.payload

Was missed when the all the expose nodes where changed.
  • Loading branch information
zachowj committed Oct 23, 2023
1 parent a81978d commit 5762f49
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/nodes/switch/SwitchController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ export default class SwitchController extends InputOutputController<
}

public onTrigger(data: TriggerPayload) {
const message: NodeMessage = {
topic: 'triggered',
};
if (data.message !== undefined) {
message.payload = data.message;
}
const message: NodeMessage = { topic: 'triggered', ...data.message };

if (this.#isSwitchEntityEnabled) {
this.status.setSuccess('triggered');
Expand Down

0 comments on commit 5762f49

Please sign in to comment.