|
|
|
@ -59,7 +59,7 @@ def tooltipPrinter(r_dict): |
|
|
|
# Print station name, temp, humidity, wind speed, wind direction |
|
|
|
stationName = f"Station Name: {info['stationName']}" |
|
|
|
condition = f"Current Condition: {info['textDescription']}" |
|
|
|
temp = f"Temp: {rounding(convertToF(info['temperature']['value']))} F" |
|
|
|
temp = f"Temp: {rounding(convertToF(info['temperature']['value']))}\u00b0F" |
|
|
|
humidity = f"Humidity: {rounding(info['relativeHumidity']['value'])}%" |
|
|
|
# If no windSpeed, NWS returns "None". |
|
|
|
if (not info['windSpeed']['value']): |
|
|
|
@ -69,17 +69,13 @@ def tooltipPrinter(r_dict): |
|
|
|
windSpeed = rounding(convertToMPH(info['windSpeed']['value'])) |
|
|
|
windDirection = info['windDirection']['value'] |
|
|
|
|
|
|
|
windData = f"Wind: {windSpeed} MPH, {convertCompass(windDirection)}, {windDirection} degrees" |
|
|
|
windData = f"Wind: {windSpeed} MPH, {convertCompass(windDirection)}, {windDirection}\u00b0" |
|
|
|
precipitation = f"Precipitation (3 Hrs.): {info['precipitationLast3Hours']['value']}" |
|
|
|
result = f"<tool>{stationName}\n{condition} \n{temp} \n{windData} \n{humidity} \n{precipitation}</tool>" |
|
|
|
result = f"<tool>{stationName}\n{condition}\n{temp}\ |
|
|
|
\n{windData}\n{humidity}\n{precipitation}</tool>" |
|
|
|
|
|
|
|
return result |
|
|
|
|
|
|
|
# Results at Hector Field - Fargo Int'l Airport |
|
|
|
# request_addr = "https://api.weather.gov/stations/KFAR/observations/latest" |
|
|
|
# Results at Dothan Regional Airport |
|
|
|
# request_addr = "https://api.weather.gov/stations/KDHN/observations/latest" |
|
|
|
|
|
|
|
|
|
|
|
request_addr = f"https://api.weather.gov/stations/{stationName}/observations/latest" |
|
|
|
|
|
|
|
@ -105,5 +101,5 @@ else: |
|
|
|
weatherIcon = iconSelect.imageSelector(parsedCondition, timeOfDay) |
|
|
|
# print(f"<txt> \u2601 {condition}, {roundedTemp} F</txt>") |
|
|
|
print( |
|
|
|
f"<img>{weatherIcon}</img> <txt>{roundedTemp}F</txt>") |
|
|
|
f"<img>{weatherIcon}</img><txt>{roundedTemp}\u00b0F</txt>") |
|
|
|
print(tooltipPrinter(request_json)) |
|
|
|
|