Closed dvas0004 closed 5 years ago
Do you have any other details? What's being parsed improperly?
Sorry @mrstegeman! I was click-happy and created the issue without adding the description. Issue updated :)
@dvas0004 Yeah, the webthing libraries were all just updated for the latest spec, but the adapter has not yet been updated. If you have an immediate need, you can step back to the 0.9.X library series. Otherwise, I plan to update the add-on this week.
No worries! The workaround I described is working sufficiently for me at the moment :)
On Wed, 5 Dec 2018 at 17:12, Michael Stegeman notifications@github.com wrote:
@dvas0004 https://github.com/dvas0004 Yeah, the webthing libraries were all just updated for the latest spec, but the adapter has not yet been updated. If you have an immediate need, you can step back to the 0.9.X library series. Otherwise, I plan to update the add-on this week.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-iot/thing-url-adapter/issues/62#issuecomment-444519695, or mute the thread https://github.com/notifications/unsubscribe-auth/AFlDbTG1ZFj3f7IbTbbUTPPAUI_qpY59ks5u1-J3gaJpZM4ZC0x9 .
Symptoms:
Reproduction:
Expected:
Note in the above screenshot the "brightness" is populated with 50% and basically everything works as expected
Troubleshooting / Potential Solution:
Looking at the run-app logs, we see some interesting entries:
Note the "undefined" being appended to the URL. Searching for the error message "Failed to connect..." in thing-url-adapter.js, I managed to trace the error to line 105.
Currently you expect a single 'href' to be present in JSON returned from the WebThings API, however what's being returned is actually a "links" array, which then contains the 'href' string you are looking for, for example:
Changing line 105 in thing-url-adapter.js to:
solves the issue
Notes to anyone trying the above workaround:
You need to first update the SHA256SUMS entry for thing-url-adapter.js, and restart
All the files mentioned above are installed under /home/pi/.mozilla-iot/addons/thing-url-adapter