diff --git a/application/OwnTags_plugin.py b/application/OwnTags_plugin.py index 327bde2..f2b5fb6 100644 --- a/application/OwnTags_plugin.py +++ b/application/OwnTags_plugin.py @@ -6,20 +6,21 @@ import datetime import paho.mqtt.publish as publish import sys +import tomli as toml def get_configuration(): - """ Check Python version and decide how to handle TOML - """ - py_major, py_minor, py_micro, py_release, serial = sys.version_info - version = float(f'{py_major}.{py_minor}') - if version >= 3.11: - import tomllib as toml - elif version >= 3.7: - import tomli as toml - elif version < 3.7: - print(f'Found Python {version}.\nUpgrade to python 3.7 or higher') - exit() +# """ Check Python version and decide how to handle TOML +# """ +# py_major, py_minor, py_micro, py_release, serial = sys.version_info +# version = float(f'{py_major}.{py_minor}') +# if version >= 3.11: +# import tomllib as toml +# elif version >= 3.7: +# import tomli as toml +# elif version < 3.7: +# print(f'Found Python {version}.\nUpgrade to python 3.7 or higher') +# exit() with open('../settings.toml', mode='rb') as fp: configuration = toml.load(fp) diff --git a/application/keys/put your keyfiles here b/application/keys/put your keyfiles here new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/application/keys/put your keyfiles here @@ -0,0 +1 @@ + diff --git a/settings-template.toml b/settings-template.toml deleted file mode 100644 index 972e384..0000000 --- a/settings-template.toml +++ /dev/null @@ -1,40 +0,0 @@ - -# -- INSTRUCTIONS -- -# Make a copy of this file and rename it settings.toml. -# add information about your system, MQTT broker, OwnTracks setup. -# Create a new settings block for each tag. - -[owntag_options] -password = "password" # macOS password. Used to decrypt location reports. -print_history = 1 - # positive numbers (4), the number of messages you want to see - # negative numbers (-1) will print all fetched locations, - # 0 will turn printing fetched locations off -status_msg = false # publish status and metadata - # Status messages can be sent to an MQTT Topic -status_base = "status/owntags" # topic for status messages - -[mqtt_secrets] -mqtt_broker = "your-broker.com" # broker address -mqtt_port = 1883 # 1883 if no TLS; 8883 if TLS -mqtt_tls = nan # Comment out if using TLS. Uncomment below to use certificates. -mqtt_user = "username" # Broker user -mqtt_pass = "password" # Broker password -# [mqtt_secrets.mqtt_tls] # If TLS is activated, use this -# ca_certs = "keys/isrgrootx1.cer" # where the cert file located - # download HiveMQ certificate: https://community.hivemq.com/t/frequently-asked-questions/514 - # create users at https://console.hivemq.com - -[owntracks_options] -owntracks_device = "owntracks/user" # Topic Base of your phone, used for waypoints -owntags_base = nan # topic Base for tags. If `nan` owntracks_devce will be used. - -# Locations are published as retained, this allows clients to get the most recent -# report at any time. Waypoints are intended to be published *without* retain. -[tag_options.prefix] # Change 'prefix' to match your tag. -location = true # (not required) locations are seen by everyone with access to the topic (they act like users) -waypoint = false # (not required) waypoints are only seen on your phone (or device) -timestamp = 1000000001 # (required for wayponts) Must be unique, can be any past Unix/Posix timestamp. -radius = false # (not required) use number for radius in meters, if `false` turn off, if `true` use confidence -mqtt_topic = nan # (not required) topic for this tag, if `nan` owntags_base will be used -status_topic = false # (not required) if `True` messages will be published to `status_base`/prefix diff --git a/settings.toml b/settings.toml index 236aeb5..e4b10e4 100644 --- a/settings.toml +++ b/settings.toml @@ -10,6 +10,8 @@ print_history = 1 status_msg = false # publish status and metadata # Status messages can be sent to an MQTT Topic status_base = "status/owntags" # topic for status messages +output_folder = "keys/" + [mqtt_secrets] mqtt_broker = "your-broker.com" # broker address