mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 02:28:28 +02:00
Dont add wifi block to yaml if discovered device uses ethernet (#3882)
This commit is contained in:
@@ -395,11 +395,22 @@ class ImportRequestHandler(BaseHandler):
|
||||
args = json.loads(self.request.body.decode())
|
||||
try:
|
||||
name = args["name"]
|
||||
|
||||
imported_device = next(
|
||||
(res for res in IMPORT_RESULT.values() if res.device_name == name), None
|
||||
)
|
||||
|
||||
if imported_device is not None:
|
||||
network = imported_device.network
|
||||
else:
|
||||
network = const.CONF_WIFI
|
||||
|
||||
import_config(
|
||||
settings.rel_path(f"{name}.yaml"),
|
||||
name,
|
||||
args["project_name"],
|
||||
args["package_import_url"],
|
||||
network,
|
||||
)
|
||||
except FileExistsError:
|
||||
self.set_status(500)
|
||||
|
||||
Reference in New Issue
Block a user