mirror of
https://github.com/esphome/esphome.git
synced 2025-07-20 22:09:38 +01:00
Let esphomeyaml know about class inheritance (#229)
* Allow overriding setup priority * Add inheritance tree * Global variables * Tests and better validation * Fix * Lint
This commit is contained in:
esphomeyaml
automation.py
components
ads1115.py
config.pyconfig_validation.pyconst.pyhelpers.pypins.pybinary_sensor
__init__.pyesp32_ble_tracker.pyesp32_touch.pygpio.pynextion.pypn532.pyrdm6300.pyremote_receiver.pystatus.pytemplate.py
cover
dallas.pydeep_sleep.pydisplay
__init__.pylcd_gpio.pylcd_pcf8574.pymax7219.pynextion.pyssd1306_i2c.pyssd1306_spi.pywaveshare_epaper.py
esp32_ble.pyesp32_ble_beacon.pyesp32_ble_tracker.pyesp32_touch.pyfan
font.pyglobals.pyi2c.pyimage.pyir_transmitter.pylight
logger.pymqtt.pyota.pyoutput
pca9685.pypcf8574.pypn532.pypower_supply.pyrdm6300.pyremote_receiver.pyremote_transmitter.pyscript.pysensor
__init__.pyadc.pyads1115.pybh1750.pyble_rssi.pybme280.pybme680.pybmp085.pybmp280.pycse7766.pydallas.pydht.pydht12.pyduty_cycle.pyesp32_hall.pyhdc1080.pyhlw8012.pyhmc5883l.pyhtu21d.pyhx711.pyina219.pyina3221.pymax6675.pymhz19.pympu6050.pymqtt_subscribe.pyms5611.pypmsx003.pypulse_counter.pyrotary_encoder.pysht3xd.pytcs34725.pytemplate.pytotal_daily_energy.pytsl2561.pyultrasonic.pyuptime.pywifi_signal.pyxiaomi_miflora.pyxiaomi_mijia.py
spi.pystatus_led.pystepper
switch
text_sensor
time
uart.pyweb_server.pywifi.pytests
@@ -1,24 +1,24 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from esphomeyaml.components import light, output
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import light
|
||||
from esphomeyaml.const import CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT, CONF_EFFECTS
|
||||
from esphomeyaml.helpers import App, get_variable, variable
|
||||
from esphomeyaml.const import CONF_EFFECTS, CONF_MAKE_ID, CONF_NAME, CONF_OUTPUT
|
||||
from esphomeyaml.helpers import App, get_variable, setup_component, variable
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(light.LIGHT_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(CONF_MAKE_ID): cv.declare_variable_id(light.MakeLight),
|
||||
vol.Required(CONF_OUTPUT): cv.use_variable_id(None),
|
||||
vol.Required(CONF_OUTPUT): cv.use_variable_id(output.BinaryOutput),
|
||||
vol.Optional(CONF_EFFECTS): light.validate_effects(light.BINARY_EFFECTS),
|
||||
}))
|
||||
}).extend(cv.COMPONENT_SCHEMA.schema))
|
||||
|
||||
|
||||
def to_code(config):
|
||||
output = None
|
||||
for output in get_variable(config[CONF_OUTPUT]):
|
||||
for output_ in get_variable(config[CONF_OUTPUT]):
|
||||
yield
|
||||
rhs = App.make_binary_light(config[CONF_NAME], output)
|
||||
rhs = App.make_binary_light(config[CONF_NAME], output_)
|
||||
light_struct = variable(config[CONF_MAKE_ID], rhs)
|
||||
light.setup_light(light_struct.Pstate, light_struct.Pmqtt, config)
|
||||
setup_component(light_struct.Pstate, config)
|
||||
|
||||
|
||||
def to_hass_config(data, config):
|
||||
|
Reference in New Issue
Block a user