small error correction in init.py

This commit is contained in:
KoenBreeman 2024-08-16 10:49:45 +02:00
parent c04d029f48
commit 3c9b6e29dc
2 changed files with 3 additions and 4 deletions

View File

@ -8,10 +8,10 @@ DEPENDENCIES = ["i2c"]
MULTI_CONF = True
CONF_M5STACK_4RELAY_ID = "m5stack4relay_id"
CONF_M5STACK_4RELAY_ID = "m5stack_4relay_id"
m5stack_4relay_ns = cg.esphome_ns.namespace("m5stack_4relay")
M5Stack_4Relay = m5stack4relay_ns.class_("M5Stack_4Relay", cg.Component, i2c.I2CDevice)
M5Stack_4Relay = m5stack_4relay_ns.class_("M5Stack_4Relay", cg.Component, i2c.I2CDevice)
CONFIG_SCHEMA = (
cv.Schema(

View File

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, switch
from esphome.const import CONF_CHANNEL, CONF_INTERLOCK # , CONF_ID,
from esphome.const import CONF_CHANNEL
from .. import m5stack_4relay_ns, M5Stack_4Relay, CONF_M5STACK_4RELAY_ID
@ -32,4 +32,3 @@ async def to_code(config):
await cg.register_parented(var, config[CONF_M5STACK_4RELAY_ID])
cg.add(var.set_channel(config[CONF_CHANNEL]))