1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-07 05:42:20 +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

@@ -5,7 +5,7 @@ from esphome.automation import Condition, maybe_simple_id
from esphome.components import mqtt
from esphome.const import CONF_ICON, CONF_ID, CONF_INTERNAL, CONF_INVERTED, CONF_ON_TURN_OFF, \
CONF_ON_TURN_ON, CONF_TRIGGER_ID, CONF_MQTT_ID, CONF_NAME
from esphome.core import CORE, coroutine
from esphome.core import CORE, coroutine, coroutine_with_priority
IS_PLATFORM_COMPONENT = True
@@ -92,6 +92,7 @@ def switch_is_off_to_code(config, condition_id, template_arg, args):
yield cg.new_Pvariable(condition_id, template_arg, paren)
@coroutine_with_priority(100.0)
def to_code(config):
cg.add_global(switch_ns.using)
cg.add_define('USE_SWITCH')