From d35a34c952a7376da0bb97d6e239c0bcdc681947 Mon Sep 17 00:00:00 2001 From: definitio <37266727+definitio@users.noreply.github.com> Date: Fri, 8 Jan 2021 12:06:56 +0300 Subject: [PATCH] Use HTTP_OK constant --- custom_components/rhvoice/tts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/rhvoice/tts.py b/custom_components/rhvoice/tts.py index 345c7ca..84e412b 100644 --- a/custom_components/rhvoice/tts.py +++ b/custom_components/rhvoice/tts.py @@ -7,7 +7,7 @@ import voluptuous as vol from aiohttp import ClientError from homeassistant.components.tts import PLATFORM_SCHEMA, Provider -from homeassistant.const import CONF_HOST, CONF_PORT, CONF_TIMEOUT +from homeassistant.const import CONF_HOST, CONF_PORT, CONF_TIMEOUT, HTTP_OK from homeassistant.helpers import config_validation as cv from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -122,7 +122,7 @@ async def async_get_tts_audio(self, message, language, options=None): request = await websession.get(self._url, params=url_param) - if request.status != 200: + if request.status != HTTP_OK: _LOGGER.error( "Error %d on load URL %s", request.status, request.url )