summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--info/blueshift.texinfo39
-rw-r--r--src/weather.py2
3 files changed, 41 insertions, 2 deletions
diff --git a/TODO b/TODO
index dd91775..ef05950 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,7 @@ High priority:
Medium priority:
Test and demo _ICC_PROFILE
Demo functionise
- Demo and document weather
+ Demo weather
Low priority:
Add a section in manual for information on which order
diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo
index fc78b80..f4d2aeb 100644
--- a/info/blueshift.texinfo
+++ b/info/blueshift.texinfo
@@ -315,6 +315,7 @@ Disables or enables Blueshift.
* Backlight:: Adjusting monitor backlight.
* Continuous mode:: Creating continuous mode configurations.
* Solar time:: Solar functions, such as elevation calcuation.
+* Weather:: Making weather dependent settings.
* Running without X:: Configuration options for running without X.
* Optimising:: Functions that can be used to optimise performance.
@end menu
@@ -1309,6 +1310,44 @@ astronomical twilight, measured in degrees.
@end table
+@node Weather
+@section Weather
+
+Blueshift includes the function @code{whether}
+which gives a brief weather report. @code{whether}
+takes one argument: the International Civil Aviation
+Organization (ICAO) code of your closest airport.
+If Blueshift is unable to download the latest METAR
+(Meteorological Aerodrome Report) @code{whether}
+will return @code{None}. If successful it will
+return the sky conditions (assumed clear if not
+included in the report,) the visiblity range and
+the weather. These components are returned as a
+3-tuple with the components in the same order as
+mentioned.
+
+The sky condition is returned as a string. And
+can be either of: `clear', `mostly clear',
+`partly cloudy', `mostly cloudy', `overcast'
+and `obscured'.
+
+If the visibility range is not included in the
+report it will be @code{None}; if it is included
+in the report it will be an int–float-tuple. The
+first element in the tuple will be either
+@code{-1}, @code{0} or @code{1}, and the second
+element will be an approximate visibility range
+measured in kilometers. If the first element is
+@code{-1} this measurement is an upper bound, if
+it it @code{1} the measurement is an lower bound,
+and if it is @code{0} the measurement is
+approximate.
+
+The weather is reported as an string list, that
+can and often is empty.
+
+
+
@node Running without X
@section Running without X
diff --git a/src/weather.py b/src/weather.py
index d5f8a2f..33e58ac 100644
--- a/src/weather.py
+++ b/src/weather.py
@@ -25,7 +25,7 @@ def weather(station):
@param station:str The station's International Civil Aviation Organization airport code
@return :(sky:str, visiblity:(:int, :float)?, weather:list<str>)?
The sky condition, visiblity and weather. Sky condition values include
- ‘clear’, ‘mostly clear’, ‘overcast’, ‘partly cloudy’, ‘mostly cloudy’
+ ‘clear’, ‘mostly clear’, ‘partly cloudy’, ‘mostly cloudy’, ‘overcast’
and ‘obscured’. The visibility consists of two parameters: the first
on indicates the the visiblity is a upper bound if the value is -1,
a lower bound if +1, and approximate if 0; the second parameter is the