mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 18:57:57 +00:00
Added whitelist option to InfluxDB to select the only entities that will be logged on InfluxDB (#2727)
This commit is contained in:
parent
792154a6a7
commit
ef3e7b28a9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user