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:
parent
7383e81609
commit
8d61893c39
79 changed files with 214 additions and 154 deletions
|
@ -3,7 +3,7 @@
|
|||
import logging
|
||||
from typing import Optional
|
||||
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, HTTP_OK
|
||||
|
||||
from .const import (
|
||||
KEY_DEVICES,
|
||||
|
@ -40,12 +40,12 @@ class RachioPerson:
|
|||
def setup(self, hass):
|
||||
"""Rachio device setup."""
|
||||
response = self.rachio.person.getInfo()
|
||||
assert int(response[0][KEY_STATUS]) == 200, "API key error"
|
||||
assert int(response[0][KEY_STATUS]) == HTTP_OK, "API key error"
|
||||
self._id = response[1][KEY_ID]
|
||||
|
||||
# Use user ID to get user data
|
||||
data = self.rachio.person.get(self._id)
|
||||
assert int(data[0][KEY_STATUS]) == 200, "User ID error"
|
||||
assert int(data[0][KEY_STATUS]) == HTTP_OK, "User ID error"
|
||||
self.username = data[1][KEY_USERNAME]
|
||||
devices = data[1][KEY_DEVICES]
|
||||
for controller in devices:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue