Move blinds to esp-idf

- can always revert
- better dhcp support
This commit is contained in:
2025-05-11 17:36:24 +02:00
parent e64468d6e4
commit f935bb35ac
5 changed files with 56 additions and 47 deletions
+6 -4
View File
@@ -1,7 +1,8 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import cover, mqtt
from esphome.const import CONF_ID
from esphome.components import cover
from esphome import pins
from esphome.const import CONF_ID, CONF_ALLOW_OTHER_USES
DEPENDENCIES = ["mqtt"]
AUTO_LOAD = ["mqtt"]
@@ -16,7 +17,7 @@ CONF_REMOTE_ID_OFFSET = "remote_id_offset"
CONFIG_SCHEMA = cover.COVER_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(SomfyRTSCover),
cv.Required(CONF_RF_PIN): cv.uint8_t,
cv.Required(CONF_RF_PIN): pins.gpio_output_pin_schema,
cv.Required(CONF_REMOTE_ID_BASE): cv.uint32_t,
cv.Required(CONF_REMOTE_ID_OFFSET): cv.uint32_t,
}
@@ -27,7 +28,8 @@ async def to_code(config):
await cg.register_component(var, config)
await cover.register_cover(var, config)
cg.add(var.set_rf_pin(config[CONF_RF_PIN]))
rf_pin = await cg.gpio_pin_expression(config[CONF_RF_PIN])
cg.add(var.set_rf_pin(rf_pin))
cg.add(var.set_remote_id(
config[CONF_REMOTE_ID_BASE] + config[CONF_REMOTE_ID_OFFSET]
))