1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

[tuya_select] - Fix datapoint config error. (#8871)

This commit is contained in:
Cossid
2025-05-21 20:26:19 -05:00
committed by Jesse Hills
parent da4e710249
commit a5f85b4437

View File

@@ -54,8 +54,8 @@ async def to_code(config):
cg.add(var.set_select_mappings(list(options_map.keys())))
parent = await cg.get_variable(config[CONF_TUYA_ID])
cg.add(var.set_tuya_parent(parent))
if enum_datapoint := config.get(CONF_ENUM_DATAPOINT, None) is not None:
if (enum_datapoint := config.get(CONF_ENUM_DATAPOINT, None)) is not None:
cg.add(var.set_select_id(enum_datapoint, False))
if int_datapoint := config.get(CONF_INT_DATAPOINT, None) is not None:
if (int_datapoint := config.get(CONF_INT_DATAPOINT, None)) is not None:
cg.add(var.set_select_id(int_datapoint, True))
cg.add(var.set_optimistic(config[CONF_OPTIMISTIC]))