UART CSV Config Back in place

This commit is contained in:
Václav Španinger 2024-12-27 11:26:06 +01:00
parent ff29c1ac60
commit e04fd29b1d

View File

@ -13,17 +13,18 @@ serial_ns = cg.esphome_ns.namespace('serial')
SerialCSV = serial_ns.class_('SerialCSV', cg.Component, sensor.Sensor, uart.UARTDevice) SerialCSV = serial_ns.class_('SerialCSV', cg.Component, sensor.Sensor, uart.UARTDevice)
CONFIG_SCHEMA = cv.Schema( CONFIG_SCHEMA = uart.UART_DEVICE_SCHEMA.extend(
{ {
cv.Optional(CONF_BED_TEMPERATURE): sensor.sensor_schema( cv.GenerateID(): cv.declare_id(SerialCSV),
unit_of_measurement=UNIT_CELSIUS, cv.Required(CONF_SENSORS): cv.ensure_list(
accuracy_decimals=1, sensor.SENSOR_SCHEMA.extend(
device_class=DEVICE_CLASS_TEMPERATURE, {
state_class=STATE_CLASS_MEASUREMENT, cv.Required(CONF_INDEX): cv.positive_int,
}
)
), ),
} }
).extend(cv.polling_component_schema("60s")) )
async def to_code(config): async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID]) var = cg.new_Pvariable(config[CONF_ID])