diff --git a/README.md b/README.md index 0a4e31c..2e3fced 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ Create a folder named `custom_components` in the folder where your device's yaml configuration file is stored. Then clone the the Github -repo into that folder. For example on the command line: +repo into a subfolder `yeelight_bs2`. For example on the command line: ``` # mkdir custom_components # cd custom_components -# git clone https://github.com/mmakaay/esphome-yeelight_bs2 +# git clone https://github.com/mmakaay/esphome-yeelight_bs2 yeelight_bs2 ``` Your folder structure should now look like: @@ -17,7 +17,7 @@ Your folder structure should now look like: config ├── yourdevice.yaml ├── custom_components/ -│ ├── esphome-yeelight_bs2/ +│ ├── yeelight_bs2/ │ . ├── README.md . . ├── yeelight_bs2_light_output.h . . diff --git a/light.py b/light.py index 08fff07..760110f 100644 --- a/light.py +++ b/light.py @@ -3,7 +3,6 @@ import esphome.config_validation as cv from esphome.components import light, output, gpio from esphome.const import CONF_RED, CONF_GREEN, CONF_BLUE, CONF_WHITE, CONF_OUTPUT_ID - CONF_MASTER1 = "master1" CONF_MASTER2 = "master2" @@ -29,13 +28,18 @@ def to_code(config): red = yield cg.get_variable(config[CONF_RED]) cg.add(var.set_red(red)) + green = yield cg.get_variable(config[CONF_GREEN]) cg.add(var.set_green(green)) + blue = yield cg.get_variable(config[CONF_BLUE]) cg.add(var.set_blue(blue)) + white = yield cg.get_variable(config[CONF_WHITE]) cg.add(var.set_white(white)) + master1 = yield cg.get_variable(config[CONF_MASTER1]) cg.add(var.set_master1(master1)) + master2 = yield cg.get_variable(config[CONF_MASTER2]) cg.add(var.set_master2(master2))