1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 15:12:21 +01:00

fix: update FRAM component reference in DynamicLampComponent and add I2C dependency

This commit is contained in:
Oliver Kleinecke
2025-02-18 12:21:32 +01:00
parent 35642a7090
commit 1d70552bf6
2 changed files with 6 additions and 4 deletions

View File

@@ -1,13 +1,15 @@
import esphome.codegen as cg
from esphome.components import output
from esphome.components.fram import FRAM
from esphome.components import i2c, output
from esphome.components.time import RealTimeClock
import esphome.config_validation as cv
from esphome.const import CONF_ID
DEPENDENCIES = ["i2c", "rtc", "fram", "output"]
CODEOWNERS = ["@p1ngb4ck"]
MULTI_CONF = False
fram_ns = cg.esphome_ns.namespace("fram")
FRAMComponent = fram_ns.class_("FRAM", cg.Component, i2c.I2CDevice)
dynamic_lamp_ns = cg.esphome_ns.namespace('dynamic_lamp')
DynamicLampComponent = dynamic_lamp_ns.class_('DynamicLampComponent', cg.Component)
CONF_DYNAMIC_LAMP_ID = "dynamic_lamp_id"
@@ -19,7 +21,7 @@ CONF_AVAILABLE_OUTPUTS = 'available_outputs'
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(CONF_ID): cv.declare_id(DynamicLampComponent),
cv.Required(CONF_RTC): cv.use_id(RealTimeClock),
cv.Required(CONF_FRAM): cv.use_id(FRAM),
cv.Required(CONF_FRAM): cv.use_id(FRAMComponent),
cv.Required(CONF_AVAILABLE_OUTPUTS): [cv.use_id(output.FloatOutput)],
cv.Optional(CONF_SAVE_MODE, default=0): cv.int_range(0, 1),
}).extend(cv.COMPONENT_SCHEMA)

View File

@@ -4,7 +4,7 @@ from esphome.components import output
from esphome.const import CONF_CHANNEL, CONF_ID, CONF_INITIAL_VALUE
from .. import Mcp4461Component, CONF_MCP4461_ID, mcp4461_ns
DEPENDENCIES = ["mcp4461"]
DEPENDENCIES = ["mcp4461", "output"]
Mcp4461Wiper = mcp4461_ns.class_(
"Mcp4461Wiper", output.FloatOutput, cg.Parented.template(Mcp4461Component)