Add "headers" config parameter to rest switch (#12706)

* Add "headers" config parameter to rest switch

* Minor fix: line length
This commit is contained in:
Maximilian Früh authored and Paulus Schoutsen committed 2018-02-28 14:00:51 -08:00
1 parent c1aaef28a9
commit 001515bdc4
2 files changed
+15 -9

No files matched your search

+4 -2
View File
@@ -82,6 +82,7 @@ class TestRestSwitchSetup:
'platform': 'rest',
'name': 'foo',
'resource': 'http://localhost',
'headers': {'Content-type': 'application/json'},
'body_on': 'custom on text',
'body_off': 'custom off text',
}
@@ -99,12 +100,13 @@ class TestRestSwitch:
self.name = 'foo'
self.method = 'post'
self.resource = 'http://localhost/'
self.headers = {'Content-type': 'application/json'}
self.auth = None
self.body_on = Template('on', self.hass)
self.body_off = Template('off', self.hass)
self.switch = rest.RestSwitch(
self.name, self.resource, self.method, self.auth, self.body_on,
self.body_off, None, 10)
self.name, self.resource, self.method, self.headers, self.auth,
self.body_on, self.body_off, None, 10)
self.switch.hass = self.hass
def teardown_method(self):