Adorkable / node-red-contrib-ui-led

A simple LED status indicator for the Node-RED Dashboard
MIT License
16 stars 12 forks source link

ui-led is grey with msg.responseBuffer or msg.input #78

Open Daini opened 3 years ago

Daini commented 3 years ago

Describe the bug

Dear maintainer, message objects of node-red-contrib-modbus v5.14.0 can contain attributes like msg.responseBuffer and msg.input besides the msg.payload. I have to delete this attributes with a change node first, before ui-led accepts a color change. The issue is described and discussed in https://discourse.nodered.org/t/ui-leds-grey-after-update/45634

Expected behavior Other properties than msg.payload shoudn't affect ui-led.

Versions

Platform

yoiang commented 3 years ago

Hey @Daini ! Thank you for the bug report! Catching up on the thread I want to clarify, what type is the payload coming into LED as? Is it an array? When I sit down I can double check but I'm quite sure at the moment LED does not manually accept array values and it definitely doesn't by default (by default it looks for true or false)

Daini commented 3 years ago

Hi @yoiang

this is a troublesome object:

{"topic":"polling","payload":false,"responseBuffer":{"data":[true,false,true,false,false,false,false,false],"buffer":[5]},"input":{"topic":"polling","from":"","payload":{"unitid":"","fc":2,"address":"0","quantity":"1","messageId":"609e8ff3e92e3c5ab46f7952"},"queueLengthByUnitId":{"unitId":1,"queueLength":0},"queueUnitId":1,"unitId":1},"sendingNodeId":"2ce4e912.835a5e","_msgid":"59261441.27dddc"}

This is a manual inject that works: {"_msgid":"403eb9eb.161f58","payload":false,"topic":"polling"}

yoiang commented 3 years ago

Let me take some time to reproduce this, LED only looks at the payload field and it looks perfectly ok so I understand your confusion!

nated0g commented 3 years ago

Came here with the same issue, coming from the same node (node-red-contrib-modbus)