From c12408326c893a4b6474be924534ce89825ef533 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 17 Feb 2023 19:06:18 +1300 Subject: [PATCH] Fix adoption of variants and pico-w (#4455) --- .../components/dashboard_import/__init__.py | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/esphome/components/dashboard_import/__init__.py b/esphome/components/dashboard_import/__init__.py index e1bd6a7f08..6b6750cbf4 100644 --- a/esphome/components/dashboard_import/__init__.py +++ b/esphome/components/dashboard_import/__init__.py @@ -83,11 +83,30 @@ def import_config( raise FileExistsError if project_name == "esphome.web": + if "esp32c3" in import_url: + board = "esp32-c3-devkitm-1" + platform = "ESP32" + elif "esp32s2" in import_url: + board = "esp32-s2-saola-1" + platform = "ESP32" + elif "esp32s3" in import_url: + board = "esp32-s3-devkitc-1" + platform = "ESP32" + elif "esp32" in import_url: + board = "esp32dev" + platform = "ESP32" + elif "esp8266" in import_url: + board = "esp01_1m" + platform = "ESP8266" + elif "pico-w" in import_url: + board = "pico-w" + platform = "RP2040" + kwargs = { "name": name, "friendly_name": friendly_name, - "platform": "ESP32" if "esp32" in import_url else "ESP8266", - "board": "esp32dev" if "esp32" in import_url else "esp01_1m", + "platform": platform, + "board": board, "ssid": "!secret wifi_ssid", "psk": "!secret wifi_password", }