esphome/esphome/components/vbus/__init__.py
Samuel Sieb 93ddce2e79
add Resol VBus support (#3976)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
fixes https://github.com/esphome/feature-requests/issues/1949
2023-02-07 12:17:17 +13:00

32 lines
766 B
Python

import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import uart
from esphome.const import CONF_ID
CODEOWNERS = ["@ssieb"]
DEPENDENCIES = ["uart"]
MULTI_CONF = True
vbus_ns = cg.esphome_ns.namespace("vbus")
VBus = vbus_ns.class_("VBus", uart.UARTDevice, cg.Component)
CONF_VBUS_ID = "vbus_id"
CONF_DELTASOL_BS_PLUS = "deltasol_bs_plus"
CONF_DELTASOL_C = "deltasol_c"
CONF_DELTASOL_CS2 = "deltasol_cs2"
CONF_DELTASOL_CS_PLUS = "deltasol_cs_plus"
CONFIG_SCHEMA = uart.UART_DEVICE_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(VBus),
}
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await uart.register_uart_device(var, config)