mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add support for Waveshare 2.13" V2 display (#6337)
* Add support for Waveshare 2.13" V2 display * Fix clang-tidy error, add comment about BUSY in deep sleep * Add test * Add nullptr check and move tests to separate file * Fix GPIO pins in test
This commit is contained in:
		
							
								
								
									
										154
									
								
								tests/components/waveshare_epaper/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								tests/components/waveshare_epaper/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,154 @@ | ||||
| --- | ||||
| spi: | ||||
|   - id: spi_id_1 | ||||
|     clk_pin: | ||||
|       number: GPIO18 | ||||
|     mosi_pin: | ||||
|       number: GPIO23 | ||||
|     miso_pin: | ||||
|       number: GPIO19 | ||||
|     interface: hardware | ||||
|  | ||||
| display: | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.13in-ttgo-b1 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.90in | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     full_update_every: 30 | ||||
|     reset_duration: 200ms | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.90inv2 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.70in-b | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.70in-bv2 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 1.54in-m5coreink-m09 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.13inv3 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     model: 2.13inv2 | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO25 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO26 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO27 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO32 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
							
								
								
									
										124
									
								
								tests/test4.yaml
									
									
									
									
									
								
							
							
						
						
									
										124
									
								
								tests/test4.yaml
									
									
									
									
									
								
							| @@ -612,112 +612,6 @@ display: | ||||
|     rotation: 0° | ||||
|     update_interval: 16ms | ||||
|  | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 2.13in-ttgo-b1 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 2.90in | ||||
|     full_update_every: 30 | ||||
|     reset_duration: 200ms | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 2.90inv2 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 2.70in-b | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 2.70in-bv2 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     dc_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     busy_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     reset_pin: | ||||
|       allow_other_uses: true | ||||
|       number: GPIO23 | ||||
|     model: 1.54in-m5coreink-m09 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|   - platform: inkplate6 | ||||
|     id: inkplate_display | ||||
|     greyscale: false | ||||
| @@ -771,24 +665,6 @@ display: | ||||
|     vcom_pin: | ||||
|       number: GPIO1 | ||||
|       allow_other_uses: true | ||||
|   - platform: waveshare_epaper | ||||
|     spi_id: spi_id_1 | ||||
|     cs_pin: | ||||
|       number: GPIO23 | ||||
|       allow_other_uses: true | ||||
|     dc_pin: | ||||
|       number: GPIO23 | ||||
|       allow_other_uses: true | ||||
|     busy_pin: | ||||
|       number: GPIO23 | ||||
|       allow_other_uses: true | ||||
|     reset_pin: | ||||
|       number: GPIO23 | ||||
|       allow_other_uses: true | ||||
|     model: 2.13inv3 | ||||
|     full_update_every: 30 | ||||
|     lambda: |- | ||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||
|  | ||||
| number: | ||||
|   - platform: tuya | ||||
|   | ||||
		Reference in New Issue
	
	Block a user