diff options
| author | Mitsuo Tokumori <[email protected]> | 2025-03-08 01:30:17 +0900 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2025-03-08 01:30:17 +0900 |
| commit | ec80766af5e2f59f3842b613f271c1100705af5e (patch) | |
| tree | 4798439deb8b0a951ebb924d4739b05ca27577b3 /block_weather.py | |
| parent | 304d0a2c3e0e1eea58d6db1762c1b96e450b5843 (diff) | |
| download | masu-ec80766af5e2f59f3842b613f271c1100705af5e.tar.gz masu-ec80766af5e2f59f3842b613f271c1100705af5e.tar.bz2 masu-ec80766af5e2f59f3842b613f271c1100705af5e.zip | |
Change block layout, add time visualization
Block layout is now flex.
Diffstat (limited to 'block_weather.py')
| -rw-r--r-- | block_weather.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block_weather.py b/block_weather.py index dc041fd..4443de3 100644 --- a/block_weather.py +++ b/block_weather.py @@ -22,7 +22,7 @@ def get_current_weather(city: str) -> dict: data['summary'] = _format_current_weather(data) # On icon URL codes: https://openweathermap.org/weather-conditions#Weather-Condition-Codes-2 - data['icon_url'] = f"https://openweathermap.org/img/wn/{data['weather'][0]['icon']}@2x.png" + data['icon_url'] = f"https://openweathermap.org/img/wn/{data['weather'][0]['icon']}.png" return data @@ -34,7 +34,7 @@ def _format_current_weather(data: dict) -> str: {data['weather'][0]['description']} {data['main']['temp']}°C (feels like {data['main']['feels_like']}°C), humidity: {data['main']['humidity']}%, pressure: {data['main']['grnd_level']} hPa visibility: {data['visibility']/1000:.1f}km -wind: {data['wind']['speed']}m/s from {data['wind']['deg']}°N (with gusts of {data['wind'].get('gust', 0)} m/s) +wind: {data['wind']['speed']}m/s from {data['wind']['deg']}°N clouds: {data['clouds']['all']}% sunrise & sunset: {ts[1].strftime('%H:%M')}, {ts[2].strftime('%H:%M')}""" return s |
