mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 15:41:52 +00:00
Merge branch 'number_auto_default' into integration
This commit is contained in:
@@ -252,6 +252,9 @@ async def setup_number_core_(
|
|||||||
cg.add(var.traits.set_max_value(max_value))
|
cg.add(var.traits.set_max_value(max_value))
|
||||||
cg.add(var.traits.set_step(step))
|
cg.add(var.traits.set_step(step))
|
||||||
|
|
||||||
|
# Only set if non-default to avoid bloating setup() function
|
||||||
|
# (mode_ is initialized to NUMBER_MODE_AUTO in the header)
|
||||||
|
if config[CONF_MODE] != NumberMode.NUMBER_MODE_AUTO:
|
||||||
cg.add(var.traits.set_mode(config[CONF_MODE]))
|
cg.add(var.traits.set_mode(config[CONF_MODE]))
|
||||||
|
|
||||||
for conf in config.get(CONF_ON_VALUE, []):
|
for conf in config.get(CONF_ON_VALUE, []):
|
||||||
|
|||||||
Reference in New Issue
Block a user