From 8149652f9f3f808261c01e8a43b1c692f2bae084 Mon Sep 17 00:00:00 2001 From: Chris Xiao <30990835+chrisx8@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:20:37 -0400 Subject: [PATCH] Move qbittorrent constants to const.py (#90201) * move qbittorrent constants to const.py * move SENSOR_TYPE_* consts back to sensors.py --- homeassistant/components/qbittorrent/const.py | 3 +++ homeassistant/components/qbittorrent/sensor.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/qbittorrent/const.py diff --git a/homeassistant/components/qbittorrent/const.py b/homeassistant/components/qbittorrent/const.py new file mode 100644 index 00000000000..5f9ad42f7fc --- /dev/null +++ b/homeassistant/components/qbittorrent/const.py @@ -0,0 +1,3 @@ +"""Constants for qBittorrent.""" + +DEFAULT_NAME = "qBittorrent" diff --git a/homeassistant/components/qbittorrent/sensor.py b/homeassistant/components/qbittorrent/sensor.py index 26605a87652..bee7a5d61a6 100644 --- a/homeassistant/components/qbittorrent/sensor.py +++ b/homeassistant/components/qbittorrent/sensor.py @@ -28,14 +28,14 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType +from .const import DEFAULT_NAME + _LOGGER = logging.getLogger(__name__) SENSOR_TYPE_CURRENT_STATUS = "current_status" SENSOR_TYPE_DOWNLOAD_SPEED = "download_speed" SENSOR_TYPE_UPLOAD_SPEED = "upload_speed" -DEFAULT_NAME = "qBittorrent" - SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key=SENSOR_TYPE_CURRENT_STATUS,