Skip to content

getProp() needs extra "val" property #18

@zustellr

Description

@zustellr

Hi. I am starting to use this library (thanks for your work!) and stuggled quite a bit with the getProp() function.

When reading a topic with a value of

{
  "state": "OFF",
}

I was expecting to use

     var state = getProp(path, "state");

but instead had to use

     var state = getProp(path, "val", "state");

to read it correctly. Could be that I missed something in the documentation, or that this is general quirk of mqtt.

Please check and feel free to close if this is the expected behavior. Could also be that this is a thing that could be added to the documentation, if it is expected behavior.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions