michaelarnauts / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
145 stars 48 forks source link

Make the bridge reconnect on connection loss #24

Closed heikomat closed 5 years ago

heikomat commented 5 years ago

This change makes the bridge automatically reconnect to the mqtt broker on connection loss

michaelarnauts commented 5 years ago

loop_start() also reconnects. loop_forever() blocks the thread so cec wil not refresh anymore.

michaelarnauts commented 5 years ago

Check the docs at https://pypi.org/project/paho-mqtt/#network-loop

heikomat commented 5 years ago

oh, it does indeed say "This call also handles reconnecting to the broker" for loop_start(). That's strange, as i restartet my mqtt broker, and only with loop_forever() did it work correctly. I must have something else wrong then.

Thanks for the info @michaelarnauts