mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 07:31:51 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -252,7 +252,10 @@ 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))
|
||||||
|
|
||||||
cg.add(var.traits.set_mode(config[CONF_MODE]))
|
# 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]))
|
||||||
|
|
||||||
for conf in config.get(CONF_ON_VALUE, []):
|
for conf in config.get(CONF_ON_VALUE, []):
|
||||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
||||||
|
|||||||
Reference in New Issue
Block a user