Auth and headers support for REST sensor (#3592)

* Add auth and header support

* Update header part
This commit is contained in:
Fabian Affolter authored and Paulus Schoutsen committed 2016-10-04 01:07:17 -07:00
1 parent 74b0e4cb45
commit a072047d9d
4 files changed
+56 -12

No files matched your search

+3 -1
View File
@@ -43,6 +43,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
host = config.get(CONF_HOST)
method = 'GET'
payload = None
auth = None
headers = None
verify_ssl = config.get(CONF_VERIFY_SSL)
use_ssl = config.get(CONF_SSL)
@@ -53,7 +55,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
resource = "{}{}{}".format(uri_scheme, host, _ENDPOINT)
rest = RestData(method, resource, payload, verify_ssl)
rest = RestData(method, resource, auth, headers, payload, verify_ssl)
rest.update()
if rest.data is None: