1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 18:22:22 +01:00

feat(MQTT): Add QoS option for each MQTT component (#6279)

This commit is contained in:
Rodrigo Martín
2024-03-11 01:12:52 +01:00
committed by GitHub
parent c899a33d1a
commit 6a8a2aaefb
6 changed files with 20 additions and 6 deletions

View File

@@ -490,6 +490,8 @@ def get_default_topic_for(data, component_type, name, suffix):
async def register_mqtt_component(var, config):
await cg.register_component(var, {})
if CONF_QOS in config:
cg.add(var.set_qos(config[CONF_QOS]))
if CONF_RETAIN in config:
cg.add(var.set_retain(config[CONF_RETAIN]))
if not config.get(CONF_DISCOVERY, True):