Class Bridge
This Bridge class.
The bridge will subscribe to all Homie v4 devices, and create equivalent Homie v5 devices. It is designed to work with the Copas scheduler, but will not start the scheduler.
Info:
- Copyright: Copyright (c) 2023-2024 Thijs Schreijer
- License: MIT, see LICENSE.md.
- Author: Thijs Schreijer
Methods
bridge:new (opts) | Creates a new bridge instance. |
bridge:start () | Starts the bridge. |
bridge:stop () | Stops the bridge, disconnects the MQTT client. |
Methods
- bridge:new (opts)
-
Creates a new bridge instance.
Parameters:
- opts options table
- uri
string
MQTT connection uri, eg.
mqtt://usr:pwd@mqttserver.local:1234
- domain4 string The homie domain for Homie v4 (default "homie")
- domain5 string The homie domain for Homie v5 (default "homie")
- id
string
MQTT device id. Defaults to
homie45-bridge-xxxxxxx
randomized. (optional) - subscribe_delay number Delay (milliseconds) between subscribing to discovered devices. This prevents too many topics being queued at once MQTT-server-side such that they might get dropped. (default 1000)
- uri
string
MQTT connection uri, eg.
Returns:
-
Bridge
the newly created instance.
- opts options table
- bridge:start ()
- Starts the bridge.
- bridge:stop ()
- Stops the bridge, disconnects the MQTT client.