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

G7 Classic Status page cleanup #3246

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

Navid200
Copy link
Collaborator

There are three items on the classic status page that are not useful for G7.
The reason is that the G7 Bluetooth name is not related to the transmitter ID as it was with G6.

How many people are tapping on forget device thinking that they are unpairing the transmitter?
I did!

If some day, we can figure out a workaround, we can bring them back.
But, for now, please approve removing them.

Screenshot_20231218-174712

@jamorham
Copy link
Collaborator

jamorham commented Dec 23, 2023

So in principle this is a good change I think but I would like you to use some better helper methods to declutter things and avoid duplication.

I will make a change for shortTxId() to be public static, so just use that instead of repeating the check in your own code.

Additionally I will include support for showIfTrue in to that layout, so you can do: app:showIfTrue="@{ms.using_g7()}" to avoid manually handling the visibility.

@Navid200
Copy link
Collaborator Author

Will be tested before tomorrow.

@Navid200
Copy link
Collaborator Author

Tested. Looks OK.
The static page looks as shown above.

@Navid200
Copy link
Collaborator Author

Navid200 commented Jan 2, 2024

I have made the change you asked for and I have tested it.
This is ready for merge.

Comment on lines 44 to 48
public boolean using_g7() { // True if we are using G7
if (DexCollectionType.getDexCollectionType() == DexCollectionType.DexcomG5 && Pref.getBooleanDefaultFalse("using_g6") && shortTxId()) { // If using G7
return true;
}
return false;
Copy link

Choose a reason for hiding this comment

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

return DexCollectionType.getDexCollectionType() == DexCollectionType.DexcomG5 && Pref.getBooleanDefaultFalse("using_g6") && shortTxId()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks a lot. Fixing it in a minute.

@@ -12,4 +12,6 @@ public interface MicroStatus {

boolean xmitterBattery();

boolean using_g7(); // True when using G7
Copy link

Choose a reason for hiding this comment

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

not java style method naming. Java style method naming is camel case
also use java doc for "True when using G7"

public boolean bluetooth() {
return DexCollectionType.hasBluetooth();
public boolean bluetooth() { // Dexcom with Bluetooth except G7
return DexCollectionType.hasBluetooth() && !using_g7();
Copy link

Choose a reason for hiding this comment

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

not sure if you are braking logic for other sensors with the extra check

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know what you mean by that. Please explain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see what you mean now.
First, let me thank you for spending the time to review.

Please let me explain this concern.
There are only two possibilities under all circumstances. Either we are using G7 or not.

If we are not using G7, what is being anded is true. Anding true with anything changes nothing. Therefore, nothing changes with respect to other sensors.

If we are using G7, the returned value becomes false, which removes three lines from the status page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wow! You have a point. There is a third case of the value being unknown. I need to make sure if the value is unknown, it doesn't break anything. Thanks so much.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@DiBochev Is it OK now?

Choose a reason for hiding this comment

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

@Navid200 everything looks fine

@Navid200
Copy link
Collaborator Author

Navid200 commented Jan 5, 2024

Tested again after the syntax correction.

@Navid200
Copy link
Collaborator Author

Navid200 commented Feb 4, 2024

I'm now using ShortTxId. Is anything else needed?

Der-Schubi added a commit to Der-Schubi/xDrip that referenced this pull request Feb 8, 2024
Merge remote-tracking branch 'Navid200/Navid_2023_12_18' into schubi
try { // True if we are using G7
return DexCollectionType.getDexCollectionType() == DexCollectionType.DexcomG5 && Pref.getBooleanDefaultFalse("using_g6") && shortTxId();
} catch (Exception e) { // If there are any unknowns, show that we are not using G7
return false;

Choose a reason for hiding this comment

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

just a suggestion maybe it is good idea to add debug log here

@Navid200
Copy link
Collaborator Author

We now have a best collector option of of G7.
So, to avoid code duplication, I am using that.

I have tested this after this last change with both G7 and G6. There is no change to the classic status page of G6.
For G7, please see the images below.

Before After
Screenshot_20240221-095004 Screenshot_20240221-095115

@Navid200
Copy link
Collaborator Author

Navid200 commented Feb 22, 2024

The option to forget device does not work for G7. And that is why it is important to remove it because everyone is not aware that it does not work:


1

@Navid200 Navid200 requested a review from jamorham March 6, 2024 16:25
@Navid200
Copy link
Collaborator Author

@jamorham
Please merge this also so that people don't think that forget device works for G7.

@jamorham jamorham merged commit a018afb into NightscoutFoundation:master Mar 27, 2024
1 check passed
@Navid200 Navid200 deleted the Navid_2023_12_18 branch May 11, 2024 19:42
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