1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-11 07:42:26 +01:00

Better typing to components (#225)

* Add better typing

* Fix
This commit is contained in:
Otto Winter
2018-11-08 16:01:07 +01:00
committed by GitHub
parent 94978d0063
commit 3594779401
34 changed files with 79 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ from esphomeyaml.helpers import App, Application, ArrayInitializer, get_variable
DEPENDENCIES = ['uart']
MakeUARTSwitch = Application.MakeUARTSwitch
UARTSwitch = switch.switch_ns.UARTSwitch
def validate_data(value):
@@ -23,6 +24,7 @@ def validate_data(value):
PLATFORM_SCHEMA = cv.nameable(switch.SWITCH_PLATFORM_SCHEMA.extend({
cv.GenerateID(): cv.declare_variable_id(UARTSwitch),
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(MakeUARTSwitch),
cv.GenerateID(CONF_UART_ID): cv.use_variable_id(UARTComponent),
vol.Required(CONF_DATA): validate_data,