Upgrade sqlalchemy to 1.2.1 (#11666)

This commit is contained in:
Fabian Affolter 2018-01-15 23:24:34 +01:00 committed by Paulus Schoutsen
parent b0860ce5f0
commit d219f244d2
3 changed files with 21 additions and 23 deletions

View File

@ -8,33 +8,33 @@ For more details about this component, please refer to the documentation at
https://home-assistant.io/components/recorder/ https://home-assistant.io/components/recorder/
""" """
import asyncio import asyncio
from collections import namedtuple
import concurrent.futures import concurrent.futures
from datetime import datetime, timedelta
import logging import logging
import queue import queue
import threading import threading
import time import time
from collections import namedtuple
from datetime import datetime, timedelta from typing import Dict, Optional
from typing import Optional, Dict
import voluptuous as vol import voluptuous as vol
from homeassistant.core import (
HomeAssistant, callback, CoreState)
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, CONF_ENTITIES, CONF_EXCLUDE, CONF_DOMAINS, ATTR_ENTITY_ID, CONF_DOMAINS, CONF_ENTITIES, CONF_EXCLUDE, CONF_INCLUDE,
CONF_INCLUDE, EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, EVENT_STATE_CHANGED,
EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL) EVENT_TIME_CHANGED, MATCH_ALL)
from homeassistant.core import CoreState, HomeAssistant, callback
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entityfilter import generate_filter from homeassistant.helpers.entityfilter import generate_filter
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from . import purge, migration from . import migration, purge
from .const import DATA_INSTANCE from .const import DATA_INSTANCE
from .util import session_scope from .util import session_scope
REQUIREMENTS = ['sqlalchemy==1.2.0'] REQUIREMENTS = ['sqlalchemy==1.2.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -140,9 +140,9 @@ def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Handle calls to the purge service.""" """Handle calls to the purge service."""
instance.do_adhoc_purge(service.data[ATTR_KEEP_DAYS]) instance.do_adhoc_purge(service.data[ATTR_KEEP_DAYS])
hass.services.async_register(DOMAIN, SERVICE_PURGE, hass.services.async_register(
async_handle_purge_service, DOMAIN, SERVICE_PURGE, async_handle_purge_service,
schema=SERVICE_PURGE_SCHEMA) schema=SERVICE_PURGE_SCHEMA)
return (yield from instance.async_db_ready) return (yield from instance.async_db_ready)
@ -169,10 +169,9 @@ class Recorder(threading.Thread):
self.engine = None # type: Any self.engine = None # type: Any
self.run_info = None # type: Any self.run_info = None # type: Any
self.entity_filter = generate_filter(include.get(CONF_DOMAINS, []), self.entity_filter = generate_filter(
include.get(CONF_ENTITIES, []), include.get(CONF_DOMAINS, []), include.get(CONF_ENTITIES, []),
exclude.get(CONF_DOMAINS, []), exclude.get(CONF_DOMAINS, []), exclude.get(CONF_ENTITIES, []))
exclude.get(CONF_ENTITIES, []))
self.exclude_t = exclude.get(CONF_EVENT_TYPES, []) self.exclude_t = exclude.get(CONF_EVENT_TYPES, [])
self.get_session = None self.get_session = None
@ -238,8 +237,7 @@ class Recorder(threading.Thread):
self.queue.put(None) self.queue.put(None)
self.join() self.join()
self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shutdown)
shutdown)
if self.hass.state == CoreState.running: if self.hass.state == CoreState.running:
hass_started.set_result(None) hass_started.set_result(None)
@ -249,8 +247,8 @@ class Recorder(threading.Thread):
"""Notify that hass has started.""" """Notify that hass has started."""
hass_started.set_result(None) hass_started.set_result(None)
self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, self.hass.bus.async_listen_once(
notify_hass_started) EVENT_HOMEASSISTANT_START, notify_hass_started)
if self.keep_days and self.purge_interval: if self.keep_days and self.purge_interval:
@callback @callback

View File

@ -1098,7 +1098,7 @@ speedtest-cli==1.0.7
# homeassistant.components.recorder # homeassistant.components.recorder
# homeassistant.scripts.db_migrator # homeassistant.scripts.db_migrator
sqlalchemy==1.2.0 sqlalchemy==1.2.1
# homeassistant.components.statsd # homeassistant.components.statsd
statsd==3.2.1 statsd==3.2.1

View File

@ -165,7 +165,7 @@ somecomfort==0.5.0
# homeassistant.components.recorder # homeassistant.components.recorder
# homeassistant.scripts.db_migrator # homeassistant.scripts.db_migrator
sqlalchemy==1.2.0 sqlalchemy==1.2.1
# homeassistant.components.statsd # homeassistant.components.statsd
statsd==3.2.1 statsd==3.2.1