Erster Stand der Hintergrundprozesse, die auf der Synology unter /volume1/homes/wagner/SolarManager laufen: der Manager selbst, die Sammler je Geraet, die MQTT-Bruecke, der Wecker und - neu hinzugezogen - der AutoAction-Runner, der als Hintergrundprozess hierher gehoert und nicht ins Web-Verzeichnis. Zugangsdaten stehen nicht mehr im Quelltext, sondern in config.ini, die nicht mit eingecheckt wird. Vorlage ist config.ini.example, gelesen wird sie von konfig.py. Betroffen waren solarManager.py (Datenbank und Wattpilot), zeit.py, gatherWaterData.py, wecker.py und skoda_testdaten.py, das sich das Passwort bisher aus dem Quelltext eines anderen Moduls herausgesucht hat. Die Kia-Anbindung ist mit dem Fahrzeug entfallen: kiaTest.py, gatherCarData.py und hyundai_kia_connect_api sind nicht mehr dabei, ebenso gatherInverterData.py, auf das nur noch eine auskommentierte Zeile zeigte. Die mitgelieferten Bibliotheken bleiben im Repository - die NAS hat kein pip, sie muessen neben den Skripten liegen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
# Test whether a client sends a correct PUBLISH to a topic with QoS 0 and no payload.
|
|
|
|
# The client should connect with keepalive=60, clean session set,
|
|
# and client id publish-qos0-test-np
|
|
# The test will send a CONNACK message to the client with rc=0. Upon receiving
|
|
# the CONNACK and verifying that rc=0, the client should send a PUBLISH message
|
|
# to topic "pub/qos0/no-payload/test" with zero length payload and QoS=0. If
|
|
# rc!=0, the client should exit with an error.
|
|
# After sending the PUBLISH message, the client should send a DISCONNECT message.
|
|
|
|
|
|
import tests.paho_test as paho_test
|
|
|
|
connect_packet = paho_test.gen_connect("publish-qos0-test-np", keepalive=60)
|
|
connack_packet = paho_test.gen_connack(rc=0)
|
|
|
|
publish_packet = paho_test.gen_publish("pub/qos0/no-payload/test", qos=0)
|
|
|
|
disconnect_packet = paho_test.gen_disconnect()
|
|
|
|
|
|
def test_03_publish_qos0_no_payload(server_socket, start_client):
|
|
start_client("03-publish-qos0-no-payload.py")
|
|
|
|
(conn, address) = server_socket.accept()
|
|
conn.settimeout(10)
|
|
|
|
paho_test.expect_packet(conn, "connect", connect_packet)
|
|
conn.send(connack_packet)
|
|
|
|
paho_test.expect_packet(conn, "publish", publish_packet)
|
|
paho_test.expect_packet(conn, "disconnect", disconnect_packet)
|
|
|
|
conn.close()
|