mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 14:48:18 +00:00
Tests and better validation
This commit is contained in:
parent
d61a4fba63
commit
55f3948ad7
@ -9,8 +9,8 @@ GlobalVariableComponent = esphomelib_ns.class_('GlobalVariableComponent', Compon
|
||||
|
||||
GLOBAL_VAR_SCHEMA = vol.Schema({
|
||||
vol.Required(CONF_ID): cv.declare_variable_id(GlobalVariableComponent),
|
||||
vol.Required(CONF_TYPE): cv.string,
|
||||
vol.Optional(CONF_INITIAL_VALUE): cv.string,
|
||||
vol.Required(CONF_TYPE): cv.string_strict,
|
||||
vol.Optional(CONF_INITIAL_VALUE): cv.string_strict,
|
||||
vol.Optional(CONF_RESTORE_VALUE): cv.boolean,
|
||||
}).extend(cv.COMPONENT_SCHEMA.schema)
|
||||
|
||||
|
@ -1001,3 +1001,22 @@ stepper:
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
||||
|
||||
|
||||
globals:
|
||||
- id: glob_int
|
||||
type: int
|
||||
restore_value: yes
|
||||
initial_value: '0'
|
||||
- id: glob_float
|
||||
type: float
|
||||
restore_value: yes
|
||||
initial_value: '0.0f'
|
||||
- id: glob_bool
|
||||
type: bool
|
||||
restore_value: no
|
||||
initial_value: 'true'
|
||||
- id: glob_string
|
||||
type: std::string
|
||||
restore_value: no
|
||||
# initial_value: ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user