1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-07 22:22:00 +02:00
Commit Graph

27 Commits

Author SHA1 Message Date
José Rebelo
81aef0bf35 Add support for multiple weather locations
Introduce the concept of primary and secondary weathers:

* Primary weather keeps the same behavior as previously across all weather providers, so it's non-breaking. This location is not necessarily the current location, just the primary weather location set by the user.
* The GenericWeatherReceiver now has a new extra WeatherSecondaryJson, that receives a json list with secondary weather locations.

It's guaranteed that the primary weather always exists, so the list of WeatherSpecs provided to devices is never empty. Update all support classes accordingly.
2024-03-29 21:10:40 +00:00
g_p
7cb7c0ea8a Nothing CMF Watch Pro: Add weather support
This patch adds support for current weather, and next 6 days' weather. Condition mapping added to align with the available icons on the watch.
It also transmits the hourly condition and temperature for the coming 24 hours as part of the update.

Tested on CMF Nothing Watch Pro firmware 11.0.0.50 with weather data cooming from Breezy Weather (using Accuweather)

For current day:
- Weather symbol shows
- Name of current location shows (long names scroll)
- Current temperature shows
- Written condition shows (e.g. "Cloudy")
- Min/max temperatures show
- Air quality indicator shows

For upcoming days:
- Weather symbol shows
- Min/max temperatures show
- Name of day shows (patch doesn't touch this)

Nothing CMF Watch Pro: Use putShort() for air quality indicator; fix max location length

- Using putShort() as suggested from code review - tested to give same result
- Reduced max location length to 16 bytes, as 32 was not working

Nothing CMF Watch Pro: Better handle limited data from weather providers

- Check max length of daily and hourly datasets
- Populate with dummy data if insufficient data available
- Use null as the weather condition in any situation where no data available

Nothing CMF Watch Pro: If hourly weather data is missing, use current data

This should create a better fallback behaviour if a weather source is lacking hour-by-hour data.
Assuming the current data will apply in the next hour is less messy than showing placeholder (inaccurate) figures.

Nothing CMF Watch Pro: Allow location names of up to 30 characters, improve string processing
2024-03-25 22:45:36 +00:00
FYG_license_bot_ignore_me
4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
José Rebelo
99130eb472 Fix closeable file leak on weather cache 2023-10-06 21:38:35 +01:00
José Rebelo
ba565df088 Xiaomi Smart Band 7: Initial support 2022-08-19 23:13:27 +02:00
vanous
e00ee75ad2 adding FitPro bands support 2021-09-21 16:37:19 +02:00
License Bot
d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
Sebastian Kranz
6a04c78b0e Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into zetime 2019-02-20 14:24:59 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
Sebastian Kranz
88ba3e8e14 merge master branch 2018-09-06 14:46:25 +02:00
License Bot
696653eabf Update contributors list and license headers. 2018-08-29 21:30:23 +02:00
Daniele Gobbetti
290c6c53fb Fix wrong mapping yahoo weather conditions to openweathermap. 2018-07-22 16:14:36 +02:00
Sebastian Kranz
c30ec7d407 BUGFIX: use newer weather icons, if firmware build is B41 or higher. The new firmware supports 24 icons, older ones have only 6. 2018-07-16 13:41:59 +02:00
Sebastian Kranz
6882127bec Add function to sync weather data to the watch, translate weather codes to icons. 2018-07-04 07:09:50 +02:00
Daniele Gobbetti
cc83021ae3 Weather (and Pebble Webview): fix name and add wind information to weather data
Wind information are stored and put in the reconstructed OWM response.
A long standing bug (having the "name" field inside "main" instead of at
the root level of the json) has been fixed
Lineage OS receiver and if possible weather notification app receiver will
be added in further commits.

See #482
2018-04-14 19:42:05 +02:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
Andreas Shimokawa
06929d04f9 Pebble: when faking the OWN response also set the "description" field with the current condition
Helps TrekVolle to display weather
2018-02-03 23:08:12 +01:00
Andreas Shimokawa
948002dc7c Weather: recreate OWM fake reply from weatherSpec, no not directly create in in Weather Notification receiver
This should bring CM weather on par with Weather Notficication when using background js
2017-12-14 14:54:09 +01:00
Andreas Shimokawa
9dfde46bb0 Amazfit Bip: send condition string also for forecast days
String for forecasts are looked up from OWM condition ids, while the current condition string is already translated by WeatherNotification
2017-11-30 18:26:10 +01:00
Andreas Shimokawa
0befc1a95e Weather refactoring
No longer save an instance of ParcelableWeather2, rely on our WeatherSpec instead which now has all forecast data and save reconstructed owm weather json in Weather
2017-11-30 10:24:31 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
Daniele Gobbetti
ca73d0c2d4 Add mapping to weather icons 2017-02-27 21:45:10 +01:00
Andreas Shimokawa
984e639e97 Pebble: push current weather to TimeStylePebble again when watchface gets started 2016-12-31 19:17:08 +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
danielegobbetti
d7f4769f57 make the conversion methods static 2016-01-05 16:04:32 +01:00
danielegobbetti
c7c723134e Add weather singleton (to store the whole data passed by weather notification).
Add weather info for TimeStylePebble.
Add further fields to the ParcelableWeather class.
Add reverse mapping to ParcelableWeather to get back the original OpenWeatherMap API condition codes.
2016-01-03 18:28:32 +01:00
danielegobbetti
abb7ed0189 Manual mapping between openweathermap and yahoo weather conditions. 2016-01-03 16:33:48 +01:00