From ef528572b913c5f509b0bef6c7e61e27cee7afb8 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Wed, 28 Nov 2018 10:48:28 +0100 Subject: [PATCH] Clarify readme about connection callbacks * The MQTT gateway doesn't support the connection callbacks. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1d52bb7..837b05d1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ GATEWAY = mysensors.SerialGateway('/dev/ttyACM0', event) GATEWAY.start() ``` -In the above example PyMysensors will call "event" whenever a node in the Mysensors network has been updated. The message passed to the callback handler has the following data: +In the above example pymysensors will call "event" whenever a node in the Mysensors network has been updated. The message passed to the callback handler has the following data: ``` Message @@ -153,6 +153,10 @@ instance. The connection lost callback should also accept a second parameter for possible connection error exception argument. If connection was lost without error, eg when disconnecting, the error argument will be `None`. +**NOTE:** +The MQTT gateway doesn't support these callbacks since the connection to the +MQTT broker is handled outside of pymysensors. + ```py def conn_made(gateway): """React when the connection is made to the gateway device.""" @@ -167,6 +171,8 @@ def conn_lost(gateway, error): GATEWAY.on_conn_lost = conn_lost ``` + + ## Async gateway The serial, TCP and MQTT gateways now also have versions that support asyncio. Use the `AsyncSerialGateway` class, `AsyncTCPGateway` class or `AsyncMQTTGateway` class to make a gateway that