06.05.2017, 08:02
Hi,
Is it possible to use grp.gettags(alias) directive in Mosaic custom widgets?
I've modified original "light-switch" widget with the following code, but it does not seem to work:
Then I insert this string in _.template section:
But I get an error 'TypeError: this.grp is undefined'.
The idea is to use tags from group addresses to display custom images on switch buttons instead of ON/OFF text, corresponding to the type of lamp its is associated with. Each room has different set of lamps, eg wall lamp, ceiling lamps, table lamp, down lights etc... If we could read tags associated with these lamps (group addresses) - it will be possible to put corresponding images automaticaly.
Thanks for any help.
Is it possible to use grp.gettags(alias) directive in Mosaic custom widgets?
I've modified original "light-switch" widget with the following code, but it does not seem to work:
Code:
readTags : function(i) {
var value = false;
var o = "object-"+i;
if(grp.gettags(o)) value = grp.gettags(o);
return value;
},
Then I insert this string in _.template section:
Code:
<%=readTags(i)%>
But I get an error 'TypeError: this.grp is undefined'.
The idea is to use tags from group addresses to display custom images on switch buttons instead of ON/OFF text, corresponding to the type of lamp its is associated with. Each room has different set of lamps, eg wall lamp, ceiling lamps, table lamp, down lights etc... If we could read tags associated with these lamps (group addresses) - it will be possible to put corresponding images automaticaly.
Thanks for any help.