hi everyone,
so I tried the invoke() function like the one on the doc for the sensors but for the ActivityMonitor.getInfo()
function getValue(opt){ var W = [:steps,:calories,:floorsClimbed,:activeMinutesWeek,:activeMinutesDay]; if(ActM.getInfo() has W[opt]){ var gM = new Lang.Method(ActM.getInfo(),W[opt]); return gM.invoke(); } return null; }
but it does not work,
I could do var value = [ActM.getInfo().steps, ... ]
but tell me if i'm wrong when value will be calculated it will calculate the whole array with all values?
the purpose is to avoid calculating value which is not needed.
have a great day.