Cleanup dashboard JS (#491)

* Cleanup dashboard JS

* Add vscode

* Save start_mark/end_mark

* Updates

* Updates

* Remove need for cv.nameable

It's a bit hacky but removes so much bloat from integrations

* Add enum helper

* Document APIs, and Improvements

* Fixes

* Fixes

* Update PULL_REQUEST_TEMPLATE.md

* Updates

* Updates

* Updates
This commit is contained in:
Otto Winter
2019-04-22 21:56:30 +02:00
committed by GitHub
parent 6682c43dfa
commit 8e75980ebd
359 changed files with 4395 additions and 4223 deletions
+6 -3
View File
@@ -4,16 +4,19 @@ from esphome import automation
from esphome.const import CONF_ID, CONF_INTERVAL
interval_ns = cg.esphome_ns.namespace('interval')
IntervalTrigger = interval_ns.class_('IntervalTrigger', cg.Trigger.template(), cg.PollingComponent)
IntervalTrigger = interval_ns.class_('IntervalTrigger', automation.Trigger.template(),
cg.PollingComponent)
CONFIG_SCHEMA = automation.validate_automation(cv.Schema({
cv.GenerateID(): cv.declare_variable_id(IntervalTrigger),
cv.GenerateID(): cv.declare_id(IntervalTrigger),
cv.Required(CONF_INTERVAL): cv.positive_time_period_milliseconds,
}).extend(cv.COMPONENT_SCHEMA))
def to_code(config):
for conf in config:
var = cg.new_Pvariable(conf[CONF_ID], conf[CONF_INTERVAL])
var = cg.new_Pvariable(conf[CONF_ID])
yield cg.register_component(var, conf)
yield automation.build_automation(var, [], conf)
cg.add(var.set_update_interval(conf[CONF_INTERVAL]))