mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Supply return_type for more lambdas
This commit is contained in:
		| @@ -7,7 +7,7 @@ from esphomeyaml.const import CONF_DATA_PINS, CONF_DIMENSIONS, CONF_ENABLE_PIN, | ||||
|     CONF_LAMBDA, CONF_RS_PIN, CONF_RW_PIN | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, process_lambda | ||||
| from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component | ||||
| from esphomeyaml.cpp_types import App, PollingComponent | ||||
| from esphomeyaml.cpp_types import App, PollingComponent, void | ||||
|  | ||||
| LCDDisplay = display.display_ns.class_('LCDDisplay', PollingComponent) | ||||
| LCDDisplayRef = LCDDisplay.operator('ref') | ||||
| @@ -64,7 +64,8 @@ def to_code(config): | ||||
|         add(lcd.set_rw_pin(rw)) | ||||
|  | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(LCDDisplayRef, 'it')]): | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(LCDDisplayRef, 'it')], | ||||
|                                       return_type=void): | ||||
|             yield | ||||
|         add(lcd.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ import esphomeyaml.config_validation as cv | ||||
| from esphomeyaml.const import CONF_ADDRESS, CONF_DIMENSIONS, CONF_ID, CONF_LAMBDA | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, process_lambda | ||||
| from esphomeyaml.cpp_helpers import setup_component | ||||
| from esphomeyaml.cpp_types import App | ||||
| from esphomeyaml.cpp_types import App, void | ||||
|  | ||||
| DEPENDENCIES = ['i2c'] | ||||
|  | ||||
| @@ -28,7 +28,8 @@ def to_code(config): | ||||
|         add(lcd.set_address(config[CONF_ADDRESS])) | ||||
|  | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(LCDDisplayRef, 'it')]): | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(LCDDisplayRef, 'it')], | ||||
|                                       return_type=void): | ||||
|             yield | ||||
|         add(lcd.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ from esphomeyaml.const import CONF_CS_PIN, CONF_ID, CONF_INTENSITY, CONF_LAMBDA, | ||||
|     CONF_SPI_ID | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda | ||||
| from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component | ||||
| from esphomeyaml.cpp_types import App, PollingComponent | ||||
| from esphomeyaml.cpp_types import App, PollingComponent, void | ||||
|  | ||||
| DEPENDENCIES = ['spi'] | ||||
|  | ||||
| @@ -39,7 +39,8 @@ def to_code(config): | ||||
|         add(max7219.set_intensity(config[CONF_INTENSITY])) | ||||
|  | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(MAX7219ComponentRef, 'it')]): | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(MAX7219ComponentRef, 'it')], | ||||
|                                       return_type=void): | ||||
|             yield | ||||
|         add(max7219.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import esphomeyaml.config_validation as cv | ||||
| from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_UART_ID | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda | ||||
| from esphomeyaml.cpp_helpers import setup_component | ||||
| from esphomeyaml.cpp_types import App, PollingComponent | ||||
| from esphomeyaml.cpp_types import App, PollingComponent, void | ||||
|  | ||||
| DEPENDENCIES = ['uart'] | ||||
|  | ||||
| @@ -24,7 +24,8 @@ def to_code(config): | ||||
|     nextion = Pvariable(config[CONF_ID], rhs) | ||||
|  | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(NextionRef, 'it')]): | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(NextionRef, 'it')], | ||||
|                                       return_type=void): | ||||
|             yield | ||||
|         add(nextion.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ from esphomeyaml.const import CONF_ADDRESS, CONF_EXTERNAL_VCC, CONF_ID, CONF_LAM | ||||
|     CONF_RESET_PIN | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, process_lambda | ||||
| from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component | ||||
| from esphomeyaml.cpp_types import App | ||||
| from esphomeyaml.cpp_types import App, void | ||||
|  | ||||
| DEPENDENCIES = ['i2c'] | ||||
|  | ||||
| @@ -37,7 +37,7 @@ def to_code(config): | ||||
|         add(ssd.set_address(config[CONF_ADDRESS])) | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], | ||||
|                                       [(display.DisplayBufferRef, 'it')]): | ||||
|                                       [(display.DisplayBufferRef, 'it')], return_type=void): | ||||
|             yield | ||||
|         add(ssd.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ from esphomeyaml.const import CONF_CS_PIN, CONF_DC_PIN, CONF_EXTERNAL_VCC, CONF_ | ||||
|     CONF_MODEL, CONF_RESET_PIN, CONF_SPI_ID | ||||
| from esphomeyaml.cpp_generator import Pvariable, add, get_variable, process_lambda | ||||
| from esphomeyaml.cpp_helpers import gpio_output_pin_expression, setup_component | ||||
| from esphomeyaml.cpp_types import App, PollingComponent | ||||
| from esphomeyaml.cpp_types import App, PollingComponent, void | ||||
|  | ||||
| DEPENDENCIES = ['spi'] | ||||
|  | ||||
| @@ -60,7 +60,7 @@ def to_code(config): | ||||
|         add(ssd.set_external_vcc(config[CONF_EXTERNAL_VCC])) | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], | ||||
|                                       [(display.DisplayBufferRef, 'it')]): | ||||
|                                       [(display.DisplayBufferRef, 'it')], return_type=void): | ||||
|             yield | ||||
|         add(ssd.set_writer(lambda_)) | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ from esphomeyaml.const import CONF_BUSY_PIN, CONF_CS_PIN, CONF_DC_PIN, CONF_FULL | ||||
| from esphomeyaml.cpp_generator import get_variable, Pvariable, process_lambda, add | ||||
| from esphomeyaml.cpp_helpers import gpio_output_pin_expression, gpio_input_pin_expression, \ | ||||
|     setup_component | ||||
| from esphomeyaml.cpp_types import PollingComponent, App | ||||
| from esphomeyaml.cpp_types import PollingComponent, App, void | ||||
|  | ||||
| DEPENDENCIES = ['spi'] | ||||
|  | ||||
| @@ -71,7 +71,8 @@ def to_code(config): | ||||
|         raise NotImplementedError() | ||||
|  | ||||
|     if CONF_LAMBDA in config: | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(display.DisplayBufferRef, 'it')]): | ||||
|         for lambda_ in process_lambda(config[CONF_LAMBDA], [(display.DisplayBufferRef, 'it')], | ||||
|                                       return_type=void): | ||||
|             yield | ||||
|         add(epaper.set_writer(lambda_)) | ||||
|     if CONF_RESET_PIN in config: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user