mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Don't use None inside header (#11725)
This commit is contained in:
parent
020593d509
commit
4ee2c311a7
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user