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

View File

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