diff options
Diffstat (limited to 'lib/OwnTracks/Configuration.hs')
| -rw-r--r-- | lib/OwnTracks/Configuration.hs | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/OwnTracks/Configuration.hs b/lib/OwnTracks/Configuration.hs index 5880c69..0cb361d 100644 --- a/lib/OwnTracks/Configuration.hs +++ b/lib/OwnTracks/Configuration.hs @@ -59,21 +59,21 @@ instance ToJSON ProtocolMode where data Configuration = Configuration { configAdapt :: Maybe Int -- ^ time in minutes of non-movement before switching from move to significant mode. 0 (zero) means disabled. Defaults to 0 (zero) (iOS/integer/minutes/optional) - , configAllowRemoteLocation :: Bool + , configAllowRemoteLocation :: Maybe Bool -- ^ Respond to reportLocation cmd message (iOS/boolean) - , configAllowInvalidCerts :: Bool + , configAllowInvalidCerts :: Maybe Bool -- ^ disable TLS certificate checks insecure (iOS/boolean) - , configAuth :: Bool + , configAuth :: Maybe Bool -- ^ Use username and password for endpoint authentication (iOS,Android/boolean) - , configAutostartOnBoot :: Bool + , configAutostartOnBoot :: Maybe Bool -- ^ Autostart the app on device boot (Android/boolean) - , configCleanSession :: Bool + , configCleanSession :: Maybe Bool -- ^ MQTT endpoint clean session (iOS,Android/boolean) , configClientId :: Maybe Text -- ^ client id to use for MQTT connect. Defaults to "user deviceId" (iOS,Android/string) , configClientpkcs :: Maybe Text -- ^ Name of the client pkcs12 file (iOS/string) - , configCmd :: Bool + , configCmd :: Maybe Bool -- ^ Respond to cmd messages (iOS,Android/boolean) , configConnectionTimeoutSeconds :: Maybe Int -- ^ (default 30) TCP timeout for establishing a connection to the MQTT / HTTP broker, (Android/int) @@ -81,41 +81,41 @@ data Configuration = Configuration -- ^ Number of days to keep locations stored locally. 0 means no local keeping of locations. A negative number indicates to use the positions value. Defaults to -1 for backward compatibility. (iOS/integer/days) , configDebugLog :: Maybe Bool -- ^ (default false) whether or not debug logs should be shown in the log viewer / exporter activity (Android/bool) - , configDeviceId :: Text + , configDeviceId :: Maybe Text -- ^ id of the device used for pubTopicBase and clientId construction. Defaults to the os name of the device (iOS,Android/string) , configDowngrade :: Maybe Int -- ^ battery level below which to downgrade monitoring from move mode (iOS/integer/percent/optional) , configEcryptionKey :: Maybe Text -- ^ the secret key used for payload encryption (iOS,Android/string) - , configExtendedData :: Bool + , configExtendedData :: Maybe Bool -- ^ Add extended data attributes to location messages (iOS,Android/boolean) - , configHost :: Text + , configHost :: Maybe Text -- ^ MQTT endpoint host (iOS,Android/string) , configHttpHeaders :: Maybe Text -- ^ extra HTTP headers:field names and field content are separated by a colon (:), multiple fields by a backslash-n (\n) \<field-name>:\<field-content>\n\<field-name>:\<field-content>... (iOS only/string) - , configIgnoreInaccurateLocations :: Int + , configIgnoreInaccurateLocations :: Maybe Int -- ^ Location accuracy below which reports are supressed. 0 means no locations are suppressed. (iOS,Android/integer/meters) - , configIgnoreStaleLocations :: Bool + , configIgnoreStaleLocations :: Maybe Bool -- ^ Number of days after which location updates are assumed stale. Locations sent by friends older than the number of days specified here will not be shown on map or in friends list. Defaults to 0, which means stale locations are not filtered. (iOS,Android/integer/days) - , configKeepalive :: Int + , configKeepalive :: Maybe Int -- ^ MQTT endpoint keepalive (iOS,Android/integer/seconds) - , configLocatorDisplacement :: Int + , configLocatorDisplacement :: Maybe Int -- ^ maximum distance between location source updates (iOS,Android/integer/meters) - , configLocatorInterval :: Int + , configLocatorInterval :: Maybe Int -- ^ maximum interval between location source updates (iOS,Android/integer/seconds) - , configLocatorPriority :: LocatorPriority + , configLocatorPriority :: Maybe LocatorPriority -- ^ source/power setting for location updates (Android/integer) , configLocked :: Maybe Bool -- ^ Locks settings screen on device for editing (iOS/boolean) , configMaxHistory :: Maybe Int -- ^ Number of notifications to store historically. Zero (0) means no notifications are stored and history tab is hidden. Defaults to zero. (iOS/integer) - , configMode :: ProtocolMode + , configMode :: Maybe ProtocolMode -- ^ Endpoint protocol mode (iOS,Android/integer) - , configMonitoring :: MonitoringMode + , configMonitoring :: Maybe MonitoringMode -- ^ Location reporting mode (iOS,Android/integer) - , configProtocolLevel :: Int + , configProtocolLevel :: Maybe Int -- ^ MQTT broker protocol level (iOS,Android/integer) - , configNotificationLocation :: Bool + , configNotificationLocation :: Maybe Bool -- ^ Show last reported location in ongoing notification (Android/boolean) , configOpencageApiKey :: Maybe Text -- ^ API key for alternate Geocoding provider. See OpenCage for details. (Android/string) @@ -127,49 +127,49 @@ data Configuration = Configuration -- ^ Passphrase of the client pkcs12 file (iOS/string) , configPassword :: Maybe Text -- ^ Endpoint password (iOS,Android/string) - , configPegLocatorFastestIntervalToInterval :: Bool + , configPegLocatorFastestIntervalToInterval :: Maybe Bool -- ^ (default false) - if true, requests that that the device provide locations no faster than the specified interval. Location providers often use the requested interval as a "at least every" setting, and may return locations more frequencly. Some people wanted the behaviour where it also meant "no more frequently than", so this setting lets them specify this (Android/bool) , configPing :: Maybe Int -- ^ Interval in which location messages of with t:p are reported (Android/integer) - , configPort :: Int + , configPort :: Maybe Int -- ^ MQTT endpoint port (iOS,Android/integer) , configPositions :: Maybe Int -- ^ Number of locations to keep for friends and own device and display (iOS/integer) , configPubTopicBase :: Maybe Text -- ^ MQTT topic base to which the app publishes; %u is replaced by the user name, %d by device (iOS,Android/string) - , configPubRetain :: Bool + , configPubRetain :: Maybe Bool -- ^ MQTT retain flag for reported messages (iOS,Android/boolean) - , configPubQos :: Int + , configPubQos :: Maybe Int -- ^ MQTT QoS level for reported messages (iOS,Android/integer) , configRanging :: Maybe Bool -- ^ Beacon ranging (iOS/boolean) , configRemoteConfiguration :: Maybe Bool -- ^ Allow remote configuration by sending a setConfiguration cmd message (Android/boolean) - , configSub :: Bool + , configSub :: Maybe Bool -- ^ subscribe to subTopic via MQTT (iOS,Android/boolean) - , configSubTopic :: Text + , configSubTopic :: Maybe Text -- ^ A whitespace separated list of MQTT topics to which the app subscribes if sub is true (defaults see topics) (iOS,Android/string) - , configSubQos :: Bool + , configSubQos :: Maybe Bool -- ^ (iOS,Android/boolean) - , configTid :: Text + , configTid :: Maybe Text -- ^ Two digit Tracker ID used to display short name and default face of a user (iOS,Android/string) - , configTls :: Bool + , configTls :: Maybe Bool -- ^ MQTT endpoint TLS connection (iOS,Android/boolean) , configTlsClientCrtPassword :: Maybe Text -- ^ Passphrase of the client pkcs12 file (Android/string) - , configUrl :: Text + , configUrl :: Maybe Text -- ^ HTTP endpoint URL to which messages are POSTed (iOS,Android/string) - , configUsername :: Text + , configUsername :: Maybe Text -- ^ Endpoint username (iOS,Android/string) - , configWs :: Bool + , configWs :: Maybe Bool -- ^ use MQTT over Websocket, default false (iOS,Android/boolean) - , configWaypoints :: [Waypoint] + , configWaypoints :: Maybe [Waypoint] -- ^ Array of waypoint messages (iOS,Android/array) } deriving (Show, Eq, Generic) -TH.deriveJSON (TH.defaultOptions +TH.deriveJSON (TH.defaultOptions -- TODO: _type=configuration missing! { TH.omitNothingFields = True - , TH.rejectUnknownFields = False - , TH.fieldLabelModifier = drop 5 . \(x:xs) -> toLower x : xs + , TH.rejectUnknownFields = True + , TH.fieldLabelModifier = (\(x:xs) -> toLower x : xs) . drop 6 }) 'Configuration |
