File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,20 +29,20 @@ Here's a quick example:
2929``` kotlin
3030import com.openmeteo.api.OpenMeteo
3131
32- fun main () {
33-
34- val openMeteo = OpenMeteo ( City . Amsterdam )
35-
36- val response = openMeteo(
37- ForecastHourly . Rain ,
38- ForecastHourly . Weathercode ,
39- AirQualityHourly . Ozone ,
40- MarineDaily . WaveHeightMax ,
41- ).getOrThrow( )
42-
43- // ... do stuff with response.hourlyValues and .dailyValues
44-
45- }
32+ OpenMeteo ( " Amsterdam " )
33+ .currentWeather( TemperatureUnit . Fahrenheit )
34+ .getOrNull()?. run {
35+
36+ println ( " +-- $city " )
37+ println ( " | Coordinates: [ $latitude , $longitude ] " )
38+ currentWeather?. run {
39+ println ( " | Timestamp: $time " )
40+ println ( " | Temperature: $temperature °F " )
41+ println ( " | Message: $weatherCode " )
42+ println ( " + " )
43+ }
44+
45+ }
4646```
4747
4848<!-- The library includes some examples in the [tests](lib/src/test/kotlin/com/openmeteo/api). -->
You can’t perform that action at this time.
0 commit comments