Upgrade sqlalchemy to 1.2.7 (#14138)
parent
7bdd4dd960
commit
95f2ad2299
|
@ -35,7 +35,7 @@ from . import migration, purge
|
|||
from .const import DATA_INSTANCE
|
||||
from .util import session_scope
|
||||
|
||||
REQUIREMENTS = ['sqlalchemy==1.2.6']
|
||||
REQUIREMENTS = ['sqlalchemy==1.2.7']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ from homeassistant.helpers.entity import Entity
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
REQUIREMENTS = ['sqlalchemy==1.2.6']
|
||||
REQUIREMENTS = ['sqlalchemy==1.2.7']
|
||||
|
||||
CONF_COLUMN_NAME = 'column'
|
||||
CONF_QUERIES = 'queries'
|
||||
CONF_QUERY = 'query'
|
||||
CONF_COLUMN_NAME = 'column'
|
||||
|
||||
|
||||
def validate_sql_select(value):
|
||||
|
@ -34,9 +34,9 @@ def validate_sql_select(value):
|
|||
|
||||
|
||||
_QUERY_SCHEME = vol.Schema({
|
||||
vol.Required(CONF_COLUMN_NAME): cv.string,
|
||||
vol.Required(CONF_NAME): cv.string,
|
||||
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_VALUE_TEMPLATE): cv.template,
|
||||
})
|
||||
|
@ -48,7 +48,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
|
||||
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)
|
||||
if not db_url:
|
||||
db_url = DEFAULT_URL.format(
|
||||
|
@ -90,10 +90,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
|
||||
|
||||
class SQLSensor(Entity):
|
||||
"""An SQL sensor."""
|
||||
"""Representation of an SQL sensor."""
|
||||
|
||||
def __init__(self, name, sessmaker, query, column, unit, value_template):
|
||||
"""Initialize SQL sensor."""
|
||||
"""Initialize the SQL sensor."""
|
||||
self._name = name
|
||||
if "LIMIT" in query:
|
||||
self._query = query
|
||||
|
|
|
@ -1218,7 +1218,7 @@ spotcrime==1.0.3
|
|||
# homeassistant.components.recorder
|
||||
# homeassistant.scripts.db_migrator
|
||||
# homeassistant.components.sensor.sql
|
||||
sqlalchemy==1.2.6
|
||||
sqlalchemy==1.2.7
|
||||
|
||||
# homeassistant.components.statsd
|
||||
statsd==3.2.1
|
||||
|
|
|
@ -188,7 +188,7 @@ somecomfort==0.5.2
|
|||
# homeassistant.components.recorder
|
||||
# homeassistant.scripts.db_migrator
|
||||
# homeassistant.components.sensor.sql
|
||||
sqlalchemy==1.2.6
|
||||
sqlalchemy==1.2.7
|
||||
|
||||
# homeassistant.components.statsd
|
||||
statsd==3.2.1
|
||||
|
|
Loading…
Reference in New Issue