aboutsummaryrefslogtreecommitdiff
path: root/lib/OwnTracks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/OwnTracks.hs')
-rw-r--r--lib/OwnTracks.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/OwnTracks.hs b/lib/OwnTracks.hs
index ae81d0b..25b0ae9 100644
--- a/lib/OwnTracks.hs
+++ b/lib/OwnTracks.hs
@@ -9,7 +9,10 @@
module OwnTracks
(Message(..),
module OwnTracks.Location,
- module OwnTracks.Status
+ module OwnTracks.Status,
+ module OwnTracks.Configuration,
+ module OwnTracks.Command,
+ module OwnTracks.Waypoint
) where
import Data.Aeson
@@ -29,10 +32,15 @@ import GHC.Generics (Generic)
import OwnTracks.Location
import OwnTracks.Status
+import OwnTracks.Configuration
+import OwnTracks.Command
+import OwnTracks.Waypoint
data Message =
MsgLocation Location
- | MsgStatus Status -- TODO
+ | MsgStatus Status
+ | MsgConfig Configuration
+ | MsgWaypoints [Waypoint]
deriving (Generic, Show, Eq)
instance FromJSON Message where
@@ -41,4 +49,6 @@ instance FromJSON Message where
case ty of
"location" -> MsgLocation <$> parseJSON v
"status" -> MsgStatus <$> parseJSON v
+ "configuration" -> MsgConfig <$> parseJSON v
+ "waypoints" -> MsgWaypoints <$> o .: "waypoints"
_ -> fail "unknown _type of owntracks message."