bigdigital / watchdrip

GNU General Public License v3.0
42 stars 13 forks source link

Support receiving snooze command #4

Open Andries-Smit opened 1 year ago

Andries-Smit commented 1 year ago

The watch should also be snoozed when a user snoozes a (high BG) alarm through his phone. Similar to the original implementation https://github.com/NightscoutFoundation/xDrip/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/AlertPlayer.java#L237

Please add support in Watchdrip to receive CMD_SNOOZE_ALERT https://github.com/NightscoutFoundation/xDrip/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Services/broadcastservice/Const.java#L22

bigdigital commented 1 year ago

Hi. this command is implemented in wathdrip app. The alarm snooze should work. Yesterday tested snoozing on GTR2 mini watch

Andries-Smit commented 1 year ago

@bigdigital Snooze watch -> phone does work, but the other way; phone -> watch does not. When snoozed on the phone, the me-band 5 is still "calling."

atomphil commented 1 year ago

@bigdigital Snooze watch -> phone does work, but the other way; phone -> watch does not. When snoozed on the phone, the me-band 5 is still "calling."

Same here with Bip S and Bip S lite.

bigdigital commented 1 year ago

Ah, i see. Thank you for the clarification. It seems it will require a small PR to xdrip

atomphil commented 1 year ago

Update: alarm handling is still buggy in v0.2.0.2 on Bip S and Bip S lite.

  1. alarms are first displayed as a normal notification and only on the second or third time as a call
  2. when I confirm the alarm call on the watch, it is not snoozed in xDrip and snoozing confimation message is sent.
bigdigital commented 1 year ago

Update: alarm handling is still buggy in v0.2.0.2 on Bip S and Bip S lite.

  1. alarms are first displayed as a normal notification and only on the second or third time as a call
  2. when I confirm the alarm call on the watch, it is not snoozed in xDrip and snoozing confimation message is sent.

This is a little different problem than described in this issue. I guess found the problem, it seems related to the library update. Switched back to an old library and looks like there is no such problem. Can you check https://www.dropbox.com/s/xaksfgukrdydabr/WatchDrip_v0.2.0.3.apk?dl=0 ?

Andries-Smit commented 1 year ago

@bigdigital it crashes when opening with the following error:

FATAL EXCEPTION: main Process: com.thatguysservice.huami_xdrip, PID: 25085 java.lang.ExceptionInInitializerError at com.thatguysservice.huami_xdrip.models.UserError$Log.d(UserError.java:328) at com.thatguysservice.huami_xdrip.utils.bt.ConnectReceiver.onReceive(ConnectReceiver.java:42) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4881) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2417) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8741) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.activeandroid.TableInfo com.activeandroid.ModelInfo.getTableInfo(java.lang.Class)' on a null object reference at com.activeandroid.Cache.getTableInfo(Cache.java:148) at com.activeandroid.Model.(Model.java:54) at com.thatguysservice.huami_xdrip.models.PlusModel.(PlusModel.java:6) at com.thatguysservice.huami_xdrip.models.UserError.(UserError.java:65) at com.thatguysservice.huami_xdrip.models.UserError.UserErrorHigh(UserError.java:93) at com.thatguysservice.huami_xdrip.models.UserError$Log.wtf(UserError.java:306) at com.thatguysservice.huami_xdrip.models.Pref.initializePrefs(Pref.java:31) at com.thatguysservice.huami_xdrip.models.Pref.getStringDefaultBlank(Pref.java:71) at com.thatguysservice.huami_xdrip.models.UserError$ExtraLogTags.(UserError.java:356) at com.thatguysservice.huami_xdrip.models.UserError$Log.(UserError.java:348) at com.thatguysservice.huami_xdrip.models.UserError$Log.d(UserError.java:328)  at com.thatguysservice.huami_xdrip.utils.bt.ConnectReceiver.onReceive(ConnectReceiver.java:42)  at android.app.ActivityThread.handleReceiver(ActivityThread.java:4881)  at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2417)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:226)  at android.os.Looper.loop(Looper.java:313)  at android.app.ActivityThread.main(ActivityThread.java:8741)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) 

atomphil commented 1 year ago

This is a little different problem than described in this issue. I guess found the problem, it seems related to the library update. Switched back to an old library and looks like there is no such problem. Can you check https://www.dropbox.com/s/xaksfgukrdydabr/WatchDrip_v0.2.0.3.apk?dl=0 ?

Thanks for the quick bugfix. I have tried it out: The problem seems to be solved. The alarms come immediately and also the confirmation works again.

atomphil commented 1 year ago

This is a little different problem than described in this issue. I guess found the problem, it seems related to the library update. Switched back to an old library and looks like there is no such problem. Can you check https://www.dropbox.com/s/xaksfgukrdydabr/WatchDrip_v0.2.0.3.apk?dl=0 ?

Thanks for the quick bugfix. I have tried it out: The problem seems to be solved. The alarms come immediately and also the confirmation works again.

Rejoiced too soon :-/ Today Watchdrip showed the old incorrect behavior again. Only a few times the alarm shown as the notification direction. Then alerted as a call, but did not respond to the confirmation and did not snooze the alarm. Watchdrip shows something like "Waiting for user response" as status but didn't respond to the confirmation.

4RK4N commented 1 year ago

any way to get this working on zeppOS devices ? but since watchdrip is not connecting directly to the watch it might not be possible at all. no way to trigger a phone call from the fetchAPI or any other means without direct connection (which then breaks zepp app and fetch api). "Notify for GClock" from the official watch appstore has similar problems: once set up it works but ONLY if you open the watchapp yourself. no popup with the snooze buttons either when an alarm goes off. afaik there is no "open watchapp triggered from the phone" functionality.