Don't use None inside header (#11725)

This commit is contained in:
Pascal Vizeli 2018-01-17 15:20:26 +01:00 committed by GitHub
parent 020593d509
commit 4ee2c311a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,7 +330,7 @@ class HassIO(object):
request = yield from self.websession.request(
method, "http://{}{}".format(self._ip, command),
json=payload, headers={
X_HASSIO: os.environ.get('HASSIO_TOKEN')
X_HASSIO: os.environ.get('HASSIO_TOKEN', "")
})
if request.status not in (200, 400):
@ -359,7 +359,7 @@ class HassIO(object):
try:
data = None
headers = {X_HASSIO: os.environ.get('HASSIO_TOKEN')}
headers = {X_HASSIO: os.environ.get('HASSIO_TOKEN', "")}
with async_timeout.timeout(10, loop=self.loop):
data = yield from request.read()
if data: