mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
fix safe_mode (#1421)
* Deprioritize automations Ensures safe mode is loaded before any automations are ran * Fix lint
This commit is contained in:
parent
a269098a0e
commit
93e35a53ed
1 changed files with 10 additions and 5 deletions
|
@ -209,11 +209,8 @@ def _esp8266_add_lwip_type():
|
|||
cg.add_build_flag('-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH')
|
||||
|
||||
|
||||
@coroutine_with_priority(100.0)
|
||||
def to_code(config):
|
||||
cg.add_global(cg.global_ns.namespace('esphome').using)
|
||||
cg.add(cg.App.pre_setup(config[CONF_NAME], cg.RawExpression('__DATE__ ", " __TIME__')))
|
||||
|
||||
@coroutine_with_priority(30.0)
|
||||
def _add_automations(config):
|
||||
for conf in config.get(CONF_ON_BOOT, []):
|
||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], conf.get(CONF_PRIORITY))
|
||||
yield cg.register_component(trigger, conf)
|
||||
|
@ -229,6 +226,14 @@ def to_code(config):
|
|||
yield cg.register_component(trigger, conf)
|
||||
yield automation.build_automation(trigger, [], conf)
|
||||
|
||||
|
||||
@coroutine_with_priority(100.0)
|
||||
def to_code(config):
|
||||
cg.add_global(cg.global_ns.namespace('esphome').using)
|
||||
cg.add(cg.App.pre_setup(config[CONF_NAME], cg.RawExpression('__DATE__ ", " __TIME__')))
|
||||
|
||||
CORE.add_job(_add_automations, config)
|
||||
|
||||
# Set LWIP build constants for ESP8266
|
||||
if CORE.is_esp8266:
|
||||
CORE.add_job(_esp8266_add_lwip_type)
|
||||
|
|
Loading…
Reference in a new issue