1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-13 16:52:18 +01:00
This commit is contained in:
Otto Winter
2019-04-24 23:49:02 +02:00
parent 0a0713f0e2
commit 766f6c045d
44 changed files with 1202 additions and 592 deletions

View File

@@ -150,6 +150,10 @@ def exp_mqtt_message(config):
@coroutine_with_priority(40.0)
def to_code(config):
cg.add_library('AsyncMqttClient', '0.8.2')
cg.add_define('USE_MQTT')
cg.add_global(mqtt_ns.using)
var = cg.new_Pvariable(config[CONF_ID])
cg.add(var.set_broker_address(config[CONF_BROKER]))
@@ -217,10 +221,6 @@ def to_code(config):
trig = cg.new_Pvariable(conf[CONF_TRIGGER_ID], conf[CONF_TOPIC], conf[CONF_QOS])
yield automation.build_automation(trig, [(cg.JsonObjectConstRef, 'x')], conf)
cg.add_library('AsyncMqttClient', '0.8.2')
cg.add_define('USE_MQTT')
cg.add_global(mqtt_ns.using)
MQTT_PUBLISH_ACTION_SCHEMA = cv.Schema({
cv.GenerateID(): cv.use_id(MQTTClientComponent),