mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 12:22:20 +01:00
Update for 1.4.0
This commit is contained in:
@@ -33,5 +33,4 @@ def register_switch(var, config):
|
||||
setup_mqtt_switch(mqtt_switch, config)
|
||||
|
||||
|
||||
def build_flags(config):
|
||||
return '-DUSE_SWITCH'
|
||||
BUILD_FLAGS = '-DUSE_SWITCH'
|
||||
|
@@ -19,5 +19,4 @@ def to_code(config):
|
||||
switch.setup_mqtt_switch(gpio.Pmqtt, config)
|
||||
|
||||
|
||||
def build_flags(config):
|
||||
return '-DUSE_GPIO_SWITCH'
|
||||
BUILD_FLAGS = '-DUSE_GPIO_SWITCH'
|
||||
|
@@ -92,5 +92,4 @@ def to_code(config):
|
||||
switch.register_switch(switch_, config)
|
||||
|
||||
|
||||
def build_flags(config):
|
||||
return '-DUSE_IR_TRANSMITTER'
|
||||
BUILD_FLAGS = '-DUSE_IR_TRANSMITTER'
|
||||
|
22
esphomeyaml/components/switch/output.py
Normal file
22
esphomeyaml/components/switch/output.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import voluptuous as vol
|
||||
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import switch
|
||||
from esphomeyaml.const import CONF_ID, CONF_NAME
|
||||
from esphomeyaml.helpers import App, get_variable, variable
|
||||
|
||||
PLATFORM_SCHEMA = switch.PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID('output_switch'): cv.register_variable_id,
|
||||
vol.Required(CONF_ID): cv.variable_id,
|
||||
}).extend(switch.MQTT_SWITCH_SCHEMA.schema)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
output = get_variable(config[CONF_ID])
|
||||
rhs = App.make_simple_switch(config[CONF_NAME], output)
|
||||
gpio = variable('Application::MakeSimpleSwitch', config[CONF_ID], rhs)
|
||||
switch.setup_switch(gpio.Pswitch_, config)
|
||||
switch.setup_mqtt_switch(gpio.Pmqtt, config)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_SIMPLE_SWITCH'
|
@@ -15,5 +15,4 @@ def to_code(config):
|
||||
switch.setup_mqtt_switch(restart.Pmqtt, config)
|
||||
|
||||
|
||||
def build_flags(config):
|
||||
return '-DUSE_RESTART_SWITCH'
|
||||
BUILD_FLAGS = '-DUSE_RESTART_SWITCH'
|
||||
|
19
esphomeyaml/components/switch/shutdown.py
Normal file
19
esphomeyaml/components/switch/shutdown.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import esphomeyaml.config_validation as cv
|
||||
from esphomeyaml.components import switch
|
||||
from esphomeyaml.const import CONF_ID, CONF_NAME
|
||||
from esphomeyaml.helpers import App, variable
|
||||
|
||||
PLATFORM_SCHEMA = switch.PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID('shutdown_switch'): cv.register_variable_id,
|
||||
}).extend(switch.MQTT_SWITCH_SCHEMA.schema)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
rhs = App.make_shutdown_switch(config[CONF_NAME])
|
||||
shutdown = variable('Application::MakeShutdownSwitch', config[CONF_ID],
|
||||
rhs)
|
||||
switch.setup_switch(shutdown.Pshutdown, config)
|
||||
switch.setup_mqtt_switch(shutdown.Pmqtt, config)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_SHUTDOWN_SWITCH'
|
Reference in New Issue
Block a user