1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-21 12:42:21 +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

@@ -1,8 +1,8 @@
import voluptuous as vol
import esphomeyaml.config_validation as cv
from esphomeyaml.components import binary_sensor
from esphomeyaml.components import binary_sensor, display
from esphomeyaml.components.display.nextion import Nextion
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_COMPONENT_ID, CONF_NAME, CONF_PAGE_ID
from esphomeyaml.helpers import get_variable
@@ -10,7 +10,10 @@ DEPENDENCIES = ['display']
CONF_NEXTION_ID = 'nextion_id'
NextionTouchComponent = display.display_ns.NextionTouchComponent
PLATFORM_SCHEMA = cv.nameable(binary_sensor.BINARY_SENSOR_PLATFORM_SCHEMA.extend({
cv.GenerateID(): cv.declare_variable_id(NextionTouchComponent),
vol.Required(CONF_PAGE_ID): cv.uint8_t,
vol.Required(CONF_COMPONENT_ID): cv.uint8_t,
cv.GenerateID(CONF_NEXTION_ID): cv.use_variable_id(Nextion)