Use uvloop for asyncio policy (#3417)

This commit is contained in:
Lewis Juggins 2016-09-20 08:06:33 +01:00 committed by Paulus Schoutsen
parent 43c395232a
commit 54248863b3
2 changed files with 7 additions and 1 deletions

View file

@ -21,7 +21,7 @@ RUN script/build_python_openzwave && \
COPY requirements_all.txt requirements_all.txt
# certifi breaks Debian based installs
RUN pip3 install --no-cache-dir -r requirements_all.txt && pip3 uninstall -y certifi && \
pip3 install mysqlclient psycopg2
pip3 install mysqlclient psycopg2 uvloop
# Copy source
COPY . .

View file

@ -40,6 +40,12 @@ import homeassistant.util.dt as dt_util
import homeassistant.util.location as location
from homeassistant.util.unit_system import UnitSystem, METRIC_SYSTEM # NOQA
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except ImportError:
pass
DOMAIN = "homeassistant"
# How often time_changed event should fire