diff options
| author | stuebinm | 2026-04-16 00:09:44 +0200 |
|---|---|---|
| committer | stuebinm | 2026-04-16 01:18:19 +0200 |
| commit | fbfa662922a2dcf34e8a2cf1eb020210de18c0af (patch) | |
| tree | 5acc0ee9a3e0bd290da9330bf2f46e6ea68bda23 /lib/OwnTracks/Location.hs | |
| parent | 2f7666c1a8d6b06718f58e1327d2e235c0d2d98d (diff) | |
Owntracks.{Configuration,Command,Waypoint}: init
Diffstat (limited to '')
| -rw-r--r-- | lib/OwnTracks/Location.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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) |
