rahim / nightwear

NightScout standalone Wear 2.0 watchface and complication
GNU General Public License v3.0
12 stars 9 forks source link

Watchface: complication consumer/rendering support #11

Open rahim opened 5 years ago

rahim commented 5 years ago

We already have a complication provider for including nightscout data in other watch faces, but we don't allow adding other complications to our watch face.

https://developer.android.com/training/wearables/watch-faces/adding-complications

Npavkov commented 11 months ago

Rahim, is there a way to make nightwear watchface update every minute?

rahim commented 11 months ago

Rahim, is there a way to make nightwear watchface update every minute?

@Npavkov do you mean the complication or the watch face? (I can't tell whether the issue you've commented on has relevance to your question?)

Trying to answer both though: the complication is limited by constraints placed on it by Wear OS to preserve battery.

you must use a value of at least 300 (5 minutes), which is the minimum update period that the system enforces, to preserve device battery life from https://developer.android.com/training/wearables/tiles/exposing-data-complications#meta-data

The service that pulls data from NightScout and that feeds the watch face tries quite aggressively to retrieve new data, more often than every minute if the latest reading we have is older than 5 minutes. https://github.com/rahim/nightwear/blob/238960abac7a6abbeaa82ba746c5e3f4283bad82/app/src/main/java/im/rah/nightwear/BloodGlucoseService.kt#L106-L121

That's based on an underlying assumption that the sensor isn't providing readings more often than every 5 minutes.

Npavkov commented 11 months ago

Rahim, my sensor does provide readings every minute. Thus I would more like to see the following:

From: Rahim Packir Saibo @.> Sent: Monday, October 16, 2023 7:15 PM To: rahim/nightwear @.> Cc: Npavkov @.>; Mention @.> Subject: Re: [rahim/nightwear] Watchface: complication consumer/rendering support (#11)

Rahim, is there a way to make nightwear watchface update every minute?

@Npavkov https://github.com/Npavkov do you mean the complication or the watch face? (I can't tell whether the issue you've commented on has relevance to your question?)

Trying to answer both though: the complication is limited by constraints placed on it by Wear OS to preserve battery.

you must use a value of at least 300 (5 minutes), which is the minimum update period that the system enforces, to preserve device battery life from https://developer.android.com/training/wearables/tiles/exposing-data-complications#meta-data

The service that pulls data from NightScout and that feeds the watch face tries quite aggressively to retrieve new data, more often than every minute if the latest reading we have is older than 5 minutes. https://github.com/rahim/nightwear/blob/238960abac7a6abbeaa82ba746c5e3f4283bad82/app/src/main/java/im/rah/nightwear/BloodGlucoseService.kt#L106-L121

That's based on an underlying assumption that the sensor isn't providing readings more often than every 5 minutes.

— Reply to this email directly, view it on GitHub https://github.com/rahim/nightwear/issues/11#issuecomment-1765410377 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A7E46IY75I233SMGPCEZSALX7W5VTAVCNFSM4HAB6N4KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGU2DCMBTG43Q . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A7E46I5X5IJK24JG2CMWVWDX7W5VTA5CNFSM4HAB6N4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGONE5AMSI.gif Message ID: @. @.> >

rahim commented 11 months ago

Rahim, my sensor does provide readings every minute.

That's interesting, I'd love to hear what sensor you're using.

Your suggestions are best opened as their own separate issues. Realistically you're unlikely to see these addressed by me anytime soon, I'm not finding time for new feature work for this project.

My intention was always that there would be alternate watch faces providing different aesthetics or servicing different needs (high up my list was a child friendly watch face). The project is structured in a way that it should be achievable for most developers to create their own custom nightscout connected watch faces, I'd hoped I might see some pull requests where these were likely to be useful to more users, but so far that's not happened.

Npavkov commented 11 months ago

Rahim, I use a Libre2 US sensor and it does send readings every minute.

Unfortunately, I have little to no experience at development in languages other than VB.net. But I am usually able to follow other source code in ither languages. I have no experience with Android studio, but would I be able to load your source into that and modify it and recompile a apk for it? I would love to get some knowledge of creating my own Nightscout watchface, but I have been struggling with finding any documentation on how to do that…. Any help or guidance you can give me would be appreciated.

From: Rahim Packir Saibo @.> Sent: Tuesday, October 17, 2023 5:01 AM To: rahim/nightwear @.> Cc: Npavkov @.>; Mention @.> Subject: Re: [rahim/nightwear] Watchface: complication consumer/rendering support (#11)

Rahim, my sensor does provide readings every minute.

That's interesting, I'd love to hear what sensor you're using.

Your suggestions are best opened as their own separate issues. Realistically you're unlikely to see these addressed by me anytime soon, I'm not finding time for new feature work for this project.

My intention was always that there would be alternate watch faces providing different aesthetics or servicing different needs (high up my list was a child friendly watch face). The project is structured in a way that it should be achievable for most developers to create their own custom nightscout connected watch faces, I'd hoped I might see some pull requests where these were likely to be useful to more users, but so far that's not happened.

— Reply to this email directly, view it on GitHub https://github.com/rahim/nightwear/issues/11#issuecomment-1765983123 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A7E46I2XLVTNDLZVKLIEGNDX7ZCODAVCNFSM4HAB6N4KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGU4TQMZRGIZQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A7E46I3AFU3N3744JEHQ4BDX7ZCODA5CNFSM4HAB6N4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGONFBMHEY.gif Message ID: @. @.> >