-
Notifications
You must be signed in to change notification settings - Fork 212
Added loop status support for pebble showing TBR + IOB #42
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
base: master
Are you sure you want to change the base?
Conversation
| @Override | ||
| public void startDeviceCommand() { | ||
| sendData(); | ||
| Handler handler = new Handler(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what this delay is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This delay is necessary to display the latest loop status. AAPS needs some connection and action time for setting treatment data. Without delay, outdated (5min) loop data will be shown on the watchface. The delay time depends on connection speed of pump model. Dana R is faster than Combo and i think 20sec should be enough. For Combo users maybe 30-40sec would be necessary. The best solution would be to send a new packet to the pebble right after the StatusLine has been updated.
|
Hi there, I am sympathetic to what you're trying to do with this PR but there are problems with this implementation. So I'm adding facilities to make doing this cleanly much easier. The PR doesn't have sufficient consideration for the use case where the user isn't using AAPS or discontinues using AAPS. For example if the status line is There is a base class for pebble watch faces and it makes sense to ensure that the communication protocol for the watch faces is shared by all. So I've moved the existing keys in to the base class to make this clearer. Your existing TBR and IOB key numbers would clash with the implementation of trend. So those will need to be renumbered. See here: I've adapted the The mechanism for retrieving the status line currently will return This means we can make the sending of these records to the watch face conditional on whether there is any data to send, eg whether someone is even using AAPS or if they stop using it then after 8 hours the data will effectively be cleared out. The watch face similarly can be made to only alter the display if IOB and TBR data is presented so that existing users will not notice any change unless they are using AAPS. We also can control the sending of this through a pebble setting within xDrip+ to give even more control. This also gives us portability to add the same data keys in to the Trend watch face. 7e68733#diff-21b6faa660d6896fd19381c1d6f262b3 Please let me know if you think what I've done so far makes sense |
|
we did something similar for wear complication, now it looks to me we store two times the loopstatus in the persistent, could this be the case? |
|
Yes @jamorham , you're right! My thoughts were that there will be 2 standard watchfaces and if a pebble loop option is enabled the loop-face will be installed on watch. I don't have that android coding skills to implement a pebble broadcast after loop status was updated. That is the reason why i had done this in the easy rookie way via a delay ;) |
|
@gregorybel Isn't it just forwarded to wear but not actually stored on the phone side but then is stored on the wear side? I don't think that should matter too much. |
|
@JoernL Well I think that the ideal is that there is a single version of each type of watch face and that if loop data is present then it can show on the watch face via conditional code. I did already unify the code for the color and classic trend watch faces in to a single one and there hasn't been any development on the other watchfaces for some time. Can you upload a screenshot/photo of how this should look on the watchface you have produced so far so I can see how the data is presented? |
|
No problem, i will post it tomorrow. |
|
you are certainly right, I missed where storage is done, sorry. |
|
I have included all your patches and temporary modified it to work with the standard watchface (IOB_KEY,TBR_KEY numbers + copied getIOB() and getTBR() to PebbleDisplayStandard). Works |
|
When will this be implemented on the xDrip+ interface? (IOB through the watchface to Pebble). I'm on a 640g, using Lennarts app to get the info from the pump and then xDrip+ to send it to my watch. I don't go directly through Nighstcout since it's only me and an extra phone contract is expensive here (Spain). As it is, I don't get the IOB or COB info that the transmitter phone is mining from the pump, and if posible I would love to have them. Thanks! |
|
Hi, I didn't know where to comment, but can I request you guys to modify the app to accept data from miaomiao attached to libre freestyle pro? The app accepts data from libre freestyle and not from the pro one. I get checksum failed. Please help, and let me know where I should comment if this isn't the right place for it. Thanks in advance |
|
Quite the old thread, but can we get IOB on xDrip? It would be nice for the watch. |
The data is send to the watch with a delay of 20sec because of connection + reaction time to the pump. The delay can be modified in Line 39.