Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from vlebourl/Fix-http-const
Browse files Browse the repository at this point in the history
Fix http const
  • Loading branch information
vlebourl authored Dec 4, 2021
2 parents 6a50036 + 67d662c commit 36351ee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions custom_components/shopping_list/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""Support to manage a shopping list."""
from http import HTTPStatus
import logging

from homeassistant import config_entries
from homeassistant.components import http, websocket_api
from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.const import (
CONF_PASSWORD,
CONF_USERNAME,
HTTP_BAD_REQUEST,
HTTP_NOT_FOUND,
CONF_USERNAME
)
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
Expand Down Expand Up @@ -450,9 +449,9 @@ async def post(self, request, item_id):
request.app["hass"].bus.async_fire(EVENT)
return self.json(item)
except KeyError:
return self.json_message("Item not found", HTTP_NOT_FOUND)
return self.json_message("Item not found", HTTPStatus.NOT_FOUND)
except vol.Invalid:
return self.json_message("Item not found", HTTP_BAD_REQUEST)
return self.json_message("Item not found", HTTPStatus.BAD_REQUEST)


class CreateShoppingListItemView(http.HomeAssistantView):
Expand Down

0 comments on commit 36351ee

Please sign in to comment.