Skip to content

Commit

Permalink
Berry add mqtt.connected()
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Sep 7, 2023
1 parent ffca103 commit ecb2b3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/Berry.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ Tasmota Function|Parameters and details
mqtt.publish<a class="cmnd" id="mqtt_publish"></a>|`(topic:string, payload:string[, retain:bool, start:int, len:int]) -> nil`<br>Equivalent of `publish` command, publishes a MQTT message on `topic` with `payload`. Optional `retain` parameter.<br>`payload` can be a string or a bytes() binary array<br>`start` and `len` allow to specify a sub-part of the string or bytes buffer, useful when sending only a portion of a larger buffer.
mqtt.subscribe<a class="cmnd" id="mqtt_subscribe"></a>|`mqtt.subscribe(topic:string [, function:closure]) -> nil`<br>Subscribes to a `topic` (exact match or pattern). Contrary to Tasmota's `Subscribe` command, the topic is sent as-is and not appended with `/#`. You need to add wildcards yourself. Driver method `mqtt_data` is called for each matching payload.<br>If a function/closure is added, the function is called whenever and only if an incoming messages matches the pattern for this function. The function should return `true` if message was processed, `false` if not which will let the message flow to Tasmota eventually as a command.
mqtt.unsubscribe<a class="cmnd" id="mqtt_unsubscribe"></a>|`(topic:string) -> nil`<br>Unubscribe to a `topic` (exact match).
mqtt.connected<a class="cmnd" id="mqtt_connected"></a>|`mqtt.connected() -> bool`<br>Returns `true` if Tasmota is connected to the MQTT broker

### `light` object

Expand Down

0 comments on commit ecb2b3b

Please sign in to comment.