Skip to content

Commit

Permalink
feat(weather): add units configuration for weather data and enhance w…
Browse files Browse the repository at this point in the history
…eather card styles
  • Loading branch information
amnweb committed Jan 10, 2025
1 parent dd960cb commit 20d65d0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/widgets/(Widget)-Weather.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| `update_interval` | integer | `3600` | The interval in seconds to update the weather data. Must be between 60 and 36000000. |
| `hide_decimal` | boolean | `False` | Whether to hide the decimal part of the temperature. |
| `location` | string | `'London'` | The location for which to fetch the weather data. |
| `units` | string | `'metric'` | The units for the weather data. Can be `'metric'` or `'imperial'`. |
| `api_key` | string | `'0'` | The API key for accessing the weather service. |
| `icons` | dict | `{ 'sunnyDay': '\ue30d', 'clearNight': '\ue32b', 'cloudyDay': '\ue312', 'cloudyNight': '\ue311', 'rainyDay': '\udb81\ude7e', 'rainyNight': '\udb81\ude7e', 'snowyIcyDay': '\udb81\udd98', 'snowyIcyNight': '\udb81\udd98', 'blizzard': '\uebaa', 'default': '\uebaa' }` | A dictionary of icons for different weather conditions. |
| `callbacks` | dict | `{ 'on_left': 'do_nothing', 'on_middle': 'do_nothing', 'on_right': 'do_nothing' }` | Callbacks for mouse events on the weather widget. |
Expand All @@ -21,6 +22,7 @@ weather:
api_key: "209841561465465461" # Get your free API key from https://www.weatherapi.com/
update_interval: 600 # Update interval in seconds, Min 600 seconds
hide_decimal: true
units: "metric" # Can be 'metric' or 'imperial'
location: "Los Angeles, CA, USA" # You can use "USA Los Angeles 90006" {COUNTRY CITY ZIP_CODE}, or just city.
callbacks:
on_left: "toggle_card"
Expand Down Expand Up @@ -57,6 +59,7 @@ weather:
- **hide_decimal:** Whether to hide the decimal part of the temperature.
- **location:** The location for which to fetch the weather data. You can use example "USA Los Angeles 90006" {COUNTRY CITY ZIP_CODE}, or just city. Location can be set to `env`, this means you have to set `YASB_WEATHER_LOCATION` in environment variable or you can set it directly in the configuration file.
- **api_key:** The API key for accessing the weather service. You can get free API key `weatherapi.com`. API key can be set to `env`, this means you have to set `YASB_WEATHER_API_KEY` in environment variable or you can set it directly in the configuration file.
- **units:** The units for the weather data. Can be `'metric'` or `'imperial'`.
- **icons:** A dictionary of icons for different weather conditions `sunnyDay`, `sunnyNight`, `clearDay`, `clearNight`, `cloudyDay`, `cloudyNight`, `rainyDay`, `rainyNight`, `snowyIcyDay`, `snowyIcyNight`, `blizzard`, `default`.
- **weather_card:** Configuration for the weather card popup display. Controls visibility, appearance, and positioning.
- **enabled:** Enable weather card.
Expand Down Expand Up @@ -85,5 +88,25 @@ weather:
.weather-widget .icon.snowyIcyNight {}
.weather-widget .icon.blizzard {}
.weather-widget .icon.default {}
/* Weather card style */
.weather-card {
background-color: rgba(17, 17, 27, 0.5);
}
.weather-card-today {}
.weather-card-today .label {
font-size: 12px;
}
.weather-card-today .label.location {
font-size: 24px;
font-weight: 700;
}
.weather-card-day {
border: 1px solid #45475a;
border-radius: 8px;
background-color: rgba(17, 17, 27, 0.2);
}
.weather-card-day .label {
font-size: 12px;
}
```

0 comments on commit 20d65d0

Please sign in to comment.