Module: Toybox.Weather

Overview

The Weather module provides functionality for accessing information related to the current weather.

Since:

API Level 3.2.0

Supported Devices:

Classes Under Namespace

Classes: CurrentConditions, DailyForecast, HourlyForecast

Constant Summary

Condition

Since:

API Level 3.2.0

Name Value Since Description See Also
CONDITION_CLEAR 0

API Level 3.2.0

Clear

CONDITION_PARTLY_CLOUDY 1

API Level 3.2.0

Partly cloudy

CONDITION_MOSTLY_CLOUDY 2

API Level 3.2.0

Mostly cloudy

CONDITION_RAIN 3

API Level 3.2.0

Rain

CONDITION_SNOW 4

API Level 3.2.0

Snow

CONDITION_WINDY 5

API Level 3.2.0

Windy

CONDITION_THUNDERSTORMS 6

API Level 3.2.0

Thunderstorms

CONDITION_WINTRY_MIX 7

API Level 3.2.0

Wintry mix

CONDITION_FOG 8

API Level 3.2.0

Fog

CONDITION_HAZY 9

API Level 3.2.0

Hazy

CONDITION_HAIL 10

API Level 3.2.0

Hail

CONDITION_SCATTERED_SHOWERS 11

API Level 3.2.0

Scattered showers

CONDITION_SCATTERED_THUNDERSTORMS 12

API Level 3.2.0

Scattered thunderstorms

CONDITION_UNKNOWN_PRECIPITATION 13

API Level 3.2.0

Unknown precipitation

CONDITION_LIGHT_RAIN 14

API Level 3.2.0

Light rain

CONDITION_HEAVY_RAIN 15

API Level 3.2.0

Heavy rain

CONDITION_LIGHT_SNOW 16

API Level 3.2.0

Light snow

CONDITION_HEAVY_SNOW 17

API Level 3.2.0

Heavy snow

CONDITION_LIGHT_RAIN_SNOW 18

API Level 3.2.0

Light rain snow

CONDITION_HEAVY_RAIN_SNOW 19

API Level 3.2.0

Heavy rain snow

CONDITION_CLOUDY 20

API Level 3.2.0

Cloudy

CONDITION_RAIN_SNOW 21

API Level 3.2.0

Rain snow

CONDITION_PARTLY_CLEAR 22

API Level 3.2.0

Partly clear

CONDITION_MOSTLY_CLEAR 23

API Level 3.2.0

Mostly clear

CONDITION_LIGHT_SHOWERS 24

API Level 3.2.0

Light showers

CONDITION_SHOWERS 25

API Level 3.2.0

Showers

CONDITION_HEAVY_SHOWERS 26

API Level 3.2.0

Heavy showers

CONDITION_CHANCE_OF_SHOWERS 27

API Level 3.2.0

Chance of showers

CONDITION_CHANCE_OF_THUNDERSTORMS 28

API Level 3.2.0

Chance of thunderstorms

CONDITION_MIST 29

API Level 3.2.0

Mist

CONDITION_DUST 30

API Level 3.2.0

Dust

CONDITION_DRIZZLE 31

API Level 3.2.0

Drizzle

CONDITION_TORNADO 32

API Level 3.2.0

Tornado

CONDITION_SMOKE 33

API Level 3.2.0

Smoke

CONDITION_ICE 34

API Level 3.2.0

Ice

CONDITION_SAND 35

API Level 3.2.0

Sand

CONDITION_SQUALL 36

API Level 3.2.0

Squall

CONDITION_SANDSTORM 37

API Level 3.2.0

Sandstorm

CONDITION_VOLCANIC_ASH 38

API Level 3.2.0

Volcanic ash

CONDITION_HAZE 39

API Level 3.2.0

Haze

CONDITION_FAIR 40

API Level 3.2.0

Fair

CONDITION_HURRICANE 41

API Level 3.2.0

Hurricane

CONDITION_TROPICAL_STORM 42

API Level 3.2.0

Tropical storm

CONDITION_CHANCE_OF_SNOW 43

API Level 3.2.0

Chance of snow

CONDITION_CHANCE_OF_RAIN_SNOW 44

API Level 3.2.0

Chance of rain snow

CONDITION_CLOUDY_CHANCE_OF_RAIN 45

API Level 3.2.0

Cloudy chance of rain

CONDITION_CLOUDY_CHANCE_OF_SNOW 46

API Level 3.2.0

Cloudy chance of snow

CONDITION_CLOUDY_CHANCE_OF_RAIN_SNOW 47

API Level 3.2.0

Cloudy chance of rain snow

CONDITION_FLURRIES 48

API Level 3.2.0

Flurries

CONDITION_FREEZING_RAIN 49

API Level 3.2.0

Freezing rain

CONDITION_SLEET 50

API Level 3.2.0

Sleet

CONDITION_ICE_SNOW 51

API Level 3.2.0

Ice snow

CONDITION_THIN_CLOUDS 52

API Level 3.2.0

Thin clouds

CONDITION_UNKNOWN 53

API Level 3.2.0

Unknown

Instance Method Summary collapse

Instance Method Details

getCurrentConditions() as Weather.CurrentConditions or Null

Get the most recently cached weather conditions

Returns:

Since:

API Level 3.2.0

getDailyForecast() as Lang.Array<Weather.DailyForecast> or Null

Get the daily forecast

Returns:

Since:

API Level 3.2.0

getHourlyForecast() as Lang.Array<Weather.HourlyForecast> or Null

Get the hourly forecast

Returns:

Since:

API Level 3.2.0

getSunrise(location as Position.Location, date as Time.Moment) as Time.Moment or Null

Get sunrise time for the provided location and date

Parameters:

  • location(Position.Location)

    Location to get the sunrise information

  • date(Time.Moment)

    date to get the sunrise information

Supported Devices:

Returns:

  • Time.Moment

    Sunrise time as moment or null if no sunrise time is available

Since:

API Level 3.3.0

getSunset(location as Position.Location, date as Time.Moment) as Time.Moment or Null

Get sunrise time for the provided location and date

Parameters:

Supported Devices:

Returns:

  • Time.Moment

    Sunset time as moment or null if no sunset time is available.

Since:

API Level 3.3.0


Generated Dec 11, 2024, 8:58:44 AM