class HomieMqttClient
Creates a Homie MQTT client for the supplied org.homieiot.Device
serverURI
- in the format of tcp://host:port for the MQTT Broker to connect
clientID
- Supplied MQTT Client ID
username
- Optional username to connect to MQTT
password
- Optional password to connect to MQTT
HomieMqttClient(serverURI: String, clientID: String, username: String? = null, password: String? = null, homieRoot: String = "homie", device: Device)
Creates a Homie MQTT client for the supplied org.homieiot.Device |
fun connect(): Future<Any>
Connect client to MQTT library |
|
fun disconnect(): Unit
Disconnect MQTT Client |
fun fromEnv(device: Device): HomieMqttClient
Creates a new HomieMqttClient for the device default environment variables The environment must contain an MQTT_SERVER URI in format of tcp://host:port and an MQTT_CLIENT_ID variable Additionally, the method supports extracting the MQTT_USERNAME and MQTT_PASSWORD environment variables |