Fix implicit-return in foursquare (#122843)
parent
e7971f5a67
commit
fd7c92879c
|
@ -3,6 +3,7 @@
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from aiohttp import web
|
||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -85,11 +86,11 @@ class FoursquarePushReceiver(HomeAssistantView):
|
||||||
url = "/api/foursquare"
|
url = "/api/foursquare"
|
||||||
name = "foursquare"
|
name = "foursquare"
|
||||||
|
|
||||||
def __init__(self, push_secret):
|
def __init__(self, push_secret: str) -> None:
|
||||||
"""Initialize the OAuth callback view."""
|
"""Initialize the OAuth callback view."""
|
||||||
self.push_secret = push_secret
|
self.push_secret = push_secret
|
||||||
|
|
||||||
async def post(self, request):
|
async def post(self, request: web.Request) -> web.Response | None:
|
||||||
"""Accept the POST from Foursquare."""
|
"""Accept the POST from Foursquare."""
|
||||||
try:
|
try:
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
|
@ -107,3 +108,4 @@ class FoursquarePushReceiver(HomeAssistantView):
|
||||||
return self.json_message("Incorrect secret", HTTPStatus.BAD_REQUEST)
|
return self.json_message("Incorrect secret", HTTPStatus.BAD_REQUEST)
|
||||||
|
|
||||||
request.app[KEY_HASS].bus.async_fire(EVENT_PUSH, data)
|
request.app[KEY_HASS].bus.async_fire(EVENT_PUSH, data)
|
||||||
|
return None
|
||||||
|
|
Loading…
Reference in New Issue