Skip to content

Commit

Permalink
v1.1 added call to getCurrentUserInfo in poll() - to be executed once…
Browse files Browse the repository at this point in the history
… a day
  • Loading branch information
yracine committed Aug 12, 2015
1 parent d203496 commit 9a8fc2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions MyNeurio.devicetype.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright 2015 Yves Racine
* linkedIn profile: ca.linkedin.com/pub/yves-racine-m-sc-a/0/406/4b/
* Refer to readme file for installation instructions.
* V1.0
* V1.1
*
* Code: https://github.com/yracine/device-type.myneurio
*
Expand Down Expand Up @@ -302,12 +302,15 @@ void poll() {
generateEvent(dataEvents)
String dateInLocalTime = new Date().format("yyyy-MM-dd", location.timeZone)

// generate the stats only once every day

if (state.lastGeneratedDate != dateInLocalTime) {

// refresh the sensor info once a day
getCurrentUserInfo()
if (settings.trace) {
log.debug "poll>about to generateSampleStats,dateInLocalTime=${dateInLocalTime},state.lastGeneratedDate= $state.lastGeneratedDate"
}
// generate the stats only once every day

generateSampleStats("")
state.lastGeneratedDate= dateInLocalTime
Expand Down

0 comments on commit 9a8fc2e

Please sign in to comment.