Add custom header support for rest_command (#12646)
* Add support for specifying custom headers for rest_command. * Added headers configuration to behave similarly to the rest sensor. * Replaced test_rest_command_content_type which only validated the configuration with test_rest_command_headers which tests several combinations of parameters that affect the request headers.
This commit is contained in:
1 parent
f5c633415d
commit
f6c504610b
3 files changed
+82
-15
No files matched your search
@@ -35,7 +35,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_RESOURCE): cv.url,
|
||||
vol.Optional(CONF_AUTHENTICATION):
|
||||
vol.In([HTTP_BASIC_AUTHENTICATION, HTTP_DIGEST_AUTHENTICATION]),
|
||||
vol.Optional(CONF_HEADERS): {cv.string: cv.string},
|
||||
vol.Optional(CONF_HEADERS): vol.Schema({cv.string: cv.string}),
|
||||
vol.Optional(CONF_JSON_ATTRS, default=[]): cv.ensure_list_csv,
|
||||
vol.Optional(CONF_METHOD, default=DEFAULT_METHOD): vol.In(METHODS),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
|
||||
Reference in new issue
Block a user