Skip to content

Commit 2ba8122

Browse files
committed
add uv lock and python-version, fix some imports missing
1 parent dbf787c commit 2ba8122

File tree

4 files changed

+139
-6
lines changed

4 files changed

+139
-6
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ipython_config.py
8585
# pyenv
8686
# For a library or package, you might want to ignore these files since the code is
8787
# intended to run in multiple environments; otherwise, check them in:
88-
.python-version
88+
#.python-version
8989

9090
# pipenv
9191
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -98,7 +98,7 @@ ipython_config.py
9898
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101-
uv.lock
101+
#uv.lock
102102

103103
# poetry
104104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from copy import deepcopy
33

44
from paho.mqtt import client as mqtt_client
5-
from ntfpy import NTFYServer, NTFYClient, NTFYPushMessage, NTFYUrlAttachment
5+
from ntfpy import NTFYServer, NTFYClient, NTFYPushMessage, NTFYUrlAttachment, NTFYUser
6+
from paho.mqtt.enums import CallbackAPIVersion
67

78
MQTT_BROKER_IP = os.getenv("MQTT_BROKER_IP", "eclipse-mosquitto")
89
MQTT_BROKER_PORT = int(os.getenv("MQTT_BROKER_PORT", 1883))
@@ -59,12 +60,12 @@ def on_connect(client, userdata, flags, rc):
5960
if rc == 0:
6061
logging.info("Connected to MQTT Broker!")
6162

62-
msg = NTFYPushMessage(body="Connected to MQTT Broker!",title="Frigate MQTT Notifier")
63+
msg = NTFYPushMessage(message="Connected to MQTT Broker!",title="Frigate MQTT Notifier")
6364
ntfy_client.send_message(msg)
6465
else:
6566
logging.error(f"Connection to MQTT Broker failed (rc={rc})")
6667

67-
msg = NTFYPushMessage(body=f"Connection to MQTT Broker failed (rc={rc})",title="Frigate MQTT Notifier")
68+
msg = NTFYPushMessage(message=f"Connection to MQTT Broker failed (rc={rc})",title="Frigate MQTT Notifier")
6869
ntfy_client.send_message(msg)
6970

7071
def get_zone_changes(event_id, current):
@@ -178,7 +179,7 @@ def on_message(client, userdata, mqtt_msg):
178179

179180
ntfy_client.send_message(msg)
180181

181-
client = mqtt_client.Client(mqtt_client.CallbackAPIVersion.VERSION2, MQTT_CLIENT_ID)
182+
client = mqtt_client.Client(CallbackAPIVersion.VERSION2, MQTT_CLIENT_ID)
182183

183184
if MQTT_BROKER_USERNAME:
184185
client.username_pw_set(MQTT_BROKER_USERNAME, MQTT_BROKER_PASSWORD)

uv.lock

Lines changed: 131 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)