mirror of
https://github.com/esphome/esphome.git
synced 2024-12-26 17:17:46 +01:00
Number step not optional (#4649)
* Number step not optional * Update __init__.py * Update __init__.py --------- Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
878155a03d
commit
d78e9e6aa8
@ -1,4 +1,3 @@
|
|||||||
from typing import Optional
|
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
@ -252,9 +251,7 @@ async def register_number(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def new_number(
|
async def new_number(config, *, min_value: float, max_value: float, step: float):
|
||||||
config, *, min_value: float, max_value: float, step: Optional[float] = None
|
|
||||||
):
|
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = cg.new_Pvariable(config[CONF_ID])
|
||||||
await register_number(
|
await register_number(
|
||||||
var, config, min_value=min_value, max_value=max_value, step=step
|
var, config, min_value=min_value, max_value=max_value, step=step
|
||||||
|
Loading…
Reference in New Issue
Block a user