~martijnbraam/pyatem

5c97692eb093c7320e63c2fd78115718fbdfd5ae — Martijn Braam 2 months ago ccc629b
docs: add examples to the mqtt module
1 files changed, 14 insertions(+), 1 deletions(-)

M docs/proxy.rst
M docs/proxy.rst => docs/proxy.rst +14 -1
@@ 188,4 188,17 @@ The `topic-subscribe` is an optional setting that sets the path the proxy will s
messages back. If this is not set the subscribe topic will be the same as the `topic` setting used to send messages.

The `allow-writes` setting defaults to false. If this setting is changed to true it will make the proxy subscribe to
a topic and allow changing the switcher state my sending MQTT messages to that topic.
\ No newline at end of file
a topic and allow changing the switcher state my sending MQTT messages to that topic.

.. code-block:: shell-session

   # Switch to input 4 using MQTT
   $ mosquitto_pub -t atem/mini/program-input -m '{"index":0, "source": 4}'

   # Switch to a named input on the hardware
   $ mosquitto_pub -t atem/mini/program-input -m '{"index":0, "source": "PC"}'

   # Receive all MQTT messages from the proxy
   $ mosquitto_sub -F '\e[92m%t \e[96m%p\e[0m' -t "atem/#"

The MQTT module uses the MQTTv5 protocol
\ No newline at end of file