mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	add http request tests (#1448)
* add http request tests * add to test3 for esp8266 * move test action to another trigger
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							f084ab339b
						
					
				
				
					commit
					52c67d715b
				
			| @@ -26,6 +26,25 @@ esphome: | |||||||
|           green: !lambda 'return 255;' |           green: !lambda 'return 255;' | ||||||
|           blue: 0% |           blue: 0% | ||||||
|           white: 100% |           white: 100% | ||||||
|  |       - http_request.get: | ||||||
|  |           url: https://esphome.io | ||||||
|  |           headers: | ||||||
|  |             Content-Type: application/json | ||||||
|  |           verify_ssl: false | ||||||
|  |       - http_request.post: | ||||||
|  |           url: https://esphome.io | ||||||
|  |           verify_ssl: false | ||||||
|  |           json: | ||||||
|  |             key: !lambda |- | ||||||
|  |               return id(template_text).state; | ||||||
|  |             greeting: 'Hello World' | ||||||
|  |       - http_request.send: | ||||||
|  |           method: PUT | ||||||
|  |           url: https://esphome.io | ||||||
|  |           headers: | ||||||
|  |             Content-Type: application/json | ||||||
|  |           body: 'Some data' | ||||||
|  |           verify_ssl: false | ||||||
|   build_path: build/test1 |   build_path: build/test1 | ||||||
|  |  | ||||||
| packages: | packages: | ||||||
| @@ -50,6 +69,10 @@ wifi: | |||||||
|   reboot_timeout: 120s |   reboot_timeout: 120s | ||||||
|   power_save_mode: none |   power_save_mode: none | ||||||
|  |  | ||||||
|  | http_request: | ||||||
|  |   useragent: esphome/device | ||||||
|  |   timeout: 10s | ||||||
|  |  | ||||||
| mqtt: | mqtt: | ||||||
|   broker: '192.168.178.84' |   broker: '192.168.178.84' | ||||||
|   port: 1883 |   port: 1883 | ||||||
| @@ -211,7 +234,6 @@ mcp23s17: | |||||||
|     cs_pin: GPIO12 |     cs_pin: GPIO12 | ||||||
|     deviceaddress: 1 |     deviceaddress: 1 | ||||||
|  |  | ||||||
|  |  | ||||||
| sensor: | sensor: | ||||||
|   - platform: adc |   - platform: adc | ||||||
|     pin: A0 |     pin: A0 | ||||||
| @@ -1727,7 +1749,7 @@ display: | |||||||
|     lambda: |- |     lambda: |- | ||||||
|       it.rectangle(0, 0, it.get_width(), it.get_height()); |       it.rectangle(0, 0, it.get_width(), it.get_height()); | ||||||
|   - platform: ssd1322_spi |   - platform: ssd1322_spi | ||||||
|     model: "SSD1322 256x64" |     model: 'SSD1322 256x64' | ||||||
|     cs_pin: GPIO23 |     cs_pin: GPIO23 | ||||||
|     dc_pin: GPIO23 |     dc_pin: GPIO23 | ||||||
|     reset_pin: GPIO23 |     reset_pin: GPIO23 | ||||||
| @@ -1863,8 +1885,7 @@ time: | |||||||
|     update_interval: never |     update_interval: never | ||||||
|     on_time: |     on_time: | ||||||
|       seconds: 0 |       seconds: 0 | ||||||
|       then: |       then: ds1307.read_time | ||||||
|         ds1307.read_time |  | ||||||
|  |  | ||||||
| cover: | cover: | ||||||
|   - platform: template |   - platform: template | ||||||
|   | |||||||
| @@ -886,6 +886,25 @@ rf_bridge: | |||||||
|         code: 'ABC123' |         code: 'ABC123' | ||||||
|     - rf_bridge.send_raw: |     - rf_bridge.send_raw: | ||||||
|         raw: 'AAA5070008001000ABC12355' |         raw: 'AAA5070008001000ABC12355' | ||||||
|  |     - http_request.get: | ||||||
|  |         url: https://esphome.io | ||||||
|  |         headers: | ||||||
|  |           Content-Type: application/json | ||||||
|  |         verify_ssl: false | ||||||
|  |     - http_request.post: | ||||||
|  |         url: https://esphome.io | ||||||
|  |         verify_ssl: false | ||||||
|  |         json: | ||||||
|  |           key: !lambda |- | ||||||
|  |             return id(version_sensor).state; | ||||||
|  |           greeting: 'Hello World' | ||||||
|  |     - http_request.send: | ||||||
|  |         method: PUT | ||||||
|  |         url: https://esphome.io | ||||||
|  |         headers: | ||||||
|  |           Content-Type: application/json | ||||||
|  |         body: 'Some data' | ||||||
|  |         verify_ssl: false | ||||||
|  |  | ||||||
| display: | display: | ||||||
|   - platform: max7219digit |   - platform: max7219digit | ||||||
| @@ -897,3 +916,7 @@ display: | |||||||
|     id: my_matrix |     id: my_matrix | ||||||
|     lambda: |- |     lambda: |- | ||||||
|       it.printdigit("hello"); |       it.printdigit("hello"); | ||||||
|  |  | ||||||
|  | http_request: | ||||||
|  |   useragent: esphome/device | ||||||
|  |   timeout: 10s | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user