1
0
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:
Otto Winter 2018-11-12 22:53:09 +01:00
parent d61a4fba63
commit 55f3948ad7
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 21 additions and 2 deletions

View File

@ -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)

View File

@ -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: ""