piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

Weather Service rework #308

Closed jmlich closed 8 months ago

jmlich commented 10 months ago

We would like to rework weather service to be simpler. It should work according following description:

simple BLE API : it currently just take a 6 bytes buffer: [0] = PacketType (only the value "0" is implemented, but this will allow for extensions in the future) [1][2] = Temperature (16bits) [3] = Precipitation type [4] = Precipitation amount [5] = Cloud amount

and... that's it! Amazfish just has to send the current values whenever they are updated.

jmlich commented 10 months ago

I suggest to reuse openweathermap structures as much as possible. If we are free to send anything then I would like to see following structure:

[1] = PacketType = 0
[2] = Temperature now [100 *Kelvins?] (2 decimals in fixed point)
[2] = Temperature min (same as ^)
[2] = Temperature max (same as ^)
[1] = icon id (0-17) according to https://openweathermap.org/weather-conditions#Weather-Condition-Codes-2
[1] = clouds [%]
[1] = humidity [%]
[2] = wind degress [deg] (* 100 , 2 decimals in fixed point)
[2] = wind speed [m/s] (same ^)
[2] = wind gusts [m/s] (same ^)
//[10] = date time in Current Time Service Format // see /daemon/src/services/currenttimeservice.cpp
[openweathermap.org](https://openweathermap.org/weather-conditions)

I have drafted some required updates, however changes infinitime code are required.

jmlich commented 9 months ago

There is a next version of spec: Current weather info:

Forecast for the next few days (max 3/5 days).

Notes: