mirror of
https://github.com/esphome/esphome.git
synced 2025-02-15 09:28:16 +00:00
use asyncio since as of tornado 6.0 the loop is just a wrapper around it anyways
This commit is contained in:
parent
cad53556a5
commit
f818b19d38
@ -1,5 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import base64
|
import base64
|
||||||
import binascii
|
import binascii
|
||||||
import codecs
|
import codecs
|
||||||
@ -510,7 +511,7 @@ class EsphomeUpdateAllHandler(EsphomeCommandWebSocket):
|
|||||||
class SerialPortRequestHandler(BaseHandler):
|
class SerialPortRequestHandler(BaseHandler):
|
||||||
@authenticated
|
@authenticated
|
||||||
async def get(self):
|
async def get(self):
|
||||||
ports = await tornado.ioloop.IOLoop.run_in_executor(None, 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user