rename folder

This commit is contained in:
2023-12-17 20:31:18 +01:00
parent 9ee2ee5864
commit 90b58c7e4d
76 changed files with 0 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
```yaml
# example configuration:
light:
- platform: empty_light
name: Empty light
output: pwm_output
output:
- platform: esp8266_pwm
pin: D1
frequency: 1000 Hz
id: pwm_output
```
+32
View File
@@ -0,0 +1,32 @@
#include "esphome/core/log.h"
#include "empty_light.h"
namespace esphome {
namespace empty_light {
static const char *TAG = "empty_light.light";
void EmptyLightOutput::setup() {
}
light::LightTraits EmptyLightOutput::get_traits() {
auto traits = light::LightTraits();
traits.set_supports_brightness(true);
traits.set_supports_rgb(false);
traits.set_supports_rgb_white_value(false);
traits.set_supports_color_temperature(false);
return traits;
}
void EmptyLightOutput::write_state(light::LightState *state) {
}
void EmptyLightOutput::dump_config(){
ESP_LOGCONFIG(TAG, "Empty custom light");
}
} //namespace empty_light
} //namespace esphome
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/output/float_output.h"
#include "esphome/components/light/light_output.h"
namespace esphome {
namespace empty_light {
class EmptyLightOutput : public light::LightOutput, public Component {
public:
void setup() override;
light::LightTraits get_traits() override;
void set_output(output::FloatOutput *output) { output_ = output; }
void write_state(light::LightState *state) override;
void dump_config() override;
protected:
output::FloatOutput *output_;
};
} //namespace empty_light
} //namespace esphome
+19
View File
@@ -0,0 +1,19 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
empty_light_ns = cg.esphome_ns.namespace('empty_light')
EmptyLightOutput = empty_light_ns.class_('EmptyLightOutput', light.LightOutput)
CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend({
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(EmptyLightOutput),
cv.Required(CONF_OUTPUT): cv.use_id(output.FloatOutput)
})
def to_code(config):
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))