1. mqtt 单独服务更新到gzth中

This commit is contained in:
sunjie
2025-07-22 13:34:21 +00:00
committed by 李鹏宇
parent 9d6b4f1a3f
commit 21b1ca5ec4
2 changed files with 6 additions and 5 deletions
+3 -4
View File
@@ -9,13 +9,12 @@ password = gzsthtz@126.com
[mqtt]
# MQTT Broker connection details
host = 1.12.37.24
host = 43.143.225.150
port = 1883
username = odoo
password = odoo123
client_id = OdooMqttConnector
# A comma-separated list of topics to subscribe to for replies.
# You can list multiple topics here.
reply_topics =
[app]
# How often to poll Odoo for new messages, in seconds.
+3 -1
View File
@@ -50,7 +50,9 @@ async def main():
# 2. Connect to MQTT and run tasks
async with aiomqtt.Client(
hostname=mqtt_cfg['host'],
port=int(mqtt_cfg['port'])
port=int(mqtt_cfg['port']),
username=mqtt_cfg['username'],
password=mqtt_cfg['password']
) as client:
logger.info(f"Connected to MQTT broker at {mqtt_cfg['host']}:{mqtt_cfg['port']}")