Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions homeassistant/components/qbittorrent/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def setup_platform(
name = config.get(CONF_NAME)

entities = [
QBittorrentSensor(description, client, name, LoginRequired)
for description in SENSOR_TYPES
QBittorrentSensor(description, client, name) for description in SENSOR_TYPES
]

add_entities(entities, True)
Expand All @@ -111,12 +110,10 @@ def __init__(
description: SensorEntityDescription,
qbittorrent_client,
client_name,
exception,
) -> None:
"""Initialize the qBittorrent sensor."""
self.entity_description = description
self.client = qbittorrent_client
self._exception = exception

self._attr_name = f"{client_name} {description.name}"
self._attr_available = False
Expand All @@ -130,7 +127,7 @@ def update(self) -> None:
_LOGGER.error("Connection lost")
self._attr_available = False
return
except self._exception:
except LoginRequired:
_LOGGER.error("Invalid authentication")
return

Expand Down