mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Cleanup dashboard JS (#491)
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
This commit is contained in:
		| @@ -2,8 +2,7 @@ import esphome.codegen as cg | ||||
| import esphome.config_validation as cv | ||||
| from esphome import pins | ||||
| from esphome.components import lcd_base | ||||
| from esphome.const import CONF_DATA_PINS, CONF_ENABLE_PIN, CONF_RS_PIN, CONF_RW_PIN, CONF_ID, \ | ||||
|     CONF_UPDATE_INTERVAL | ||||
| from esphome.const import CONF_DATA_PINS, CONF_ENABLE_PIN, CONF_RS_PIN, CONF_RW_PIN, CONF_ID | ||||
|  | ||||
| AUTO_LOAD = ['lcd_base'] | ||||
|  | ||||
| @@ -19,7 +18,7 @@ def validate_pin_length(value): | ||||
|  | ||||
|  | ||||
| CONFIG_SCHEMA = lcd_base.LCD_SCHEMA.extend({ | ||||
|     cv.GenerateID(): cv.declare_variable_id(GPIOLCDDisplay), | ||||
|     cv.GenerateID(): cv.declare_id(GPIOLCDDisplay), | ||||
|     cv.Required(CONF_DATA_PINS): cv.All([pins.gpio_output_pin_schema], validate_pin_length), | ||||
|     cv.Required(CONF_ENABLE_PIN): pins.gpio_output_pin_schema, | ||||
|     cv.Required(CONF_RS_PIN): pins.gpio_output_pin_schema, | ||||
| @@ -28,7 +27,7 @@ CONFIG_SCHEMA = lcd_base.LCD_SCHEMA.extend({ | ||||
|  | ||||
|  | ||||
| def to_code(config): | ||||
|     var = cg.new_Pvariable(config[CONF_ID], config[CONF_UPDATE_INTERVAL]) | ||||
|     var = cg.new_Pvariable(config[CONF_ID]) | ||||
|     yield lcd_base.setup_lcd_display(var, config) | ||||
|     pins_ = [] | ||||
|     for conf in config[CONF_DATA_PINS]: | ||||
|   | ||||
| @@ -8,8 +8,6 @@ namespace lcd_gpio { | ||||
|  | ||||
| class GPIOLCDDisplay : public lcd_base::LCDDisplay { | ||||
|  public: | ||||
|   GPIOLCDDisplay(uint32_t update_interval) : LCDDisplay(update_interval) {} | ||||
|  | ||||
|   void setup() override; | ||||
|   void set_data_pins(GPIOPin *d0, GPIOPin *d1, GPIOPin *d2, GPIOPin *d3) { | ||||
|     this->data_pins_[0] = d0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user