[dss-developer] An Issue with Add-On Triggering System

Zi Yuan, Chan ziyuan at smartboxasia.com
Thu Jul 14 18:38:34 CEST 2016


Hi,

I am currently developing an add-on app for dS, and I have some issue when
trying to use the triggering system
(/usr/share/dss/data/scripts/system_register_trigger.js).

Say I have registered a triggering event which look like the following
(property under /usr/triggers/):
http://i.imgur.com/FKhmSpe.png


And when the event is triggered, the following JSON is received backend:
http://i.imgur.com/KHIWMbg.png


Take note on the mode value. Was expecting 'COOL' but received 'COOL&amp'
instead. Seems like the variable separator in URL has been escaped and
unable to roll back.

I'm referring a lot on sonos-controller source code due to the similarity
of the app that I'm going to write. sonos-controller uses triggering system
too:
http://i.imgur.com/QUVnvQQ.png


And I find it weird how did sonos did it. Trying to trace further looking
at the raisedEvent JSON:
http://i.imgur.com/WFWMzxr.png


The '&amp' is still in the value. Thus trace further to the source code i
found:
http://i.imgur.com/KWEooM2.png
(
https://git.digitalstrom.org/dss-add-ons/sonos/blob/master/scripts/executeV2.js#L889
)


IMHO I don't think the code should be written as such. It doesn't fix the
underlying bug but by working around as a fix to make it work.

Thanks for bearing with me, my question for the long email is:
1. Is this issue going to be fixed? May I know where should I file this bug
in gitlab?
2. I find there's lack of documentation on dS built in functions. For
example functions like registerTrigger(). I learned that by reading thru
sonos-controller source code. Would be grateful if someone can point me to
the right link if the documentation exist that I have missed out.

I find there's a few pain points being a dS add-on developer throughout my
developing experience. I will be developing a few more add-ons in the
future to suit our market needs in South East Asia at the same time
bringing value to dS community. However the progress will be slower and
demotivating if some of these issues didn't get improved.

Let me know if there's anything I can be of help to improve the community
experience.



Regards,
Zi Yuan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://forum.digitalstrom.org/pipermail/dss-developer/attachments/20160714/9a13e2d2/attachment.html>


More information about the dss-developer mailing list