mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
@@ -21,3 +21,7 @@ def setup_mqtt_fan(obj, config):
|
||||
if CONF_SPEED_COMMAND_TOPIC in config:
|
||||
add(obj.set_custom_speed_command_topic(config[CONF_SPEED_COMMAND_TOPIC]))
|
||||
setup_mqtt_component(obj, config)
|
||||
|
||||
|
||||
def build_flags(config):
|
||||
return '-DUSE_FAN'
|
||||
|
||||
@@ -15,7 +15,7 @@ PLATFORM_SCHEMA = fan.PLATFORM_SCHEMA.extend({
|
||||
def to_code(config):
|
||||
output = get_variable(config[CONF_OUTPUT])
|
||||
rhs = App.make_fan(config[CONF_NAME])
|
||||
fan_struct = variable('Application::FanStruct', config[CONF_ID], rhs)
|
||||
fan_struct = variable('Application::MakeFan', config[CONF_ID], rhs)
|
||||
add(fan_struct.Poutput.set_binary(output))
|
||||
if CONF_OSCILLATION_OUTPUT in config:
|
||||
oscillation_output = get_variable(config[CONF_OSCILLATION_OUTPUT])
|
||||
|
||||
@@ -24,7 +24,7 @@ PLATFORM_SCHEMA = fan.PLATFORM_SCHEMA.extend({
|
||||
def to_code(config):
|
||||
output = get_variable(config[CONF_OUTPUT])
|
||||
rhs = App.make_fan(config[CONF_NAME])
|
||||
fan_struct = variable('Application::FanStruct', config[CONF_ID], rhs)
|
||||
fan_struct = variable('Application::MakeFan', config[CONF_ID], rhs)
|
||||
if CONF_SPEED in config:
|
||||
speeds = config[CONF_SPEED]
|
||||
add(fan_struct.Poutput.set_speed(output, 0.0,
|
||||
|
||||
Reference in New Issue
Block a user