From edcadc146c17826e4955bdd32a1892dd636aad97 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Thu, 8 Apr 2021 01:41:46 +0200 Subject: [PATCH] Moved the finished light component into its own subdirectory to keep things clean when implementing other components. --- __init__.py | 1 + light.py => light/__init__.py | 4 +--- color_instant_handler.h => light/color_instant_handler.h | 0 color_night_light.h => light/color_night_light.h | 0 color_off.h => light/color_off.h | 0 color_rgb_light.h => light/color_rgb_light.h | 0 .../color_transition_handler.h | 0 color_white_light.h => light/color_white_light.h | 0 common.h => light/common.h | 0 gpio_outputs.h => light/gpio_outputs.h | 0 light.h => light/light.h | 0 11 files changed, 2 insertions(+), 3 deletions(-) rename light.py => light/__init__.py (97%) rename color_instant_handler.h => light/color_instant_handler.h (100%) rename color_night_light.h => light/color_night_light.h (100%) rename color_off.h => light/color_off.h (100%) rename color_rgb_light.h => light/color_rgb_light.h (100%) rename color_transition_handler.h => light/color_transition_handler.h (100%) rename color_white_light.h => light/color_white_light.h (100%) rename common.h => light/common.h (100%) rename gpio_outputs.h => light/gpio_outputs.h (100%) rename light.h => light/light.h (100%) diff --git a/__init__.py b/__init__.py index e69de29..00c85c7 100644 --- a/__init__.py +++ b/__init__.py @@ -0,0 +1 @@ +CODEOWNERS = ["@mmakaay"] diff --git a/light.py b/light/__init__.py similarity index 97% rename from light.py rename to light/__init__.py index 3c91d84..a004859 100644 --- a/light.py +++ b/light/__init__.py @@ -7,8 +7,6 @@ from esphome.const import CONF_RED, CONF_GREEN, CONF_BLUE, CONF_WHITE, CONF_OUTP CONF_MASTER1 = "master1" CONF_MASTER2 = "master2" -CODEOWNERS = ["@mmakaay"] - yeelight_ns = cg.esphome_ns.namespace("yeelight") bs2_ns = yeelight_ns.namespace("bs2") light_state = bs2_ns.class_("YeelightBS2LightState", cg.Nameable, cg.Component) @@ -25,7 +23,7 @@ CONFIG_SCHEMA = light.RGB_LIGHT_SCHEMA.extend({ cv.Required(CONF_MASTER1): cv.use_id(gpio_output.GPIOBinaryOutput), cv.Required(CONF_MASTER2): cv.use_id(gpio_output.GPIOBinaryOutput), }) -import json; + def to_code(config): var = cg.new_Pvariable(config[CONF_OUTPUT_ID]) yield light.register_light(var, config) diff --git a/color_instant_handler.h b/light/color_instant_handler.h similarity index 100% rename from color_instant_handler.h rename to light/color_instant_handler.h diff --git a/color_night_light.h b/light/color_night_light.h similarity index 100% rename from color_night_light.h rename to light/color_night_light.h diff --git a/color_off.h b/light/color_off.h similarity index 100% rename from color_off.h rename to light/color_off.h diff --git a/color_rgb_light.h b/light/color_rgb_light.h similarity index 100% rename from color_rgb_light.h rename to light/color_rgb_light.h diff --git a/color_transition_handler.h b/light/color_transition_handler.h similarity index 100% rename from color_transition_handler.h rename to light/color_transition_handler.h diff --git a/color_white_light.h b/light/color_white_light.h similarity index 100% rename from color_white_light.h rename to light/color_white_light.h diff --git a/common.h b/light/common.h similarity index 100% rename from common.h rename to light/common.h diff --git a/gpio_outputs.h b/light/gpio_outputs.h similarity index 100% rename from gpio_outputs.h rename to light/gpio_outputs.h diff --git a/light.h b/light/light.h similarity index 100% rename from light.h rename to light/light.h