aboutsummaryrefslogtreecommitdiff
path: root/lib/OwnTracks.hs
diff options
context:
space:
mode:
authorstuebinm2026-04-16 00:09:44 +0200
committerstuebinm2026-04-16 01:18:19 +0200
commitfbfa662922a2dcf34e8a2cf1eb020210de18c0af (patch)
tree5acc0ee9a3e0bd290da9330bf2f46e6ea68bda23 /lib/OwnTracks.hs
parent2f7666c1a8d6b06718f58e1327d2e235c0d2d98d (diff)
Owntracks.{Configuration,Command,Waypoint}: init
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."