zwave-js / node-red-contrib-zwave-js

The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.
MIT License
47 stars 6 forks source link

Check value type, before printing value #240

Closed fabnavigator closed 1 year ago

fabnavigator commented 2 years ago

What happened?

Please see the attachment:

Untitled .

How to reproduce?

https://devices.zwave-js.io/?jumpTo=0x0312:0xac01:0x4002:0.0

Version

7.2.1-beta 5

Node-RED Version

3.0.0

What hardware are you seeing the problem on?

Raspberry Pi

Relevant Z-Wave-JS log as a text file

No response

crxporter commented 2 years ago

If you double-click it then you should be able to see the object. I understand this is expected behavior in the UI as it would take too much effort and space to show all of the details for all of the complex cc's than exists in the ui panel.

Messages with that cc should also show the full object.

crxporter commented 2 years ago

Here's an example of what I get when I double click one of mine:

Screen Shot 2022-07-19 at 6 14 24 PM

fabnavigator commented 2 years ago

@crxporter Where does "[object Object]" come from? Is it hardcoded to show that, or is it some sort of an error? Can it be changed to something else?

crxporter commented 2 years ago

It's just a JavaScript thing whenever an object is used for a thing that prints a string. It's common all over nodered debug and alert panels when (some node) tries printing a complex object, it comes out [object Object]

Some quick reading if you're interested: https://careerkarma.com/blog/javascript-object-object/

crxporter commented 2 years ago

@marcus-j-davies perhaps there's a way to check if these are objects and when they are - kick that to some more helpful string like "click for details" ?

fabnavigator commented 2 years ago

Thank you.