Bug fixes and switch

This commit is contained in:
T
2025-03-20 16:49:53 +01:00
parent 2c29ef0e71
commit 76f27cdfeb
5 changed files with 120 additions and 62 deletions

View File

@@ -6,8 +6,6 @@ from . import CONF_OPTOMA_RS232_ID, OptomaRS232Component, optoma_ns
DEPENDENCIES = ["optoma_rs232"]
InputSelect = optoma_ns.class_("InputSelect", select.Select)
Inputs = optoma_ns.enum("Inputs")
INPUT_OPTIONS = {
"Unknown": 0,
@@ -16,6 +14,7 @@ INPUT_OPTIONS = {
"HDMI 2": 8,
}
InputSelect = optoma_ns.class_("InputSelect", select.Select)
CONFIG_SCHEMA = select.select_schema(InputSelect).extend({
cv.GenerateID(CONF_OPTOMA_RS232_ID): cv.use_id(OptomaRS232Component),
})
@@ -23,5 +22,6 @@ CONFIG_SCHEMA = select.select_schema(InputSelect).extend({
async def to_code(config):
hub = await cg.get_variable(config[CONF_OPTOMA_RS232_ID])
sens = await select.new_select(config, options=list(INPUT_OPTIONS))
cg.add(hub.set_beamer_input_select(sens))
cont = await select.new_select(config, options=list(INPUT_OPTIONS))
await cg.register_parented(cont, config[CONF_OPTOMA_RS232_ID])
cg.add(hub.set_beamer_input_select(cont))