1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-10 15:18:23 +02:00
Commit Graph

168 Commits

Author SHA1 Message Date
José Rebelo
2e8f44cd85 Huami: Fix weekly reminders 2021-12-13 09:24:29 +01:00
José Rebelo
a111272143 Huami: Fix reminder deletion 2021-12-12 10:48:22 +00:00
José Rebelo
710b6f6699 Mi Band 3: Add support for Reminders 2021-12-11 22:39:18 +01:00
Andreas Shimokawa
998f8775d9 Fix bug in non-DST time where still being in DST was assumed
This affects InfiniTime and Huami
For InfiniTime it probably resulted in the wrong time being displayed
For Huami is resulted to request the wrong data from the band/watch

We used timezone.getDSTOffset() which always returns the DST offset (also in non
DST time)

We need to pass the time being observed to calendar.getOffset() to get the real
offset including DST at that specfic time which then either includes DST offset or not.
2021-11-02 11:34:55 +01:00
Andreas Shimokawa
b99da8b596 Mi Band 6: really fix weather on new firmware 2021-09-03 15:50:42 +02:00
Andreas Shimokawa
eb8284f079 Mi Band 6: Fix watchface installation 2021-09-02 13:26:35 +02:00
Andreas Shimokawa
4242f5ccd4 Mi Band 6: Write to chunked2021 for old chunked types on new firmware (fixes music, weather and setting menu items) 2021-09-02 11:21:05 +02:00
Andreas Shimokawa
4a27825931 Mi Band 6: Send all old settings to new characteristics
This adds a compatibility wrapper to make it easier
2021-09-02 11:21:05 +02:00
Andreas Shimokawa
117cd57463 Mi Band 6: Support sending encrypted packets on new firmware 2021-09-02 11:21:05 +02:00
Andreas Shimokawa
44fcd454a0 Mi Band 6: Make new auth protocol a setting for now 2021-08-26 10:59:53 +02:00
Andreas Shimokawa
9bd8424f83 Mi Band 6 auth: first experiments 2021-08-26 10:59:53 +02:00
Andreas Shimokawa
348f459e3f Huami: Send "about you" preferences to device immediately when changing values
Closes #2297
2021-05-27 23:11:00 +02:00
beardhatcode
32a6049207 huami: send windspeed in beaufort (#2247)
fixup! huamni: send windspeed in beaufort

BipS: send windspeed as km/h

huami: Always send sunrise and sunset

There is no need to look at send_sunrise_sunset, this is peble spesific
because it could be annoying on that platform (an extra line in the
timeline). On huami devices, the watchface desides what to show.

Signed-off-by: Robbert Gurdeep Singh <git@beardhatcode.be>

Mi5: set supportsSunriseSunsetWindHumidity to true

Signed-off-by: Robbert Gurdeep Singh <git@beardhatcode.be>

huamni: send windspeed in beaufort

Signed-off-by: Robbert Gurdeep Singh <git@beardhatcode.be>

Co-authored-by: Robbert Gurdeep Singh <git@beardhatcode.be>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2247
Co-Authored-By: beardhatcode <beardhatcode@noreply.codeberg.org>
Co-Committed-By: beardhatcode <beardhatcode@noreply.codeberg.org>
2021-04-21 17:12:20 +02:00
Robbert Gurdeep Singh
2d7bd6ae7b clean: remove unused slots in calander for huami devices
If an event is deleted, it may still remain on the device without this
change
2021-04-21 16:38:36 +02:00
Andreas Shimokawa
9dc4dde5e7 Amazfit Neo: Support sound settings 2021-03-24 20:02:48 +01:00
Andreas Shimokawa
6f6db01bce Fix list exception (regression from previous Neo commit) 2021-03-24 10:49:46 +01:00
Andreas Shimokawa
a234c1d527 Amazfit Neo: Fix setting menu items
- Fixes a bug with cycling through entries
- adds steps, distance, calories, battery
- removes world clock (does not seem to work)
2021-03-24 00:44:13 +01:00
Robbert Gurdeep Singh
7c213f5807 Huami: show event title for events as reminder
The Mi app only has a reminder field and no description field, so
I'm assuming we can only send one string.

In bffb8e8f87 it was noticed that the
title was not displaying so I'm changing this for all Huami devices.
2021-03-14 22:21:58 +01:00
Andreas Shimokawa
54f96288d9 update changelog, bump version 2021-02-09 22:33:17 +01:00
Andreas Shimokawa
6d02e8c488 Amazfit GTS/GTR2 (all variants): Try to fix missing menu items
This was reported in #2189 for the GTS 2 Mini, but let's assume it is the same problem for all variants.
2021-02-07 16:23:45 +01:00
Toby Murray
203176a01e Update GATT characteristic list
The current GATT characteristic list mentions it was up to date as of populated 2015-09-28. In the last 6 years, significantly more characteristics have been added to the Bluetooth spec. While it's not necessary to have all these constants available in Gadgetbridge, it's useful while implementing new features for a device or adding support for a new device

This was retrieved from https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf. The GATT characteristics were parsed from that PDF and converted to constants with names via:

```
String description = uuid.description.trim().toUpperCase().replace(' ', '_').replace('-', '_');
System.out.println("public static final UUID UUID_CHARACTERISTIC_" + description + " = UUID.fromString((String.format(AbstractBTLEDeviceSupport.BASE_UUID, \"" + uuid.uuid + "\")));");
```
2021-01-18 19:38:16 -05:00
License Bot
1b5402dcb4 update license headers 2021-01-10 23:38:13 +01:00
Andreas Shimokawa
c896e476f4 Amazfit GTR2: Try to fix incoming calls blindly 2021-01-06 16:29:11 +01:00
vanous
074bc885c8 send broadcast and vibration on button action only if enabled 2020-12-18 10:56:42 +01:00
Andreas Shimokawa
4fb79ac2b2 Huami: Add new option to disting to properly distinguish connected adverising and 3rd party hr exposure 2020-12-13 22:38:03 +01:00
Andreas Shimokawa
d0c5ffec28 Amazfit Bip S: Fix crash with notifictions with only a title (GitNex does this)
Probably affects other newer Huami devices
2020-12-02 17:07:40 +01:00
Andreas Shimokawa
9d6f9f7d57 Huami: Unify menu id lookup tables and simplify code 2020-11-10 21:56:00 +01:00
Andreas Shimokawa
5b55898059 Mi/Amazfit Band 5: Add support for setting/sorting shortcuts 2020-11-10 11:33:37 +01:00
Andreas Shimokawa
f178c478c9 Amazfit Bip: Also make shortcuts sortable 2020-11-07 22:48:34 +01:00
Andreas Shimokawa
d20e6516c8 Humai: Implement menu sorting for remaining devices (except Mi Band 2) 2020-11-07 22:48:34 +01:00
Andreas Shimokawa
8cb2fb980a Ímplement sorting menu items for newer Huami devices
- Amazfit GTR/GTS
- Amazfit Bip S
- Mi Band 5/Amazfit Band 5
2020-11-07 22:48:34 +01:00
Andreas Shimokawa
1224cfeffc Amazfit Bip S: unify shortcuts code with display items code 2020-10-28 00:12:37 +01:00
Andreas Shimokawa
50f99a5b59 Amazfit Bip S Lite: add new device type for the lite variant
See #2055
2020-10-27 12:56:27 +01:00
Andreas Shimokawa
4131f19f8d Amazfit Band 5: Allow setting Sp=2
Also unify code to set display items on newer devices
2020-10-21 20:03:26 +02:00
Andreas Shimokawa
f4115fa617 Amazfit Bip S: Also send wind and humidity
Does not work with most weather sources, but it is better to send something to remove garbled characters
2020-09-30 18:47:19 +02:00
Andreas Shimokawa
1337644a14 Amazfit Bip S: Send sunrise and sunset on latest firmware if enabled
This still has to be enabled in Pebble settings..... :/
2020-09-30 18:16:25 +02:00
TaaviE
6cd59fbd24 Refactored all pairing and bonding activities (#1989)
Fixed a few warnings

Refactored all bonding and bonding activities

Co-authored-by: TaaviE <taavi.eomae+github@gmail.com>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/1989
2020-08-28 15:38:18 +02:00
vanous
20faa23843 Add events forwarding for HUAMI Bip, MB3 (#1980)
Remove unneeded function call

Re-done to simplify

Add media actions

Rename function to make meaning clearer

Add events forwarding for HUAMI Bip, MB3

Co-authored-by: vanous <petr@linuks.cz>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/1980
2020-08-16 22:07:55 +02:00
Andreas Shimokawa
a619fdb168 Huami: Prevent setting an MTU of < 23, which is either a special value or a parsing error of Gadgetbridge
This fixes a problem where writeToChunked algorithm results in out of bounds writes or an endless loop.

Closes #1936
2020-08-02 13:11:41 +02:00
Andreas Shimokawa
ef09e24482 Amazfit GTS: Fix broken activity data on Firmware 0.0.9.xx
Fixes #1924
2020-07-22 11:03:30 +02:00
Andreas Shimokawa
3940387b1a Huami: set forecast limit to 6 days (current + 6 in future) 2020-06-29 19:41:56 +02:00
Andreas Shimokawa
b7a1f469ee Huami: limit forecast days to 3 days
Fixes problems with new weather notificaion on Mi Band 4 and others
Fixes #1910
2020-06-29 19:02:30 +02:00
Andreas Shimokawa
5d58a2f583 Work around music controls being disabled since last commit on Amazfit Cor (we do not get a music app started event before we haven't sent music information - weird) 2020-06-22 18:35:22 +02:00
Andreas Shimokawa
6b20f62e0f Huami: Use music control code from Bip S for all devices
needs testing and cleanup for all devices
2020-06-22 18:06:40 +02:00
Zhong Jianxin
55f9c8f519 Huami: Avoid cutting multibyte chars in half 2020-06-22 10:12:10 +02:00
Zhong Jianxin
c3a9cf858e Amazfit Bip S: Allow longer notification message 2020-06-16 13:41:26 +08:00
Zhong Jianxin
44a9ce0267 Amazfit Bip S: Music support 2020-06-08 16:16:33 +02:00
Zhong Jianxin
c0558c570c Huami: Check if musicSpec/stateSpec is null 2020-06-08 16:16:33 +02:00
Zhong Jianxin
8d145917f5 Huami: Use equals to compare musicspec/statespec 2020-05-19 23:08:46 +08:00
Zhong Jianxin
fc39221782 Amazfit Bip S: Support setting shortcuts 2020-05-14 10:05:49 +08:00
Andreas Shimokawa
e844f81056 Huami: If no menu items were ever configured with Gadgetbridge use our default and do not disable everything on connect
Fixes #1853
2020-05-12 22:42:19 +02:00
Andreas Shimokawa
fefcf2d2b9 ZeTime: Fix setting the watch language and make the setting accessible from the per-device configuration menu
This did not work at all before, it was supposed to take the language from
Gadgetbridge App settings or the phone's default settings, but nothing was ever
sent to the watch.
2020-05-05 00:34:59 +02:00
Andreas Shimokawa
33a1dbd1cd Amazfit GTS: Fix setting menu items with low mtu 2020-04-29 14:44:58 +02:00
Andreas Shimokawa
89017ac58f Huami: Disable air quality indicator on Huami devices instead of showing 0
Thanks @ponyzucker

Closes #1834
2020-04-08 12:02:47 +02:00
Andreas Shimokawa
ea606713d7 Huami: Igore all-day events when syncing calendar events 2020-03-20 17:21:20 +01:00
Andreas Shimokawa
8cf7e259aa Huami: Fix crash when calendar event desctription or title was null
Fixes #1813
2020-03-04 23:13:57 +01:00
cpfeiffer
eb8e37d3a6 Sanity check for alarms index to avoid AIOOBE 2020-02-26 22:25:03 +01:00
Andreas Shimokawa
9a114f640b Huami: Make experimental calendar sync feature optional 2020-02-24 14:19:06 +01:00
Andreas Shimokawa
bffb8e8f87 Huami: send upcoming calendar events as reminder
TODO: make this optional, fix title not being displayed, do it proberly like we do on pebble
2020-02-19 09:41:50 +01:00
Andreas Shimokawa
71b76c8e8f Huami: add unused and untested co to send upcoming calender events as notifications 2020-02-18 22:20:57 +01:00
Andreas Shimokawa
3226d61ecd Mi Band 4: Make high MTU support optional
Fixes #1766
2020-02-04 10:04:01 +01:00
Dmitry Markin
10c9b07c69 Control alarm snooze mode on MiBand2 2020-01-12 12:02:04 +03:00
License Bot
d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
vanous
7394b1cce3 Add-Buttons-Events-Config (#1761) 2020-01-08 19:58:31 +01:00
Andreas Shimokawa
1c82c4e8e1 Huami: make time format 12h/24h configurable (was automatic before)
Fixes #1736
2020-01-04 23:40:50 +01:00
vanous
50defa1eb6 Add broadcast sender/receiver to ConfigureAlarms/HuamiSupport
This is to prevent discrepancies if user edits alarms in Gadgetbridge
and also on the device at the same time.
2019-12-29 11:07:42 +01:00
Andreas Shimokawa
3bf72f957a Huami: get alarms at connect and save changes to database, react to on-device changes immediatly when device is connected 2019-12-27 22:19:17 +01:00
Andreas Shimokawa
6548802abc fix regression from latest commit where Mi Band 3 could not longer connect 2019-12-26 23:26:08 +01:00
Andreas Shimokawa
45c40825f3 Mi Band 4: Support MTU that gets reported from the Band
In my case that boosts the MTU from 23 to 247, firmware updates and watchface
istallations are extremely fast. This also affects notifications, weather etc.
2019-12-26 23:05:13 +01:00
Andreas Shimokawa
21eada4caa Allow to set alarms to unused when long tapping
This helps clearing up a cluttered alarms list on devices like the Mi Band 4

Difference between disabling and setting to usused:
Unsused alarms cant be enabled from the Band, disabled can.

Closes #1747
2019-12-24 01:27:57 +01:00
Andreas Shimokawa
72ffbca2ff Make "reserve alarm for calender" per-device and only allow for Mi Band 1/2
This avoids a lot of bugs and confision regarding alarms
2019-12-14 23:48:02 +01:00
Andreas Shimokawa
e5f5a671bd Amazfit Bip: Make vibration after button action work 2019-11-21 13:24:06 +01:00
Andreas Shimokawa
25bb16b0c3 Make button action setting per-device, enable for amazfip bip
TODO:
- preference migration
- support vibration on bip
2019-11-14 12:33:36 +01:00
Andreas Shimokawa
2b0656c9c0 Amazfit GTS: Enable flashing firmware (untested) 2019-10-31 15:30:05 +01:00
Andreas Shimokawa
a3cd99a4a3 Huami: move notification code from AmazfitBipSupport to HuamiSupport
probably fix notifications on GTS
2019-10-31 14:28:24 +01:00
Andreas Shimokawa
b5e9727dcd Make some more settings per-device settings
- All ID115 settings migrated, allowing removal from settings activity
- All timeformat settings for all devices migrated
- All wrist location settings for all devices migrated (now you can have a mi band 3 on the left wrist and a bip  on the right wrist :P)

Also deduplicated some strings from zetime/generic preferences
2019-10-05 22:35:30 +02:00
Andreas Shimokawa
876515f1fd Amazfit Cor: support custom emoji font
This commit refactors code and implements a custom device specific string
filter, which does nothing by default.
The implementation in HuamiSupport does the custom emoji conversion.

The setting has been moved from devicesettings_amazfitbip.xml to an extra file
As soon as there is a custom font for Mi Band 2/3/4 it is sufficient to add
"devicesettings_custom_emoji_font.xml" to the list of supported settings
in the appropriate coordinator and everything will work.
2019-09-14 00:05:39 +02:00
Andreas Shimokawa
ce9eab8def Mi Band 4: really fix sending weather location
Really fixes #1609
2019-08-31 22:14:50 +02:00
Andreas Shimokawa
8f4489a21c Mi Band 4: Fix call notifcation not stopping when call gets answered or rejected on the phone
This changes the way to how to stop call notification for all Huami device back to Mi Band 2
Also clean up unused code

Fixes #1612
2019-08-29 08:32:29 +02:00
Andreas Shimokawa
243eec042d Mi Band 3/4, Amazfit Bip/Cor: Add setting to expose the HR sensor to 3rd party apps
Closes #1606
2019-08-27 11:13:45 +02:00
Andreas Shimokawa
d07ca6faa6 Mi Band 4: Fix location not being updated on the Band
Also move generic code from AmazfitBipSupport to HuamiSupport where is belongs
Fixes #1609
2019-08-25 09:56:06 +02:00
Andreas Shimokawa
aefd7520f3 Mi Band 3/4, Amazfit Cor/Bip: set language immediately when changing it (not only on connect)
Helps testing
2019-08-02 00:11:11 +02:00
Andreas Shimokawa
b6e78c1b9c Mi Band 4: Support flashing watchfaces
FLASHING FIRMWARE/RES/FONT IS STILL UNTESTED
2019-07-25 20:51:28 +02:00
Andreas Shimokawa
a60268c05c Mi Band 4: Bring your own key support (blindly done, I dont have my key)
THIS STILL REQUIRES MI FIT AND YOUR EXTRACTED KEY

HOWTO:
1) press + button in Gadgerbridge
2) LONG PRESS Mi Band 4
3) Tap "Auth Key"
4) Enter your key prefixed with 0x (eg. 0x112233445566778899aabbccddeeff00)
5) Go back
6) Tap Mi Band 4

Success? You tell me.
2019-07-23 08:56:26 +02:00
Andreas Shimokawa
8d50e8ef08 Mi Band 3: Allow setting date format in per-device settings
Closes #1544
2019-07-16 23:48:08 +02:00
Andreas Shimokawa
d779310962 Move "activate display on lift wrist" and "rotate wrist to switch info" to per-device settings
"activate display on lift wrist" for Mi Band 2/3, Cor, Bip
"rotate wrist" only for Mi Band 2
2019-06-05 16:00:18 +02:00
Andreas Shimokawa
16090f0e21 Move fake device offset to Mi Band 1 preferences, remove support for other devices
Reasons for removal:
- I doubt we honored the offset correctly for new features anyway that are available on newer devices
- Newer devices have a display always displaying the wrong time
2019-06-05 14:11:44 +02:00
Andreas Shimokawa
12e16ac04a add ignoring calls support to Amazfit Bip (probably Cor also and maybe Mi Band 3) 2019-05-25 22:19:19 +02:00
Andreas Shimokawa
93f288b936 Move "Do not disturb" settings from Mi Band / Amazfit settings to per-device settings (Mi Band 2 and Mi Band 3 only) 2019-05-24 23:47:57 +02:00
Andreas Shimokawa
3440485a51 Mi Band 2: move settings to per-device settings 2019-05-23 21:33:35 +02:00
Andreas Shimokawa
038f101a12 Migrate more settings to per-device settings
Also add icons.
2019-05-22 10:49:59 +02:00
Andreas Shimokawa
9bfef4cf4f Make per-device settings more versatile, move more settings
This allows to construct per-device settings by device type very easily

device coordinators just do the following to declare which setting they support,
the settings activity is then composed at runtime.

@Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
     return new int[]{
            R.xml.devicesettings_miband3,
            R.xml.devicesettings_swipeunlock,
            R.xml.devicesettings_pairingkey
    };
}
2019-05-22 00:42:22 +02:00
Andreas Shimokawa
49667451d7 Mi Band 3: fix setting language (regression after todays refactoring) 2019-05-20 23:27:17 +02:00
Andreas Shimokawa
08e7d728c2 Huami: Migrate some settings to device specific settings
- Migrate language setting
- Migrate menu items setting
- Migrate lastsync timestamp from prefixed global shared prefercence

All settings should be automatically be converted (e.g. Amazfit Bip settings to all paired Amazfit Bip devices) and then deleted.

Cor Settings aleady completely vanished from the global settings menu.

When migration is done we will have a much cleaner settings menu. Will also remove confusion that some Cor settings have to be done in Bip settings.
2019-05-20 16:36:06 +02:00
License Bot
9aadb2f2fd Update license headers 2019-04-21 18:53:10 +02:00
Sebastian Kranz
6a04c78b0e Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into zetime 2019-02-20 14:24:59 +01:00
Sebastian Kranz
a7553188f9 Reading the device preferences from the watch and set them in the ZeTime menu. 2019-02-20 14:09:21 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
Andreas Shimokawa
c66fade081 Amazfit Bip: Support disconnect notifications
Might also work with Cor, did not work with Mi Band 3
2019-02-13 13:06:42 +01:00
Daniele Gobbetti
75d3dffb14 Migrate to androidx support libraries and bump compile SDK version
"Optimize imports" has been run on all source files, there might be
unrelated changes, but these should be harmless.
2019-01-26 16:00:56 +01:00