From a2503e4d13a05e7646211ec5fef2aca0f3b5023c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 11 Oct 2016 08:29:43 +0200 Subject: [PATCH] Upgrade sqlalchemy to 1.1.1 (#3796) --- homeassistant/components/recorder/__init__.py | 21 +++++++++---------- requirements_all.txt | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index 7f836a1363d..d1983e8f28f 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -26,15 +26,15 @@ from homeassistant.helpers.event import track_point_in_utc_time from homeassistant.helpers.typing import ConfigType, QueryType import homeassistant.util.dt as dt_util -DOMAIN = "recorder" +DOMAIN = 'recorder' -REQUIREMENTS = ['sqlalchemy==1.0.15'] +REQUIREMENTS = ['sqlalchemy==1.1.1'] -DEFAULT_URL = "sqlite:///{hass_config_path}" -DEFAULT_DB_FILE = "home-assistant_v2.db" +DEFAULT_URL = 'sqlite:///{hass_config_path}' +DEFAULT_DB_FILE = 'home-assistant_v2.db' -CONF_DB_URL = "db_url" -CONF_PURGE_DAYS = "purge_days" +CONF_DB_URL = 'db_url' +CONF_PURGE_DAYS = 'purge_days' RETRIES = 3 CONNECT_RETRY_WAIT = 10 @@ -56,8 +56,8 @@ _LOGGER = logging.getLogger(__name__) Session = None # pylint: disable=no-member -def execute(q: QueryType) \ - -> List[Any]: # pylint: disable=invalid-sequence-index +# pylint: disable=invalid-sequence-index +def execute(q: QueryType) -> List[Any]: """Query the database and convert the objects to HA native form. This method also retries a few times in the case of stale connections. @@ -101,7 +101,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool: global _INSTANCE # pylint: disable=global-statement if _INSTANCE is not None: - _LOGGER.error('Only a single instance allowed.') + _LOGGER.error("Only a single instance allowed") return False purge_days = config.get(DOMAIN, {}).get(CONF_PURGE_DAYS) @@ -155,8 +155,7 @@ class Recorder(threading.Thread): """A threaded recorder class.""" # pylint: disable=too-many-instance-attributes - def __init__(self, hass: HomeAssistant, purge_days: int, uri: str) \ - -> None: + def __init__(self, hass: HomeAssistant, purge_days: int, uri: str) -> None: """Initialize the recorder.""" threading.Thread.__init__(self) diff --git a/requirements_all.txt b/requirements_all.txt index ac73fd89855..964138e9de9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -458,7 +458,7 @@ speedtest-cli==0.3.4 # homeassistant.components.recorder # homeassistant.scripts.db_migrator -sqlalchemy==1.0.15 +sqlalchemy==1.1.1 # homeassistant.components.emulated_hue # homeassistant.components.http