diff --git a/homeassistant/components/influxdb.py b/homeassistant/components/influxdb.py index 5569a3006529bf305ade0d24f6db4296fe9936ac..2286dd2d659e7ce33a80aa0a5e0623d7280ff529 100644 --- a/homeassistant/components/influxdb.py +++ b/homeassistant/components/influxdb.py @@ -17,7 +17,7 @@ from homeassistant.components.sun import (STATE_ABOVE_HORIZON, _LOGGER = logging.getLogger(__name__) -DOMAIN = "influx" +DOMAIN = "influxdb" DEPENDENCIES = [] DEFAULT_HOST = 'localhost' @@ -45,21 +45,21 @@ def setup(hass, config): host = conf[CONF_HOST] port = util.convert(conf.get(CONF_PORT), int, DEFAULT_PORT) - dbname = util.convert(conf.get(CONF_DB_NAME), str, DEFAULT_DATABASE) + database = util.convert(conf.get(CONF_DB_NAME), str, DEFAULT_DATABASE) username = util.convert(conf.get(CONF_USERNAME), str) password = util.convert(conf.get(CONF_PASSWORD), str) try: influx = InfluxDBClient(host=host, port=port, username=username, - password=password, database=dbname) + password=password, database=database) databases = [i['name'] for i in influx.get_list_database()] except exceptions.InfluxDBClientError: _LOGGER.error("Database host is not accessible. " "Please check your entries in the configuration file.") return False - if dbname not in databases: - _LOGGER.error("Database %s doesn't exist", dbname) + if database not in databases: + _LOGGER.error("Database %s doesn't exist", database) return False def influx_event_listener(event): @@ -97,7 +97,7 @@ def setup(hass, config): try: influx.write_points(json_body) except exceptions.InfluxDBClientError: - _LOGGER.exception('Error saving event to Influx') + _LOGGER.exception('Error saving event to InfluxDB') hass.bus.listen(EVENT_STATE_CHANGED, influx_event_listener)