fixed new dcp message qos and dcp file namings
This commit is contained in:
@@ -162,7 +162,7 @@ services:
|
||||
environment:
|
||||
- INTERVAL=15
|
||||
- DCP_INTERVAL=300
|
||||
- DCP_SERVER_FILE=/home/dcpservers.json,
|
||||
- DCP_SERVER_FILE=/home/dcpservers.json
|
||||
- DCP_NEW_TOPIC=projmon/newdcp
|
||||
- PROJECTOR_IP=192.168.31.10
|
||||
- PROJECTOR_USER=alberto
|
||||
|
||||
@@ -127,7 +127,7 @@ def check_new_titles(mqtt: mqtt_client.Client, topic: str, file_path: str, logge
|
||||
name=dir.name,
|
||||
modified_time=dir.modified_time
|
||||
)
|
||||
mqtt.publish(topic, notification.model_dump_json())
|
||||
mqtt.publish(topic, notification.model_dump_json(), qos=2)
|
||||
sleep(1) # Small delay to ensure message is sent
|
||||
|
||||
# Save server information with updated DCP list
|
||||
|
||||
+1
-2
@@ -24,7 +24,6 @@ LOGGER: logging.Logger
|
||||
DISCOVERY_PREFIX = "homeassistant"
|
||||
|
||||
def on_shutwown(client: mqtt_client.Client, userdata: Any, msg: mqtt_client.MQTTMessage) -> None:
|
||||
LOGGER.info("Shutdown command received")
|
||||
if msg and msg.payload.decode() == "shutdown":
|
||||
LOGGER.info("Shutting down projector")
|
||||
projector: projrequest.ProjectorConnection = projrequest.ProjectorConnection(
|
||||
@@ -321,7 +320,7 @@ def main() -> int:
|
||||
check_new_titles(mqtt, DCP_NEW_TOPIC, DCP_SERVER_FILE, LOGGER)
|
||||
last_title_check = now
|
||||
except Exception as e:
|
||||
LOGGER.error("Failed to check DCP on FTP servers")
|
||||
LOGGER.error("Failed to check DCP on FTP servers: [%s]", e)
|
||||
|
||||
last: float = time.time()
|
||||
cycle_time: float = last - now
|
||||
|
||||
Reference in New Issue
Block a user