zigbee2mqtt / hassio-zigbee2mqtt

Official Zigbee2MQTT Home Assistant add-on
https://www.zigbee2mqtt.io
Apache License 2.0
1.02k stars 362 forks source link

Use bashio::services for the connection even when base_topic is specified in the config #620

Open gdgib opened 3 weeks ago

gdgib commented 3 weeks ago

NB: MARKED AS DRAFT BECAUSE THIS IS NOT TESTED. I'm opening the PR to see what people think of the idea in the meantime.

When overriding the base_topic you end up having to configure the server too, which is a bit annoying. This comes up when running multiple instances of z2m in hassio. The change here makes it so that you can specify mqtt config keys and still use the bashio services to get server access. Unless you specify mqtt.server, mqtt.user or mqtt.password.

Koenkk commented 3 weeks ago

Looks good!