Converted tfmini custom component into an external component

This commit is contained in:
John Dillenburg
2025-03-01 13:14:31 -06:00
parent abfc6939dd
commit 177179d8a4
11 changed files with 416 additions and 178 deletions

View File

@@ -0,0 +1,17 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import CONF_ID
DEPENDENCIES = ['uart']
AUTO_LOAD = ['sensor']
tfmini_ns = cg.esphome_ns.namespace('tfmini')
TFMiniComponent = tfmini_ns.class_('TFMiniComponent', cg.Component)
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(TFMiniComponent)
}).extend(cv.COMPONENT_SCHEMA)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)