Closed yozik04 closed 5 years ago
Would the idea be to allow different mqtt clients to be used with device_base? Might allow easy adoption of the library to an ESP...
My use case is different. I have a bluetooth temperature sensors across the house. I have a script that listens bluetooth traffic and publishes all sensor data to MQTT via homie. If I have 10 temperature sensors it will make 10 connections to MQTT.
The idea behind the Homie concept is that each device should have its own connection so the MQTT LWT message gets sent.
Have a look at the stress test example. My MQTT server is a Raspberry Zero and it handled 500 connections without problem.
It was just an idea for improvement =)
Understand - but it deviates from protocol. See the discussion here https://github.com/homieiot/convention/issues/158
Version 0.3.0 allows using a single MQTT client.
MQTT_SETTINGS = {
'MQTT_BROKER' : None,
'MQTT_PORT' : 1883,
'MQTT_USERNAME' : None,
'MQTT_PASSWORD' : None,
'MQTT_KEEPALIVE' : 60,
'MQTT_CLIENT_ID' : None,
'MQTT_SHARE_CLIENT' : True,
}
Yeey!
Maybe it will be good to make mqtt related stuff static or move it to a separate class?