mirror of
https://github.com/esphome/esphome.git
synced 2025-10-31 23:21:54 +00:00
touch ups
This commit is contained in:
@@ -75,6 +75,9 @@ async def to_code(config):
|
||||
else:
|
||||
cg.add(var.set_optimistic(config[CONF_OPTIMISTIC]))
|
||||
initial_option_index = config[CONF_OPTIONS].index(config[CONF_INITIAL_OPTION])
|
||||
# Only set if non-zero to avoid bloating setup() function
|
||||
# (initial_option_index_ is zero-initialized in the header)
|
||||
if initial_option_index != 0:
|
||||
cg.add(var.set_initial_option_index(initial_option_index))
|
||||
|
||||
if CONF_RESTORE_VALUE in config:
|
||||
|
||||
Reference in New Issue
Block a user