Skip to content

Commit

Permalink
Replace HA HTTP_OK by HTTPStatus.OK
Browse files Browse the repository at this point in the history
The HA project has removed this constant in HA 2021.12.0.

I've tested it and seems to be working.
  • Loading branch information
McGiverGim authored Dec 12, 2021
1 parent 5301b5c commit fade0a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/jq300/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json
import logging
from datetime import timedelta
from http import HTTPStatus
from time import monotonic
from typing import Any, Dict, List, Optional, Union
from urllib.parse import urlparse
Expand All @@ -26,7 +27,6 @@
CONCENTRATION_PARTS_PER_BILLION,
CONCENTRATION_PARTS_PER_MILLION,
CONF_UNIT_OF_MEASUREMENT,
HTTP_OK,
)
from homeassistant.core import HomeAssistant
from homeassistant.util import Throttle
Expand Down Expand Up @@ -214,7 +214,7 @@ async def _async_query(
return None

if (
response.status != HTTP_OK and response.status != HTTP_NO_CONTENT
response.status != HTTPStatus.OK and response.status != HTTP_NO_CONTENT
): # pragma: no cover
_LOGGER.debug(MSG_GENERIC_FAIL)
return None
Expand Down

0 comments on commit fade0a5

Please sign in to comment.