WeatherProps¶
A native component within hitokage
that displays current weather information.
It polls Open Meteo every minute.
Only one location is supported at the moment. The very first instance of Weather being attached to a monitor must contain a latitude and longitude. All other Weather will assume the same location.
See
ComponentProps
Example
The mounted API is documented here:
Weather
Attributes:
attr
class¶
Type: (string|table<number, string>?
Optional css class names. Either space-delimited classes, or an array of class names. Built-in hitokage components will always contain their type as a class name.
attr
format¶
Type: string|ReactiveString|fun(forecast: WeatherForecast):string
A handlebars template string or function accepts WeatherForecast and returns a handlebars template string
attr
halign¶
Type: ('Baseline'|'Center'|'End'|'Fill'|'Start'...(+1))?
Sets the horizontal alignment of widget
. Defaults to 'Fill'
attr
height_request¶
Override for height request of the widget.
If this is -1
, the natural request will be used.
attr
hexpand¶
attr
icons¶
A table of "names" mapped to "icons". Below is the default table, as well as what each name corresponds to in terms of Open Meteo's weather codes (which are themselves based on WMO weather codes).
More details at: https://open-meteo.com/en/docs
These icons are based on the assumption you are using a nerd-font.
Name | Icon | Weather Codes |
---|---|---|
day | "\u{E30D}" | 0 |
day_cloudy | "\u{E302}" | 1, 2, 3 |
day_foggy | "\u{E303}" | 45, 48 |
day_drizzle | "\u{E30B}" | 51, 53, 55 |
day_rain | "\u{E305}" | 61, 63, 65 |
day_showers | "\u{E309}" | 80, 81, 82 |
day_freezing_rain | "\u{E306}" | 66, 67 |
day_snow | "\u{E30A}" | 85, 86 |
day_thunderstorm | "\u{E30F}" | 95 |
day_hail | "\u{E365}" | 96, 99 |
night | "\u{E32B}" | 0 |
night_cloudy | "\u{E37E}" | 1, 2, 3 |
night_foggy | "\u{E346}" | 45, 48 |
night_drizzle | "\u{E328}" | 51, 53, 55 |
night_rain | "\u{E325}" | 61, 63, 65 |
night_showers | "\u{E326}" | 80, 81, 82 |
night_freezing_rain | "\u{E323}" | 66, 67 |
night_snow | "\u{E327}" | 85, 86 |
night_thunderstorm | "\u{E32A}" | 95 |
night_hail | "\u{E367}" | 96, 99 |
unknown | "\u{F128}" | * |
attr
id¶
A unique identifier.
This is not enforced or checked by hitokage, it is simply used in utility methods such
as
Bar:get_child_by_id
or Box:get_child_by_id
.
attr
latitude¶
The latitude of the location to receive weather forecasts for. It is only necessary on the very first declaration of a weather component. Only one location is supported at the moment.
attr
longitude¶
The longitude of the location to receive weather forecasts for. It is only necessary on the very first declaration of a weather component. Only one location is supported at the moment.
attr
valign¶
Type: ('Baseline'|'Center'|'End'|'Fill'|'Start'...(+1))?
Sets the vertical alignment of widget
. Defaults to 'Fill'
.
attr
vexpand¶
attr
width_request¶
Override for width request of the widget.
If this is -1
, the natural request will be used.