mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 22:10:09 +00:00
Use constants for HTTP headers (#10313)
* Use constants for HTTP headers * Fix ordering * Move 'no-cache' to platform
This commit is contained in:
committed by
Paulus Schoutsen
parent
e64803e701
commit
de9d19d6f4
@@ -7,11 +7,12 @@ https://home-assistant.io/components/splunk/
|
||||
import json
|
||||
import logging
|
||||
|
||||
from aiohttp.hdrs import AUTHORIZATION
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
CONF_NAME, CONF_HOST, CONF_PORT, CONF_SSL, CONF_TOKEN, EVENT_STATE_CHANGED)
|
||||
CONF_SSL, CONF_HOST, CONF_NAME, CONF_PORT, CONF_TOKEN, EVENT_STATE_CHANGED)
|
||||
from homeassistant.helpers import state as state_helper
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.remote import JSONEncoder
|
||||
@@ -52,7 +53,7 @@ def setup(hass, config):
|
||||
|
||||
event_collector = '{}{}:{}/services/collector/event'.format(
|
||||
uri_scheme, host, port)
|
||||
headers = {'Authorization': 'Splunk {}'.format(token)}
|
||||
headers = {AUTHORIZATION: 'Splunk {}'.format(token)}
|
||||
|
||||
def splunk_event_listener(event):
|
||||
"""Listen for new messages on the bus and sends them to Splunk."""
|
||||
|
||||
Reference in New Issue
Block a user