Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopts removal of hass.const.HTTP_* #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions custom_components/ha_strava/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from aiohttp import ClientSession
from aiohttp.web import json_response, Response, Request
from datetime import datetime as dt
from http import HTTPStatus

# HASS imports
from homeassistant import data_entry_flow
Expand All @@ -20,7 +21,6 @@
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
HTTP_OK,
CONF_WEBHOOK_ID,
EVENT_COMPONENT_LOADED,
EVENT_CORE_CONFIG_UPDATE,
Expand Down Expand Up @@ -365,10 +365,10 @@ async def get(self, request):
webhook_subscription_challenge = request.query.get("hub.challenge", None)
if webhook_subscription_challenge:
return json_response(
status=HTTP_OK, data={"hub.challenge": webhook_subscription_challenge}
status=HTTPStatus.OK, data={"hub.challenge": webhook_subscription_challenge}
)

return Response(status=HTTP_OK)
return Response(status=HTTPStatus.OK)

async def post(self, request: Request):
"""Handle incoming post request"""
Expand All @@ -388,7 +388,7 @@ async def post(self, request: Request):
self.hass.async_create_task(self.fetch_strava_data())

# always return a 200 response
return Response(status=HTTP_OK)
return Response(status=HTTPStatus.OK)


async def renew_webhook_subscription(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ha_strava/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# HASS imports
from homeassistant import config_entries
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, HTTP_OK
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.core import callback
from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv
from homeassistant.helpers.network import get_url, NoURLAvailableError
Expand Down