mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
dashboard: Run get_serial_ports in the executor (#5740)
This commit is contained in:
parent
08fc96b890
commit
f198be39d7
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import base64
|
||||
import binascii
|
||||
import collections
|
||||
|
@ -508,8 +509,8 @@ class EsphomeUpdateAllHandler(EsphomeCommandWebSocket):
|
|||
|
||||
class SerialPortRequestHandler(BaseHandler):
|
||||
@authenticated
|
||||
def get(self):
|
||||
ports = get_serial_ports()
|
||||
async def get(self):
|
||||
ports = await asyncio.get_running_loop().run_in_executor(None, get_serial_ports)
|
||||
data = []
|
||||
for port in ports:
|
||||
desc = port.description
|
||||
|
|
Loading…
Reference in a new issue