Fix implicit-return in foursquare (#122843)

pull/122811/head
epenet 2024-07-30 15:23:04 +02:00 committed by GitHub
parent e7971f5a67
commit fd7c92879c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@
from http import HTTPStatus
import logging
from aiohttp import web
import requests
import voluptuous as vol
@ -85,11 +86,11 @@ class FoursquarePushReceiver(HomeAssistantView):
url = "/api/foursquare"
name = "foursquare"
def __init__(self, push_secret):
def __init__(self, push_secret: str) -> None:
"""Initialize the OAuth callback view."""
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."""
try:
data = await request.json()
@ -107,3 +108,4 @@ class FoursquarePushReceiver(HomeAssistantView):
return self.json_message("Incorrect secret", HTTPStatus.BAD_REQUEST)
request.app[KEY_HASS].bus.async_fire(EVENT_PUSH, data)
return None