mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Convert core components to async-def coroutine syntax (#1658)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
		| @@ -277,7 +277,7 @@ def wifi_network(config, static_ip): | ||||
|  | ||||
|  | ||||
| @coroutine_with_priority(60.0) | ||||
| def to_code(config): | ||||
| async def to_code(config): | ||||
|     var = cg.new_Pvariable(config[CONF_ID]) | ||||
|     cg.add(var.set_use_address(config[CONF_USE_ADDRESS])) | ||||
|  | ||||
| @@ -305,9 +305,9 @@ def to_code(config): | ||||
|         add_mdns_library() | ||||
|  | ||||
|     # Register at end for OTA safe mode | ||||
|     yield cg.register_component(var, config) | ||||
|     await cg.register_component(var, config) | ||||
|  | ||||
|  | ||||
| @automation.register_condition("wifi.connected", WiFiConnectedCondition, cv.Schema({})) | ||||
| def wifi_connected_to_code(config, condition_id, template_arg, args): | ||||
|     yield cg.new_Pvariable(condition_id, template_arg) | ||||
| async def wifi_connected_to_code(config, condition_id, template_arg, args): | ||||
|     return cg.new_Pvariable(condition_id, template_arg) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user