mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-30 01:38:27 +02:00
dashboard: Run get_serial_ports in the executor (#5740)
This commit is contained in:
committed by
Jesse Hills
parent
bd568eecf5
commit
2ee089c9d5
@@ -1,5 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
import binascii
|
import binascii
|
||||||
import collections
|
import collections
|
||||||
@@ -508,8 +509,8 @@ class EsphomeUpdateAllHandler(EsphomeCommandWebSocket):
|
|||||||
|
|
||||||
class SerialPortRequestHandler(BaseHandler):
|
class SerialPortRequestHandler(BaseHandler):
|
||||||
@authenticated
|
@authenticated
|
||||||
def get(self):
|
async def get(self):
|
||||||
ports = get_serial_ports()
|
ports = await asyncio.get_running_loop().run_in_executor(None, get_serial_ports)
|
||||||
data = []
|
data = []
|
||||||
for port in ports:
|
for port in ports:
|
||||||
desc = port.description
|
desc = port.description
|
||||||
|
|||||||
Reference in New Issue
Block a user