From ef3e7b28a90e2e2059ece00c05cb15ec7545b1c2 Mon Sep 17 00:00:00 2001
From: mmello <tchello.mello@gmail.com>
Date: Thu, 4 Aug 2016 11:35:01 -0400
Subject: [PATCH]  Added whitelist option to InfluxDB to select the only
 entities that will be logged on InfluxDB (#2727)

---
 homeassistant/components/influxdb.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/homeassistant/components/influxdb.py b/homeassistant/components/influxdb.py
index 2070a52085d..ca2ba5d2bfb 100644
--- a/homeassistant/components/influxdb.py
+++ b/homeassistant/components/influxdb.py
@@ -33,6 +33,7 @@ CONF_PASSWORD = 'password'
 CONF_SSL = 'ssl'
 CONF_VERIFY_SSL = 'verify_ssl'
 CONF_BLACKLIST = 'blacklist'
+CONF_WHITELIST = 'whitelist'
 CONF_TAGS = 'tags'
 
 
@@ -57,6 +58,7 @@ def setup(hass, config):
     verify_ssl = util.convert(conf.get(CONF_VERIFY_SSL), bool,
                               DEFAULT_VERIFY_SSL)
     blacklist = conf.get(CONF_BLACKLIST, [])
+    whitelist = conf.get(CONF_WHITELIST, [])
     tags = conf.get(CONF_TAGS, {})
 
     try:
@@ -79,6 +81,9 @@ def setup(hass, config):
             return
 
         try:
+            if len(whitelist) > 0 and state.entity_id not in whitelist:
+                return
+
             _state = state_helper.state_as_number(state)
         except ValueError:
             _state = state.state