diff options
Diffstat (limited to 'lib/OwnTracks/Location.hs')
| -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) |
