Commit Graph

838 Commits (1ddea9268d08edaf4b71c587e6db37017ea55c8b)

Author SHA1 Message Date
Alberto f3edf7559d HPlus: added low battery information (#638)
HPlus: Notification of low battery

I added the notification of low battery HPlus ... specifically, I used
the HPlusConstants.DATA_STATS event on hplusSupport

I also included the status of the device in the list of
gbdevice -> getDeviceInfos
2017-04-06 23:55:29 +02:00
Andreas Shimokawa e4c7a921ea Pebble: try to improve 70% to 60% battery level accuracy 2017-04-02 00:12:19 +02:00
Daniele Gobbetti 8fccbe3b69 Pebble: implement battery display in control center
- extract the millivolts reading from the analytics datalog message and map to percentage
- mapping is manually made and is possibly wrong, but the values are commented
- the values are sent once per hour and are delayed, this might make the reading really inaccurate on pebble time round watches
2017-03-31 18:23:02 +02:00
Andreas Shimokawa 562049296c Pebble: fix datalogging
Was broken after 0.18.4
2017-03-30 23:01:40 +02:00
Andreas Shimokawa b25bc66485 Allow Datalog handlers to return GBDeviceEvent[] 2017-03-28 09:51:06 +02:00
cpfeiffer da9742fd67 Mi1: Attempt to recognize Mi1 model with hwVersion = 8
Closes #364
2017-03-20 23:25:42 +01:00
cpfeiffer b97674ba85 Mi2: Display realtime steps in Live Activity #428
Thanks for the hint!
2017-03-20 23:01:28 +01:00
License Bot 6a842c52fa Update license header in all java files. 2017-03-16 17:36:15 +01:00
cpfeiffer d408be5ec8 Mi2: make text/icon notifications confiurable and version dependent 2017-03-15 00:26:39 +01:00
cpfeiffer 2d60beea1f Mi2: added some more tested firmware/font versions 2017-03-14 22:59:48 +01:00
Alberto 6989ca9db3 Add privacy mode that hides the phone number (#588) 2017-03-14 21:45:36 +01:00
cpfeiffer 17ecee0cab Mi2: initial support for text notifications and icons
See #560
2017-03-14 00:45:54 +01:00
cpfeiffer 8fc6dfeca7 Improved AlertNotificationProfile
AlertLevel, AlertCategory, Control Point
2017-03-14 00:45:54 +01:00
Andreas Shimokawa fe870ebc77 Move step goal generic, show proper sleep goal in weekly sleep goal
It is now also accessible via "About You" but still remains in the Mi Band Settings
(because it has to be setup initially by a "wizard")
2017-03-11 11:34:03 +01:00
Translation Bot 05a28cc580 Pebble: Fix screenshots for Android N
This was a regression only in master since we switched to SDK 25

This commit also fixes all other warnings with AbstractDeviceSupport.java
2017-03-10 23:10:40 +01:00
License Bot e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
cpfeiffer 6282597790 Handle BT issues with discovered characteristics
It occurred to me that onServicesDiscovered() was called multiple times
whenever I connected to my Mi Band 2. Either the band actually sent the
characteristics in multiple chunks or Android itself notified multiple
times.

So we gracefully handle this by
- updating the list of characteristics
- *not* initializing the device again when it *is* already initialized
or at least initializing.
2017-03-09 22:49:13 +01:00
cpfeiffer 9411f80440 Mi2: support for updating firmware fonts (*.ft, *.ft.en)
This is related to #560, but alas is not sufficient for enabling text
notifications.
2017-03-07 23:26:41 +01:00
cpfeiffer 2b17d7fb14 More cleanup 2017-03-07 00:06:35 +01:00
cpfeiffer 31e0e9a5f7 Mi2: More internal cleanup from initial Mi1 copy&paste 2017-03-05 21:45:39 +01:00
cpfeiffer f6bee00582 Mi2: some internal cleanups/renamings 2017-03-05 21:27:47 +01:00
cpfeiffer c56b655b48 Mi2: send text notification for mi2 only, not mi1a 2017-03-05 10:43:19 +01:00
cpfeiffer 09967b2006 Mi2: follow 12h/24h system configuration
=> Remove custom preference option, #573
2017-03-03 22:32:54 +01:00
cpfeiffer 82ea5702c5 Mi2: configurable time format (12h/24h)
Fixes #573
2017-03-03 22:14:28 +01:00
cpfeiffer 4419200624 Mi2: Initial support for textual notifications #560 2017-03-03 20:12:43 +01:00
cpfeiffer 19b0e5e801 Centralize icons for devices 2017-02-26 22:46:49 +01:00
Andreas Shimokawa 08080b02bb Drop support for legacy (pre 0.12.0) database 2017-02-23 22:44:44 +01:00
cpfeiffer 337bfa1938 Handle button presses and log them
See #556
2017-02-21 21:41:21 +01:00
Andreas Shimokawa 2dbda6138b Pebble: some cleanups and simplifications for datalogging via PebbleKit 2017-02-20 22:09:00 +01:00
Andreas Shimokawa ad9cfae6f9 Pebble: Pass datalog creation timestamp to PebbleKit, properly announce PebbleKit datalogging support 2017-02-20 08:47:42 +01:00
Andreas Shimokawa 946ed5f000 Pebble: First shot at implementing dataloggin for PebbleKit apps
Closes #497
Could help #316
2017-02-19 23:02:55 +01:00
Avamander 23f2dd35d4 Extract music shuffle and repeat states and set the song progress to auto-update. (#554) 2017-02-17 09:01:37 +01:00
Andreas Shimokawa a26563d6c7 Pebble: also acknowledge PebbleKit intents with transaction_id -1
I don't understand why this should be necessary but for some 3rd party apps it helps (#509)
2017-02-13 22:27:37 +01:00
Andreas Shimokawa 1d1edd41d7 Pebble 2/LE: remove a sleep which might be no longer necessary
Will speedup data transfer
2017-02-12 23:13:24 +01:00
Avamander fea31924ba Music data handling improvements (#550)
* Fixed extracting the track length.

* Added current track and total track count.

* Few small changes to make sure everything gets updated properly.

* Remove unnecessary includes.
2017-02-11 09:49:01 +01:00
Andreas Shimokawa 5dfd40062f fix previous commit 2017-02-10 23:16:36 +01:00
Andreas Shimokawa f956d94181 Pebble: make sure to not display "open on phone" and "dismiss" when the source of a notification was our AlarmClockReceiver 2017-02-10 23:11:21 +01:00
Andreas Shimokawa ee28ccd4fe Pebble: add a dev option to always and immediately ACK PebbleKit messages to the watch
Might help #509
2017-02-10 23:07:36 +01:00
Andreas Shimokawa f35e3e460d remove K9 receiver as is works better with generic notifications 2017-02-09 17:35:46 +01:00
Andreas Shimokawa c0076b20d3 fix copy and pasta error 2017-02-09 17:24:07 +01:00
Andreas Shimokawa 5bb1995eb9 Pebble: fix privacy mode title being "null" in some cases 2017-02-09 17:10:39 +01:00
cpfeiffer 4f0674d038 Support for alarm clock notifications for Mi1 + Mi2 #538
No support for Pebble and HPlus for now.

Atm relies on the CM deskclock alarm, which nicely broadcasts
events about the current alarm. See
https://github.com/CyanogenMod/android_packages_apps_DeskClock.git
2017-02-07 23:49:10 +01:00
Andreas Shimokawa e2b3394900 made caller privacy pebble setting generic 2017-02-07 10:15:23 +01:00
Andreas Shimokawa b6852308b7 Merge pull request #546 from jpbarraca/hplus-preferences
HPlus: add device specific preferences and icon
2017-02-06 18:50:40 +01:00
Andreas Shimokawa 32a326c24b Merge pull request #543 from jpbarraca/hplus-alarm-clear
HPlus: Clear Alarms
2017-02-06 18:49:28 +01:00
João Paulo Barraca 475426c0ed Merge branch 'master' into hplus-preferences 2017-02-06 01:39:45 +00:00
João Paulo Barraca a3cc84c01d HPlus: add device specific preferences and icon 2017-02-06 01:33:15 +00:00
João Paulo Barraca 644c06df68 HPlus: Clear alarms if no alarm is enabled 2017-02-05 23:52:36 +00:00
Daniele Gobbetti b7bad268c2 Pebble: support weather for Obsidian
Ref: #482
2017-02-05 17:21:04 +01:00
Daniele Gobbetti dccd6c1b06 Pebble: implement privacy modes
The user can choose whether to completely hide the notification text or push it off-screen. This also effects the incoming call notification.
Fixes #370
2017-02-05 16:37:59 +01:00
João Paulo Barraca 006a23dfe8 HPlus: Fix time sync and Time format (12/24) 2017-02-03 19:30:59 +00:00
Andreas Shimokawa 22cf74bbd1 Merge pull request #532 from jpbarraca/alarm
HPlus: Working alarms and small cleanup
2017-02-03 14:02:29 +01:00
Daniele Gobbetti e08a900978 Refactor the MusicPlaybackReceiver and related files
Add actions to the filter (this should help with #536)
Add "copy" constructors to MusicSpec and MusicStateSpec, and use those when receiving an updated intent, this way partial updates do not disrupt the local information.
Iterate over incoming extra keys, explicitly check the incoming type and use only known type. This could help with #533

Possible problem: this code iterates over every key of the incoming bundle.
2017-02-01 22:55:40 +01:00
João Paulo Barraca f79e8f8833 HPlus: Working alarms and small cleanup 2017-01-30 23:37:47 +00:00
ivanovlev 2d3907b0f0 Fix issue #522 : Transliterate Caller Name 2017-01-27 23:16:19 +03:00
Andreas Shimokawa e19ea26478 Merge pull request #513 from ivanovlev/master
Simplification of transliteration integration
2017-01-26 16:13:54 +01:00
João Paulo Barraca b3e1cbf55e HPlus: Support of Makibes F68 and small fixes to HPlus devices 2017-01-26 13:02:58 +00:00
cpfeiffer ac68bfe351 Mi Band 1+2: backend implementation of making BT pairing optional
- cleaned up the DeviceService.connect() variants
- discovery: pass the device candidate around instead of the mac address

Attempts to fix #512, #514, #518
2017-01-26 00:16:38 +01:00
Andreas Shimokawa 25433ef6bc Pebble: do not display a toast when watchapp configuration could not be found during initialization of appmessage handler
Unfortunately all users without TimeStyle installed got an error in Gadgetbridge 0.17.2
2017-01-24 23:12:36 +01:00
Andreas Shimokawa 4f45ad660d Pebble: refactor PebbleKit stuff into its own class 2017-01-24 22:56:09 +01:00
ivanovlev 06295abcb6 Simplification of transliteration integration 2017-01-24 21:04:06 +03:00
Andreas Shimokawa a451b5367b Pebble: dynamic key support for Square handler 2017-01-24 19:02:45 +01:00
Andreas Shimokawa 712ce1aa8b Pebble: dynamic keys support for healthify 2017-01-24 18:50:43 +01:00
Andreas Shimokawa 3233432ee1 Pebble: simplify AppMessageHandler 2017-01-24 18:38:26 +01:00
Andreas Shimokawa 3dd058cf81 Merge pull request #517 from jpbarraca/hplus-fix-3
HPlus: Improve display of new messages and phone calls
2017-01-24 12:05:02 +01:00
Andreas Shimokawa fb7db523c7 Pebble: dynamic appKey suppoort for Morpheuz 2017-01-24 11:58:13 +01:00
João Paulo Barraca b4a4b3916a HPlus: Remove LanguageUtils transliterate from HPlusSupport 2017-01-24 10:39:24 +00:00
Andreas Shimokawa 746eeda777 Pebble: use dynamic appkeys for TrekVolle handler 2017-01-24 11:07:49 +01:00
Andreas Shimokawa 8027b8ac96 Pebble: fix potential crash when encoding appmessages with null values 2017-01-24 11:07:00 +01:00
Andreas Shimokawa 378d285b1a Merge pull request #515 from jpbarraca/hplus-fix-2
HPlus: Fix bug related to steps and heart rate
2017-01-24 08:21:07 +01:00
João Paulo Barraca 1f083041b9 HPlus: Improve display of new messages and phone calls 2017-01-24 01:44:30 +00:00
João Paulo Barraca c4a0c60b8c HPlus: Fix bug related to steps and heart rate 2017-01-22 23:33:30 +00:00
Andreas Shimokawa c39318af05 CHANGELOG, bump version, improve strings about transliteration 2017-01-22 22:30:40 +01:00
Daniele Gobbetti a7a37fd9c8 Pebble: add a method to use the JSON keys instead of hardcoding the key ID.
This needs parsing the json but it is only done once. So far only Timestyle apphandler uses the new approach and this fi_xes the issue reported here https://github.com/Freeyourgadget/Gadgetbridge/issues/482#issuecomment-273757492
Fixes also a potential crash when the message for pebble contained a null key in one of the Pairs
2017-01-20 19:17:00 +01:00
Carsten Pfeiffer 31ccaf361b Merge pull request #500 from ivanovlev/master
Transliterate unsupported Russian characters into English
2017-01-19 23:42:56 +01:00
Andreas Shimokawa 26a751977e Pebble: try to improve PebbleKit compatibility
(Might help with glance #506)
2017-01-18 22:10:10 +01:00
ivanovlev cbc91e7fef Moving transliteration call from module "HPlus" to common support 2017-01-17 23:07:12 +03:00
Carsten Pfeiffer e226a97c73 Merge pull request #503 from jpbarraca/hplus-fix-1
HPlus: fixed bug setting current date
2017-01-17 00:04:39 +01:00
João Paulo Barraca 5222cf99a2 HPlus: fixed bug setting current date 2017-01-16 22:04:52 +00:00
ivanovlev 074394cba4 Transliteration is moved to a separate class, added settings option 2017-01-15 12:24:36 +03:00
ivanovlev b9249065eb Fix for send message from debug screen 2017-01-14 23:01:44 +03:00
ivanovlev c873312831 Transliterate unsupported Russian characters into English 2017-01-14 02:39:36 +03:00
Andreas Shimokawa 38e234552d Pebble: only ACK appmessages from pebble to pebblekit android apps after the app actually sent one 2017-01-13 08:16:33 +01:00
Andreas Shimokawa 0218cee0e1 Pebble: fix long standing bug in uuid encoding for ACK messages (did not seem to do any harm) 2017-01-11 23:42:40 +01:00
Andreas Shimokawa 50cb3c9db3 Pebble: remove null termination from cstrings when converting to json for PebbleKit 2017-01-11 22:39:08 +01:00
Andreas Shimokawa 185605211d Pebble: fix bug in PebbleKit implementation regarding binary data transferred from a watchapp to a 3rd party Android app
(Fixes a bug with TCW)
2017-01-10 22:30:55 +01:00
Carsten Pfeiffer d646b6773e Merge pull request #491 from jpbarraca/hplus-handle-data
HPlus: Improves device support
2017-01-10 20:40:07 +01:00
Andreas Shimokawa f2e6ce6380 Pebble: fix incoming calls (recently broken) 2017-01-10 18:23:35 +01:00
João Paulo Barraca b92b1c08bf HPlus: Fix deprecation warning 2017-01-10 13:44:32 +00:00
João Paulo Barraca 13ec497127 Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into hplus-handle-data 2017-01-10 13:23:23 +00:00
João Paulo Barraca 4cf872664c HPlus: Improved support for storing and displaying data. 2017-01-10 13:08:45 +00:00
Andreas Shimokawa 3644d5e7a6 Pebble: remove notifications when dismissed on the phone (#326)
Most of the code is generic, so it could be implemented by other devices.
I dont know what happens if multiple messages arrive in the same notification.
So, this is experimental.
2017-01-09 16:33:00 +01:00
Andreas Shimokawa c6999713d2 Pebble: use Notifications system app as parent UUID for notifications 2017-01-09 15:11:50 +01:00
Andreas Shimokawa f05b51fd83 Pebble: Add option to disable call display
Closes #494
2017-01-09 14:41:02 +01:00
cpfeiffer 6c269aa089 Generic characteristic names from field names 2017-01-08 21:37:43 +01:00
Andreas Shimokawa 855a141ec4 Pebble: in AppMessageHandler provide a default implementation of handleMessage which just ACKs 2017-01-08 17:17:29 +01:00
Daniele Gobbetti 1fda1ba1b2 Pebble: try to get rid of the sleep and rely on countdownlatch instead.
Could help with #494
2017-01-08 16:48:50 +01:00
Daniele Gobbetti 09cc0134db Pebble: add support for weather in some watchfaces by gh/zalewszczak
See https://github.com/zalewszczak/pebble for a list of watchfaces
#482
2017-01-08 15:27:01 +01:00
Daniele Gobbetti 7f50e0d2b7 Pebble: add support for weather in square watchface
So far celsius are forced for temperature #482
2017-01-07 22:41:10 +01:00
João Paulo Barraca 970c6960ea HPlus: delay day slot fetch 2017-01-05 14:24:39 +00:00
João Paulo Barraca ade7161c4d HPlus: Buffer Day Slot data before commit to DB 2017-01-05 14:03:49 +00:00
João Paulo Barraca d491921b1c HPlus: Rename HPlusHandlerThread method 2017-01-05 10:36:22 +00:00
João Paulo Barraca 93ae57bd60 Refactoring class HPlusDataRecordDaySummary 2017-01-05 10:33:37 +00:00
João Paulo Barraca 051d1e7390 HPlus: fix typo 2017-01-05 00:17:28 +00:00
João Paulo Barraca ae0718c398 HPlus: Refactoring and added comments to the message decoders members 2017-01-05 00:03:54 +00:00
João Paulo Barraca 510427e30b HPlus: Refactoring. Calendar -> GregorianCalendar 2017-01-04 23:41:35 +00:00
João Paulo Barraca 91b346b23d HPlus: Enabled decoding of additional fields in day summary message 2017-01-04 23:24:17 +00:00
João Paulo Barraca 9d67394720 HPlus: Code cleanup 2017-01-04 01:46:24 +00:00
João Paulo Barraca 1fb4ee8a8f HPlus: Basic support for data synchronization 2017-01-02 00:58:37 +00:00
Andreas Shimokawa 507e58922f Pebble: fix decoding of byte and short appmessage data (when a native handler is present) 2017-01-01 17:58:34 +01:00
Andreas Shimokawa f25605f5a1 Pebble: First shot at TrekVolle support
Also some cleanups
2017-01-01 16:24:46 +01:00
Andreas Shimokawa 8b55110679 Pebble: allow weather to be send to watchfaces on fw < 4.x 2017-01-01 14:19:35 +01:00
Andreas Shimokawa 1722a6dc47 Pebble: minor code cleanup 2017-01-01 13:55:07 +01:00
Andreas Shimokawa 7930b7da75 Pebble: Support Healthify Weather 2016-12-31 20:08:53 +01:00
Andreas Shimokawa 5a83cb1c48 Pebble: fix npe in mario time handler
I shout stop for 2016! :D
2016-12-31 19:29:41 +01:00
Andreas Shimokawa b811247704 Pebble: Adapt MarioTime logic 2016-12-31 19:27:21 +01:00
Andreas Shimokawa 984e639e97 Pebble: push current weather to TimeStylePebble again when watchface gets started 2016-12-31 19:17:08 +01:00
Andreas Shimokawa 4e543d4b34 Pebble: rename pushMessage() to onAppStart() 2016-12-31 19:04:05 +01:00
Andreas Shimokawa 82c0f35c58 Pebble: add encodeUpadteWeather() to AppMessageHandler for easier watchface support
Now in Timestyle weather is in sync with what we get from weather notification
2016-12-31 18:56:24 +01:00
Andreas Shimokawa 266c6b8817 Pebble: send weather to Pebble when we get notified by weather notification 2016-12-31 15:56:05 +01:00
Andreas Shimokawa f12e786837 Pebble: fix mario time appmessage handler (weather condition icon hardcoded to sunny for now) 2016-12-31 13:33:50 +01:00
Andreas Shimokawa 95e6d2c740 Pebble: delete WeatherNeat handler, it was only used for testing and the watchface seems outdated 2016-12-31 12:35:40 +01:00
Andreas Shimokawa 4631e5bbaf Pebble: restore find lost device feature abused for testing 2016-12-31 12:15:44 +01:00
Daniele Gobbetti e477d22c88 Pebble: support the system weather app.
- enable/disable weather app from the watchapp list
- convert weather data to a format that can be displayed by the system app

TODO: send the weather data periodically
2016-12-30 20:14:13 +01:00
Daniele Gobbetti 0e9ce5d186 Pebble: get min/max temperature also for the forecast 2016-12-30 19:58:56 +01:00
Andreas Shimokawa 240c81ecb4 Pebble: implement weather related protocol encoding
this is not yet connected to anything...
2016-12-30 15:26:44 +01:00
Andreas Shimokawa b045d5ac26 Merge branch 'master' into feature-weather 2016-12-30 00:10:54 +01:00
cpfeiffer 5d3c45d2c0 Mi2: Remember and use last synced timestamp in preferences
(instead of using the last sample's timestamp in the database.
The database also contains manual hr measurements and live activity
samples, so we would miss activity data before the last manual
measurement.

Closes #478
2016-12-29 23:23:20 +01:00
cpfeiffer aadde7d1ca Port to UriHelper, fix potential resource leak 2016-12-29 01:41:47 +01:00
João Paulo Barraca a135f51d31 HPlus: Improve initial configuration process and refactor constants 2016-12-28 13:53:17 +00:00
João Paulo Barraca fed5638782 HPlus: Refactor Sex into Gender and convert value appropriatelly 2016-12-28 13:50:56 +00:00
Andreas Shimokawa bcb522d2d0 Merge branch 'master' into feature-weather 2016-12-27 13:51:39 +01:00
Andreas Shimokawa 440a5e071f Try to support "Subsonic" android app (#474) 2016-12-26 23:53:24 +01:00
Andreas Shimokawa 16d9279728 Merge branch 'master' into feature-weather 2016-12-26 23:03:11 +01:00
cpfeiffer da494cde7b Handle live activity for Mi2 and Mi1 in the same way #448
Realtime samples now use ActivitySample.NOT_MEASURED for unknown or
invalid values.
2016-12-26 12:51:12 +01:00
cpfeiffer 8719cadc43 Mi Band: fix live activity messing up stepcount #448
live samples now report relative steps, not absolute to the current
day's stepcount.

Also live samples' steps should NOT be added to the database since
they are already counted in the regular stepcount.
2016-12-26 01:38:20 +01:00
cpfeiffer 305bd7600c Fix current realtime steps calculations #450
timestamp is already in seconds instead of milliseconds

Also: port to REALTIME_SAMPLES
2016-12-26 00:23:02 +01:00
cpfeiffer 999d3e3252 Mi1: Attempt at throttling notifications during sync #438 2016-12-25 23:27:56 +01:00
Andreas Shimokawa 6c5b51cd6d Merge branch 'master' into feature-weather 2016-12-25 22:53:44 +01:00
Carsten Pfeiffer a84bc16503 Merge pull request #470 from jpbarraca/hplus
Add preliminary support for HPlus devices: Zeblaze Zeband and others
2016-12-25 21:33:52 +01:00
João Paulo Barraca 649e20ad04 HPlus: Ignore duplicated messages from band 2016-12-24 00:05:51 +00:00
João Paulo Barraca 88f2d2ee4f HPlus: Fixed notification title size 2016-12-23 12:20:06 +00:00
João Paulo Barraca cd915598b0 HPlus: Improved handling of incomming calls 2016-12-23 11:46:20 +00:00
João Paulo Barraca 9dd5967f4e HPlus: Set date and time on connect 2016-12-23 10:14:03 +00:00
João Paulo Barraca 9a338c9bae HPlus: Fix text notification length 2016-12-23 01:35:18 +00:00
João Paulo Barraca 2b78f2708f Cleanup according to PR Review 2016-12-23 01:21:05 +00:00
João Paulo Barraca ae9ebc1be8 Refactoring some parts. Added support for param synchronisation with band 2016-12-21 23:57:57 +00:00
João Paulo Barraca 5b3ef8999f Add preliminary support for HPlus devices, such as the Zeblaze Zeband (and many others)
Working: Text and call notifications, setting most user data, date and time, heart rate monitoring, sleep monitoring (alfa)
2016-12-21 12:51:25 +00:00
Andreas Shimokawa 2148b431ea Merge branch 'master' into feature-weather 2016-12-19 23:32:53 +01:00
Andreas Shimokawa bd5dc6bfbc Pebble 2/LE: Add setting to limit the MTU (for debugging broken BLE stacks) 2016-12-19 23:28:06 +01:00