Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed several issues #4

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions application/OwnTags_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions application/keys/put your keyfiles here
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

40 changes: 0 additions & 40 deletions settings-template.toml

This file was deleted.

2 changes: 2 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down