Upgrade sqlalchemy to 1.2.7 (#14138)

pull/14157/head
Fabian Affolter 2018-04-28 23:16:01 +02:00 committed by GitHub
parent 7bdd4dd960
commit 95f2ad2299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -35,7 +35,7 @@ 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.6'] REQUIREMENTS = ['sqlalchemy==1.2.7']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -19,11 +19,11 @@ from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['sqlalchemy==1.2.6'] REQUIREMENTS = ['sqlalchemy==1.2.7']
CONF_COLUMN_NAME = 'column'
CONF_QUERIES = 'queries' CONF_QUERIES = 'queries'
CONF_QUERY = 'query' CONF_QUERY = 'query'
CONF_COLUMN_NAME = 'column'
def validate_sql_select(value): def validate_sql_select(value):
@ -34,9 +34,9 @@ def validate_sql_select(value):
_QUERY_SCHEME = vol.Schema({ _QUERY_SCHEME = vol.Schema({
vol.Required(CONF_COLUMN_NAME): cv.string,
vol.Required(CONF_NAME): cv.string, vol.Required(CONF_NAME): cv.string,
vol.Required(CONF_QUERY): vol.All(cv.string, validate_sql_select), vol.Required(CONF_QUERY): vol.All(cv.string, validate_sql_select),
vol.Required(CONF_COLUMN_NAME): cv.string,
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string, vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template, vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
}) })
@ -48,7 +48,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the sensor platform.""" """Set up the SQL sensor platform."""
db_url = config.get(CONF_DB_URL, None) db_url = config.get(CONF_DB_URL, None)
if not db_url: if not db_url:
db_url = DEFAULT_URL.format( db_url = DEFAULT_URL.format(
@ -90,10 +90,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class SQLSensor(Entity): class SQLSensor(Entity):
"""An SQL sensor.""" """Representation of an SQL sensor."""
def __init__(self, name, sessmaker, query, column, unit, value_template): def __init__(self, name, sessmaker, query, column, unit, value_template):
"""Initialize SQL sensor.""" """Initialize the SQL sensor."""
self._name = name self._name = name
if "LIMIT" in query: if "LIMIT" in query:
self._query = query self._query = query

View File

@ -1218,7 +1218,7 @@ spotcrime==1.0.3
# homeassistant.components.recorder # homeassistant.components.recorder
# homeassistant.scripts.db_migrator # homeassistant.scripts.db_migrator
# homeassistant.components.sensor.sql # homeassistant.components.sensor.sql
sqlalchemy==1.2.6 sqlalchemy==1.2.7
# homeassistant.components.statsd # homeassistant.components.statsd
statsd==3.2.1 statsd==3.2.1

View File

@ -188,7 +188,7 @@ somecomfort==0.5.2
# homeassistant.components.recorder # homeassistant.components.recorder
# homeassistant.scripts.db_migrator # homeassistant.scripts.db_migrator
# homeassistant.components.sensor.sql # homeassistant.components.sensor.sql
sqlalchemy==1.2.6 sqlalchemy==1.2.7
# homeassistant.components.statsd # homeassistant.components.statsd
statsd==3.2.1 statsd==3.2.1