From c24fa132a074384fd1fe5c3c91daad96420bdcad Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Thu, 25 Mar 2021 00:29:47 +0100 Subject: [PATCH] Improved documentation. --- README.md | 6 +++--- light.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) 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))