Fix more deprecation warnings (#7778)

* Remove setting up an hbmqtt broker

* Don't pass loop to web.Application in tests

* Use .query instead of deprecated .GET for aiohttp requests

* Fix closing file resource

* Do not use asyncio mark

* Notify.html5 - PyJWT: Use options to disable verify

* Yamaha: Test was still using deprecated ip

* Remove pytest-asyncio
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-05-26 13:12:17 -07:00
1 parent 910020bc5f
commit e68bd0457c
20 files changed
+22 -26

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ class APIEventStream(HomeAssistantView):
stop_obj = object()
to_write = asyncio.Queue(loop=hass.loop)
restrict = request.GET.get('restrict')
restrict = request.query.get('restrict')
if restrict:
restrict = restrict.split(',') + [EVENT_HOMEASSISTANT_STOP]
@@ -38,7 +38,7 @@ class MyStromView(HomeAssistantView):
@asyncio.coroutine
def get(self, request):
"""The GET request received from a myStrom button."""
res = yield from self._handle(request.app['hass'], request.GET)
res = yield from self._handle(request.app['hass'], request.query)
return res
@asyncio.coroutine
+1 -1
View File
@@ -241,7 +241,7 @@ class CameraView(HomeAssistantView):
return web.Response(status=status)
authenticated = (request[KEY_AUTHENTICATED] or
request.GET.get('token') in camera.access_tokens)
request.query.get('token') in camera.access_tokens)
if not authenticated:
return web.Response(status=401)
@@ -39,7 +39,7 @@ class GPSLoggerView(HomeAssistantView):
@asyncio.coroutine
def get(self, request):
"""Handle for GPSLogger message received as GET."""
res = yield from self._handle(request.app['hass'], request.GET)
res = yield from self._handle(request.app['hass'], request.query)
return res
@asyncio.coroutine
@@ -41,7 +41,7 @@ class LocativeView(HomeAssistantView):
@asyncio.coroutine
def get(self, request):
"""Locative message received as GET."""
res = yield from self._handle(request.app['hass'], request.GET)
res = yield from self._handle(request.app['hass'], request.query)
return res
@asyncio.coroutine
+2 -2
View File
@@ -223,7 +223,7 @@ class HistoryPeriodView(HomeAssistantView):
if start_time > now:
return self.json([])
end_time = request.GET.get('end_time')
end_time = request.query.get('end_time')
if end_time:
end_time = dt_util.as_utc(
dt_util.parse_datetime(end_time))
@@ -231,7 +231,7 @@ class HistoryPeriodView(HomeAssistantView):
return self.json_message('Invalid end_time', HTTP_BAD_REQUEST)
else:
end_time = start_time + one_day
entity_id = request.GET.get('filter_entity_id')
entity_id = request.query.get('filter_entity_id')
result = yield from request.app['hass'].async_add_job(
get_significant_states, request.app['hass'], start_time, end_time,
+2 -2
View File
@@ -37,8 +37,8 @@ def auth_middleware(app, handler):
# A valid auth header has been set
authenticated = True
elif (DATA_API_PASSWORD in request.GET and
validate_password(request, request.GET[DATA_API_PASSWORD])):
elif (DATA_API_PASSWORD in request.query and
validate_password(request, request.query[DATA_API_PASSWORD])):
authenticated = True
elif is_trusted_ip(request):
@@ -947,7 +947,7 @@ class MediaPlayerImageView(HomeAssistantView):
return web.Response(status=status)
authenticated = (request[KEY_AUTHENTICATED] or
request.GET.get('token') == player.access_token)
request.query.get('token') == player.access_token)
if not authenticated:
return web.Response(status=401)
@@ -110,7 +110,7 @@ class SpotifyAuthCallbackView(HomeAssistantView):
def get(self, request):
"""Receive authorization token."""
hass = request.app['hass']
self.oauth.get_access_token(request.GET['code'])
self.oauth.get_access_token(request.query['code'])
hass.async_add_job(setup_platform, hass, self.config, self.add_devices)
+1 -1
View File
@@ -246,7 +246,7 @@ class HTML5PushCallbackView(HomeAssistantView):
# 2a. If decode is successful, return the payload.
# 2b. If decode is unsuccessful, return a 401.
target_check = jwt.decode(token, verify=False)
target_check = jwt.decode(token, options={'verify_signature': False})
if target_check[ATTR_TARGET] in self.registrations:
possible_target = self.registrations[target_check[ATTR_TARGET]]
key = possible_target[ATTR_SUBSCRIPTION][ATTR_KEYS][ATTR_AUTH]
+1 -1
View File
@@ -299,7 +299,7 @@ class FitbitAuthCallbackView(HomeAssistantView):
from oauthlib.oauth2.rfc6749.errors import MissingTokenError
hass = request.app['hass']
data = request.GET
data = request.query
response_message = """Fitbit has been successfully authorized!
You can close this window now!"""
+1 -1
View File
@@ -75,7 +75,7 @@ class TorqueReceiveDataView(HomeAssistantView):
def get(self, request):
"""Handle Torque data request."""
hass = request.app['hass']
data = request.GET
data = request.query
if self.email is not None and self.email != data[SENSOR_EMAIL_FIELD]:
return
+1 -1
View File
@@ -95,7 +95,7 @@ class NetioApiView(HomeAssistantView):
def get(self, request, host):
"""Request handler."""
hass = request.app['hass']
data = request.GET
data = request.query
states, consumptions, cumulated_consumptions, start_dates = \
[], [], [], []