Add some tests for splunk

This also fixes issue #1214, and I think another bug. The splunk
code will just take the value of state.state and try to serialize
it to json if it can't make it into a number. It did this before
I generalized that code. Since json.dumps() will fail on most anything
complicated, I think the right thing to do is *not* try to do that.
This commit is contained in:
Dan Smith committed 2016-02-12 01:45:30 +00:00
1 parent 76df759f4c
commit 0a904acd4d
2 files changed
+95 -2

No files matched your search

+2 -2
View File
@@ -50,7 +50,7 @@ def setup(hass, config):
uri_scheme = "https://"
else:
uri_scheme = "http://"
event_collector = uri_scheme + host + ":" + port + \
event_collector = uri_scheme + host + ":" + str(port) + \
"/services/collector/event"
headers = {'Authorization': 'Splunk ' + token}
@@ -65,7 +65,7 @@ def setup(hass, config):
try:
_state = state_helper.state_as_number(state)
except ValueError:
_state = state.state
return
json_body = [
{