Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getProp() needs extra "val" property #18

Open
zustellr opened this issue Dec 18, 2021 · 0 comments
Open

getProp() needs extra "val" property #18

zustellr opened this issue Dec 18, 2021 · 0 comments

Comments

@zustellr
Copy link

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!

@zustellr zustellr changed the title getProp() need extra "val" property getProp() needs extra "val" property Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant