jinks_widgets.weather.weatherio¶
This file contains the icon weather widget class.
Functions
|
Converts the API string to a known weather font cloud character, taking in account day and nighttime. |
|
Get the data for the weather widgets. |
|
Is the provided datetime in the day time inclusively. |
Classes
|
Parsed weather data from Tomorrow.io API. |
Class defining the weather icon widget which shows the current weather symbol. |
|
Class defining the weather large widget which shows the upcoming weather. |
|
|
- class jinks_widgets.weather.weatherio.WeatherTimestampForecast(time, temperature, precipitation, sky_appearance)¶
Bases:
object- time: datetime¶
- temperature: int¶
- precipitation: int¶
- sky_appearance: int¶
- __init__(time, temperature, precipitation, sky_appearance)¶
- class jinks_widgets.weather.weatherio.WeatherData(request_response)¶
Bases:
objectParsed weather data from Tomorrow.io API.
- timestamps: list[WeatherTimestampForecast]¶
- sunrise_today: datetime¶
- sunset_today: datetime¶
- sunrise_tomorrow: datetime¶
- sunset_tomorrow: datetime¶
- utc_time_zone = tzutc()¶
- timezone = tzlocal()¶
- date_format = '%Y-%m-%dT%H:%M:%SZ'¶
- timelines = 'timelines'¶
- hourly = 'hourly'¶
- daily = 'daily'¶
- time = 'time'¶
- values = 'values'¶
- sunriseTime = 'sunriseTime'¶
- sunsetTime = 'sunsetTime'¶
- temperatureApparent = 'temperatureApparent'¶
- precipitationProbability = 'precipitationProbability'¶
- weatherCode = 'weatherCode'¶
- __init__(request_response)¶
- weather_timelines: dict¶
- classmethod convert_tz(datetime)¶
- Return type:
datetime
- set_sunrise_sets()¶
- Return type:
None
- set_hourly()¶
- Return type:
None
- jinks_widgets.weather.weatherio.get_weather_data(token, location)¶
Get the data for the weather widgets.
- Return type:
WeatherData|None
- jinks_widgets.weather.weatherio.is_daytime(datetime, weather_data)¶
Is the provided datetime in the day time inclusively.
- Return type:
bool
- jinks_widgets.weather.weatherio.convert_sky_appearance(cloud, datetime, weather_data)¶
Converts the API string to a known weather font cloud character, taking in account day and nighttime.
- Return type:
str
- class jinks_widgets.weather.weatherio.WeatherIcon¶
Bases:
objectClass defining the weather icon widget which shows the current weather symbol.
It obtains its data from the
weather.Dataand then computes the image based on it.- width: int = 3¶
- height: int = 3¶
- color = 'BWG'¶
- font_sizes = {40: 55}¶
- classmethod data(token, location)¶
Get the current weather data.
- Return type:
WeatherData|None
- classmethod display(density, widget_data)¶
Ran by the jinks_core library to compute data and obtain the widget’s image.
- Return type:
Image
- class jinks_widgets.weather.weatherio.WeatherLarge¶
Bases:
objectClass defining the weather large widget which shows the upcoming weather.
It obtains its data from the
weather.Dataand then computes the image based on it.- width: int = 12¶
- height: int = 4¶
- color = 'BWG'¶
- font_sizes = {40: 30}¶
- weather_categories: dict[str, dict[str, float]] = {'precipitation': {'size': 1.0}, 'sky': {'size': 1.2}, 'temperature': {'size': 1.2}, 'temperature_plot': {'size': 1.0}, 'time': {'size': 1.2}}¶
- static data(token, location)¶
Get the current weather data.
- Return type:
WeatherData|None
- classmethod display(density, widget_data, timestamps=8, format=None)¶
Ran by the jinks_core library to compute data and obtain the widget’s image.
- Return type:
Image