summaryrefslogtreecommitdiff
path: root/scripts/weather.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/weather.py')
-rwxr-xr-xscripts/weather.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/scripts/weather.py b/scripts/weather.py
index 0c2af7b..27395a9 100755
--- a/scripts/weather.py
+++ b/scripts/weather.py
@@ -6,41 +6,41 @@ import json
from dotenv import load_dotenv
def getWeatherIcon(isDayTime: bool, weatherDescription: str):
- if weatherDescription in ["CLEAR", "MOSTLY_CLEAR"]:
+ if weatherDescription in ["CLEAR"]:
if isDayTime:
- return "๏”ข "
+ return "โ˜€๏ธ"
else:
- return "๏†† "
- if weatherDescription in ["PARTLY_CLOUDY"]:
+ return "๐ŸŒ™ "
+ if weatherDescription in ["PARTLY_CLOUDY", "MOSTLY_CLEAR"]:
if isDayTime:
- return "๎ปฐ "
+ return "โ›…"
else:
return "๎ปฏ "
if weatherDescription in ["CLOUDY", "MOSTLY_CLOUDY"]:
- return "๏ƒ‚ "
+ return "โ˜๏ธ"
if weatherDescription in ["LIGHT_RAIN", "LIGHT_TO_MODERATE_RAIN","LIGHT_RAIN_SHOWERS"]:
if isDayTime:
- return "๎ผž "
+ return "๐ŸŒฆ๏ธ"
else:
return "๎ผ› "
if weatherDescription in ["RAIN", "RAIN_SHOWERS", "HEAVY_RAIN", "HEAVY_RAIN_SHOWERS", "MODERATE_TO_HEAVY_RAIN", "RAIN_PERIODICALLY_HEAVY"]:
- return "๎ˆน "
+ return "๐ŸŒง๏ธ"
if weatherDescription in ["SNOW", "LIGHT_SNOW", "HEAVY_SNOW", "SNOW_SHOWERS", "LIGHT_SNOW_SHOWERS", "HEAVY_SNOW_SHOWERS", "SNOWSTORM", "BLOWING_SNOW", "RAIN_AND_SNOW", "HAIL"]:
- return "๏‹œ "
+ return "โ„๏ธ"
if weatherDescription in ["LIGHT_THUNDERSTORM_RAIN"]:
if isDayTime:
- return "๎ข "
+ return "โ›ˆ๏ธ"
else:
- return "๎Œช "
+ return "โ›ˆ๏ธ"
if weatherDescription in ["THUNDERSHOWER", "SCATTERED_THUNDERSTORMS", "THUNDERSTORM", "HEAVY_THUNDERSTORM"]:
- return "๎ˆˆ "
+ return "๐ŸŒฉ๏ธ"
if weatherDescription in ["WINDY"]:
if isDayTime:
- return "๎Œ "
+ return "๐Ÿƒ"
else:
- return "๎Œญ "
+ return "๐Ÿƒ"
if weatherDescription in ["FOG","HAZE","DUST","MIST","SMOKE"]:
if isDay:
@@ -52,8 +52,8 @@ def getWeatherIcon(isDayTime: bool, weatherDescription: str):
url = "https://weather.googleapis.com/v1/currentConditions:lookup"
-lat = "25.4448"
-long = "81.8432"
+lat = "<LATITUDE>"
+long = "<LONGITUDE>"
load_dotenv()
params = {
@@ -69,8 +69,8 @@ currentTemperature = jsonDump["temperature"]["degrees"]
weatherDescription = jsonDump["weatherCondition"]["type"]
isDaytime = jsonDump["isDaytime"]
precipitation = jsonDump["precipitation"]["probability"]["percent"]
-
+windSpeed = jsonDump["wind"]["speed"]["value"]
weatherIcon = getWeatherIcon(isDaytime, weatherDescription)
-print(weatherIcon, f"{currentTemperature}ยฐC",f"๎ˆ  {precipitation}%")
+print(weatherIcon, f"{currentTemperature}ยฐC",f"โ˜” {precipitation}%", f"๐ŸŒฌ๏ธ {windSpeed}kph")