mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add rename command handler (#3443)
This commit is contained in:
		| @@ -283,6 +283,18 @@ class EsphomeLogsHandler(EsphomeCommandWebSocket): | |||||||
|         ] |         ] | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class EsphomeRenameHandler(EsphomeCommandWebSocket): | ||||||
|  |     def build_command(self, json_message): | ||||||
|  |         config_file = settings.rel_path(json_message["configuration"]) | ||||||
|  |         return [ | ||||||
|  |             "esphome", | ||||||
|  |             "--dashboard", | ||||||
|  |             "rename", | ||||||
|  |             config_file, | ||||||
|  |             json_message["newName"], | ||||||
|  |         ] | ||||||
|  |  | ||||||
|  |  | ||||||
| class EsphomeUploadHandler(EsphomeCommandWebSocket): | class EsphomeUploadHandler(EsphomeCommandWebSocket): | ||||||
|     def build_command(self, json_message): |     def build_command(self, json_message): | ||||||
|         config_file = settings.rel_path(json_message["configuration"]) |         config_file = settings.rel_path(json_message["configuration"]) | ||||||
| @@ -971,6 +983,7 @@ def make_app(debug=get_bool_env(ENV_DEV)): | |||||||
|             (f"{rel}devices", ListDevicesHandler), |             (f"{rel}devices", ListDevicesHandler), | ||||||
|             (f"{rel}import", ImportRequestHandler), |             (f"{rel}import", ImportRequestHandler), | ||||||
|             (f"{rel}secret_keys", SecretKeysRequestHandler), |             (f"{rel}secret_keys", SecretKeysRequestHandler), | ||||||
|  |             (f"{rel}rename", EsphomeRenameHandler), | ||||||
|         ], |         ], | ||||||
|         **app_settings, |         **app_settings, | ||||||
|     ) |     ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user