mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 06:12:20 +01:00
fix: update output ID reference in DynamicLamp configuration and include light_output header
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "esphome/core/component.h"
|
#include "esphome/core/component.h"
|
||||||
#include "esphome/components/output/float_output.h"
|
#include "esphome/components/output/float_output.h"
|
||||||
#include "esphome/components/light/light_output.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace dynamic_lamp {
|
namespace dynamic_lamp {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import light
|
from esphome.components import light
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_CHANNEL, CONF_ID
|
from esphome.const import CONF_CHANNEL, CONF_OUTPUT_ID
|
||||||
|
|
||||||
from .. import CONF_DYNAMIC_LAMP_ID, DynamicLampComponent, dynamic_lamp_ns
|
from .. import CONF_DYNAMIC_LAMP_ID, DynamicLampComponent, dynamic_lamp_ns
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ CHANNEL_OPTIONS = {
|
|||||||
|
|
||||||
CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend(
|
CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
cv.Required(CONF_ID): cv.declare_id(DynamicLamp),
|
cv.Required(CONF_OUTPUT_ID): cv.declare_id(DynamicLamp),
|
||||||
cv.GenerateID(CONF_DYNAMIC_LAMP_ID): cv.use_id(DynamicLampComponent),
|
cv.GenerateID(CONF_DYNAMIC_LAMP_ID): cv.use_id(DynamicLampComponent),
|
||||||
cv.Required(CONF_CHANNEL): cv.enum(CHANNEL_OPTIONS, upper=True),
|
cv.Required(CONF_CHANNEL): cv.enum(CHANNEL_OPTIONS, upper=True),
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ CONFIG_SCHEMA = light.BRIGHTNESS_ONLY_LIGHT_SCHEMA.extend(
|
|||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
parent = await cg.get_variable(config[CONF_DYNAMIC_LAMP_ID])
|
parent = await cg.get_variable(config[CONF_DYNAMIC_LAMP_ID])
|
||||||
var = cg.new_Pvariable(
|
var = cg.new_Pvariable(
|
||||||
config[CONF_ID],
|
config[CONF_OUTPUT_ID],
|
||||||
parent,
|
parent,
|
||||||
config[CONF_CHANNEL],
|
config[CONF_CHANNEL],
|
||||||
)
|
)
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../dynamic_lamp.h"
|
#include "../dynamic_lamp.h"
|
||||||
#include "esphome/core/component.h"
|
#include "esphome/components/light/light_output.h"
|
||||||
#include "esphome/components/output/float_output.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace dynamic_lamp {
|
namespace dynamic_lamp {
|
||||||
|
Reference in New Issue
Block a user