mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Use HTTP_OK constant (#33798)
* Use http ok constant * Remove incorrect use * Run isort * Fix pylint by adding missing imports * Fix pylint by fixing one import
This commit is contained in:
@@ -20,6 +20,7 @@ from homeassistant.const import (
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_PRESSURE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
HTTP_OK,
|
||||
PRESSURE_HPA,
|
||||
SPEED_METERS_PER_SECOND,
|
||||
TEMP_CELSIUS,
|
||||
@@ -185,7 +186,7 @@ class YrData:
|
||||
websession = async_get_clientsession(self.hass)
|
||||
with async_timeout.timeout(10):
|
||||
resp = await websession.get(self._url, params=self._urlparams)
|
||||
if resp.status != 200:
|
||||
if resp.status != HTTP_OK:
|
||||
try_again(f"{resp.url} returned {resp.status}")
|
||||
return
|
||||
text = await resp.text()
|
||||
|
||||
Reference in New Issue
Block a user