summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--readme.md2
-rw-r--r--src/Plugins/Monitors/Weather.hs16
2 files changed, 11 insertions, 7 deletions
diff --git a/readme.md b/readme.md
index 7d814bb..14c5406 100644
--- a/readme.md
+++ b/readme.md
@@ -678,7 +678,7 @@ something like:
- Variables that can be used with the `-t`/`--template` argument:
`station`, `stationState`, `year`, `month`, `day`, `hour`,
`wind`, `visibility`, `skyCondition`, `tempC`, `tempF`,
- `dewPoint`, `rh`, `pressure`
+ `dewPointC`, `dewPointF`, `rh`, `pressure`
- Default template: `<station>: <tempC>C, rh <rh>% (<hour>)`
- Retrieves weather information from http://weather.noaa.gov.
diff --git a/src/Plugins/Monitors/Weather.hs b/src/Plugins/Monitors/Weather.hs
index ba4d911..1050637 100644
--- a/src/Plugins/Monitors/Weather.hs
+++ b/src/Plugins/Monitors/Weather.hs
@@ -37,7 +37,8 @@ weatherConfig = mkMConfig
, "skyCondition"
, "tempC"
, "tempF"
- , "dewPoint"
+ , "dewPointC"
+ , "dewPointF"
, "rh"
, "pressure"
]
@@ -54,7 +55,8 @@ data WeatherInfo =
, skyCondition :: String
, tempC :: Int
, tempF :: Int
- , dewPoint :: String
+ , dewPointC :: Int
+ , dewPointF :: Int
, humidity :: Int
, pressure :: Int
} deriving (Show)
@@ -117,13 +119,15 @@ parseData =
sk <- getAfterString "Sky conditions: "
skipTillString "Temperature: "
(tC,tF) <- pTemp
- dp <- getAfterString "Dew Point: "
+ skipTillString "Dew Point: "
+ -- dp <- getAfterString "Dew Point: "
+ (dC, dF) <- pTemp
skipTillString "Relative Humidity: "
rh <- pRh
skipTillString "Pressure (altimeter): "
p <- pPressure
manyTill skipRestOfLine eof
- return [WI st ss y m d h w v sk tC tF dp rh p]
+ return [WI st ss y m d h w v sk tC tF dC dF rh p]
defUrl :: String
defUrl = "http://weather.noaa.gov/pub/data/observations/metar/decoded/"
@@ -139,10 +143,10 @@ getData station = do
errHandler _ = return "<Could not retrieve data>"
formatWeather :: [WeatherInfo] -> Monitor String
-formatWeather [WI st ss y m d h w v sk tC tF dp r p] =
+formatWeather [WI st ss y m d h w v sk tC tF dC dF r p] =
do cel <- showWithColors show tC
far <- showWithColors show tF
- parseTemplate [st, ss, y, m, d, h, w, v, sk, cel, far, dp, show r , show p ]
+ parseTemplate [st, ss, y, m, d, h, w, v, sk, cel, far, show dC, show dF, show r , show p ]
formatWeather _ = getConfigValue naString
runWeather :: [String] -> Monitor String