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
+8 -6
View File
@@ -6,13 +6,15 @@ from .. import binary_ns
BinaryLightOutput = binary_ns.class_('BinaryLightOutput', light.LightOutput)
CONFIG_SCHEMA = cv.nameable(light.BINARY_LIGHT_SCHEMA.extend({
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_variable_id(BinaryLightOutput),
cv.Required(CONF_OUTPUT): cv.use_variable_id(output.BinaryOutput),
}))
CONFIG_SCHEMA = light.BINARY_LIGHT_SCHEMA.extend({
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(BinaryLightOutput),
cv.Required(CONF_OUTPUT): cv.use_id(output.BinaryOutput),
})
def to_code(config):
out = yield cg.get_variable(config[CONF_OUTPUT])
var = cg.new_Pvariable(config[CONF_OUTPUT_ID], out)
var = cg.new_Pvariable(config[CONF_OUTPUT_ID])
yield light.register_light(var, config)
out = yield cg.get_variable(config[CONF_OUTPUT])
cg.add(var.set_output(out))
@@ -9,7 +9,7 @@ namespace binary {
class BinaryLightOutput : public light::LightOutput {
public:
BinaryLightOutput(output::BinaryOutput *output) : output_(output) {}
void set_output(output::BinaryOutput *output) { output_ = output; }
light::LightTraits get_traits() override {
auto traits = light::LightTraits();
traits.set_supports_brightness(false);