From fbfa662922a2dcf34e8a2cf1eb020210de18c0af Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 16 Apr 2026 00:09:44 +0200 Subject: Owntracks.{Configuration,Command,Waypoint}: init --- lib/OwnTracks/Location.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/OwnTracks/Location.hs') diff --git a/lib/OwnTracks/Location.hs b/lib/OwnTracks/Location.hs index b4bf807..987de73 100644 --- a/lib/OwnTracks/Location.hs +++ b/lib/OwnTracks/Location.hs @@ -64,7 +64,7 @@ instance FromJSON Trigger where parseJSON _ = fail "Trigger Type must be a string" data MonitoringMode = Quiet | Manual | Significant | Move - deriving (Generic, Show, Eq) + deriving (Generic, Show, Eq, Enum) instance FromJSON MonitoringMode where parseJSON (Number i) = case i of @@ -75,6 +75,9 @@ instance FromJSON MonitoringMode where _ -> fail "Unknown Monitoring Mode (not in -1,..,2)" parseJSON _ = fail "Monitoring Mode must be a number" +instance ToJSON MonitoringMode where + toJSON m = toJSON (fromEnum m - 1) + data Connection = Wifi { connectionSSID :: Maybe Text -- ^ if available, is the unique name of the WLAN. (iOS,string/optional) -- cgit v1.2.3