LowPowerLab Forum

Software support => Pi Gateway => Topic started by: loseymark on May 18, 2016, 08:23:22 PM

Title: icon as value in metrics.js
Post by: loseymark on May 18, 2016, 08:23:22 PM
Is it possible to display an icon as the value supplied in metrics.js?
Title: Re: icon as value in metrics.js
Post by: Felix on May 19, 2016, 08:05:02 AM
Quote from: loseymark on May 18, 2016, 08:23:22 PM
as the value supplied in metrics.js

What is "the value"?
I think the answer is no, not unless you make changes of where the icon comes from. Currently the icons are defined as part of the node types.
Title: Re: icon as value in metrics.js
Post by: loseymark on May 20, 2016, 04:01:30 PM
I'm guessing no too

in the metrics entry I would like to display an icon instead of the text 'Closed/Closed'
//GDPIMote metrics
  BC : { name:'GDState', regexp:/DS\:0/i, value:'Closed/Closed', unit:'', pin:1, },
Title: Re: icon as value in metrics.js
Post by: syrinxtech on May 20, 2016, 04:31:07 PM
I think it would be neat if the icon could change depending on some state/metric.

ie, the icon for a water leak detector could change from something indicating dry to a picture of a wet floor (or some other ridiculous example).
Title: Re: icon as value in metrics.js
Post by: Felix on May 22, 2016, 10:13:07 PM
@syrinxtech
Yeah you can totally do that, you will need to hack a little at my gateway.js. I haven't built this in but it could be considered as a feature to add in the future.
Thanks for the suggestion.