Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openaps.js to recognize the correct spelling of "received" #2785

Merged
merged 3 commits into from
Sep 11, 2017
Merged

Update openaps.js to recognize the correct spelling of "received" #2785

merged 3 commits into from
Sep 11, 2017

Conversation

philipgo
Copy link
Contributor

@philipgo philipgo commented Sep 4, 2017

In OpenAPS the spelling of the word "received" in enacted.json was changed to its correct form from the wrong form "recieved" used in the versions before. This leads to a problem showing OpenAPS as "not enacted" in Nightscout although the OpenAPS rig is working fine (oref0 issue #637)

I made a change to the Nightscout openaps plugin to recognize "recieved" used in the current version of OpenAPS as well as "recieved" used in future versions. Could someone knowledgable please have a thorough look at the changes? It works fine on our heroku Nightscout instance.

Copy link
Contributor

@PieterGit PieterGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one typo in while you were fixing a typo 😄

Please also try to add a test case for the received version in https://github.com/nightscout/cgm-remote-monitor/blob/master/tests/openaps.test.js

, enacted: status.openaps.enacted && status.openaps.enacted.timestamp && status.openaps.enacted.recieved && moment(status.openaps.enacted.timestamp)
, notEnacted: status.openaps.enacted && status.openaps.enacted.timestamp && !status.openaps.enacted.recieved && moment(status.openaps.enacted.timestamp)
, enacted: status.openaps.enacted && status.openaps.enacted.timestamp && (status.openaps.enacted.recieved || status.openaps.enacted.received) && moment(status.openaps.enacted.timestamp)
, notEnacted: status.openaps.enacted && status.openaps.enacted.timestamp && !(status.openaps.enacted.recieved || status.openaps.enacted.recieved) && moment(status.openaps.enacted.timestamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You misspelled recieved in the notEnacted case. Please correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing

Test for devicestatus-entries containing the correct spelling of the word "received" instead of "recieved" in OpenAPS versions 0.6.0 and later
@philipgo
Copy link
Contributor Author

philipgo commented Sep 5, 2017

Hehe, I think I finally got it right :)

@PieterGit
Copy link
Contributor

@drnoname82 : tested and works. This is required for oref0 0.6.0 because that uses the received spelling. oref0 rigs up to version 0.5.3 will use recieved. This patch accepts both at Nightscout side.

@jasoncalabrese @sulkaharo can you review and if ok, merge to dev?

, enacted: status.openaps.enacted && status.openaps.enacted.timestamp && status.openaps.enacted.recieved && moment(status.openaps.enacted.timestamp)
, notEnacted: status.openaps.enacted && status.openaps.enacted.timestamp && !status.openaps.enacted.recieved && moment(status.openaps.enacted.timestamp)
, enacted: status.openaps.enacted && status.openaps.enacted.timestamp && (status.openaps.enacted.recieved || status.openaps.enacted.received) && moment(status.openaps.enacted.timestamp)
, notEnacted: status.openaps.enacted && status.openaps.enacted.timestamp && !(status.openaps.enacted.recieved || status.openaps.enacted.recieved) && moment(status.openaps.enacted.timestamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing

@sulkaharo
Copy link
Member

LGTM

@sulkaharo sulkaharo merged commit e63453c into nightscout:dev Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants