Migrated MQTT to internal Docker network #1
Squashed commit of the following: commit cc7419ff856867009e48aae1f1685382352a1ded Author: Ashish D'Souza <[email protected]> Date: Sun Oct 29 20:32:38 2023 -0500 Removed MQTT auth from pipeline commit ef80c5a56a9d0f5adb821bfc3e83d9f2d3726c7b Author: Ashish D'Souza <[email protected]> Date: Sun Oct 29 20:32:09 2023 -0500 Removed forced MQTT auth from source commit 4c00200f8e77c1c4c24d1e6ac9f425e1f3ed83a6 Author: Ashish D'Souza <[email protected]> Date: Sun Oct 29 20:31:35 2023 -0500 Updated configs
This commit is contained in:
1 parent
415d4e0094
commit
3642e26c7a
7 files changed
+41
-46
No files matched your search
@@ -10,7 +10,8 @@ import paho.mqtt.client as mqtt
|
||||
class FrigateEventNotifier:
|
||||
def __init__(self, mqtt_username, mqtt_password, quiet_period=3 * 60):
|
||||
self.mqtt_client = mqtt.Client()
|
||||
self.mqtt_client.username_pw_set(mqtt_username, password=mqtt_password)
|
||||
if mqtt_username is not None and mqtt_password is not None:
|
||||
self.mqtt_client.username_pw_set(mqtt_username, password=mqtt_password)
|
||||
self.mqtt_client.on_connect = self._on_connect
|
||||
self.mqtt_client.on_message = self._on_message
|
||||
|
||||
@@ -114,5 +115,5 @@ class FrigateEventNotifier:
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
frigate_event_notifier = FrigateEventNotifier(os.environ['MQTT_USERNAME'], os.environ['MQTT_PASSWORD'])
|
||||
frigate_event_notifier = FrigateEventNotifier(os.environ.get('MQTT_USERNAME'), os.environ.get('MQTT_PASSWORD'))
|
||||
frigate_event_notifier.start()
|
||||
Reference in new issue
Block a user