improve debug
This commit is contained in:
@@ -8,6 +8,8 @@ import json
|
||||
# Configuration
|
||||
MQTT_BROKER = os.environ.get('MQTT_BROKER', '10.59.221.172')
|
||||
MQTT_PORT = int(os.environ.get('MQTT_PORT', '1883'))
|
||||
MQTT_USERNAME = os.getenv('MQTT_USERNAME', 'your_username')
|
||||
MQTT_PASSWORD = os.getenv('MQTT_PASSWORD', 'your_password')
|
||||
MQTT_SNAPSHOT_TOPIC = "/frigate/patiocam/person/snapshot"
|
||||
MQTT_TOPIC_PUBLISH = "homeassistant/sensor/dayglo_rating/state"
|
||||
DAYGLO_THRESHOLD_TOPIC = "homeassistant/sensor/dayglo_threshold/state"
|
||||
@@ -71,7 +73,9 @@ def calculate_dayglo_rating(image):
|
||||
rating = (dayglo_pixels / total_pixels) * 100
|
||||
return rating
|
||||
|
||||
client = mqtt.Client()
|
||||
#client = mqtt.Client()
|
||||
client = mqtt.Client(protocol=mqtt.MQTTv311)
|
||||
client.username_pw_set(MQTT_USERNAME, MQTT_PASSWORD)
|
||||
client.on_connect = on_connect
|
||||
client.on_message = on_message
|
||||
client.connect(MQTT_BROKER, MQTT_PORT, 60)
|
||||
|
||||
Reference in New Issue
Block a user