From b6a3f628d13eb040957d9ce3c4ea67ce22cc58c8 Mon Sep 17 00:00:00 2001 From: Rami Mosleh Date: Tue, 7 Nov 2023 10:04:59 +0200 Subject: [PATCH] Bump transmission-rpc to version 7.0.3 (#103502) * Bump transmission-rpc to version 7.0.3 * Change `date_added` to `added_date` --- homeassistant/components/transmission/const.py | 4 ++-- homeassistant/components/transmission/coordinator.py | 4 ++-- homeassistant/components/transmission/manifest.json | 2 +- homeassistant/components/transmission/sensor.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/transmission/const.py b/homeassistant/components/transmission/const.py index 77d2baf7213..6074d03acf6 100644 --- a/homeassistant/components/transmission/const.py +++ b/homeassistant/components/transmission/const.py @@ -16,9 +16,9 @@ ORDER_WORST_RATIO_FIRST = "worst_ratio_first" SUPPORTED_ORDER_MODES: dict[str, Callable[[list[Torrent]], list[Torrent]]] = { ORDER_NEWEST_FIRST: lambda torrents: sorted( - torrents, key=lambda t: t.date_added, reverse=True + torrents, key=lambda t: t.added_date, reverse=True ), - ORDER_OLDEST_FIRST: lambda torrents: sorted(torrents, key=lambda t: t.date_added), + ORDER_OLDEST_FIRST: lambda torrents: sorted(torrents, key=lambda t: t.added_date), ORDER_WORST_RATIO_FIRST: lambda torrents: sorted(torrents, key=lambda t: t.ratio), ORDER_BEST_RATIO_FIRST: lambda torrents: sorted( torrents, key=lambda t: t.ratio, reverse=True diff --git a/homeassistant/components/transmission/coordinator.py b/homeassistant/components/transmission/coordinator.py index 91597d0e43d..d03ef5e37fb 100644 --- a/homeassistant/components/transmission/coordinator.py +++ b/homeassistant/components/transmission/coordinator.py @@ -146,7 +146,7 @@ class TransmissionDataUpdateCoordinator(DataUpdateCoordinator[SessionStats]): """Stop all active torrents.""" if not self.torrents: return - torrent_ids = [torrent.id for torrent in self.torrents] + torrent_ids: list[int | str] = [torrent.id for torrent in self.torrents] self.api.stop_torrent(torrent_ids) def set_alt_speed_enabled(self, is_enabled: bool) -> None: @@ -158,4 +158,4 @@ class TransmissionDataUpdateCoordinator(DataUpdateCoordinator[SessionStats]): if self._session is None: return None - return self._session.alt_speed_enabled # type: ignore[no-any-return] + return self._session.alt_speed_enabled diff --git a/homeassistant/components/transmission/manifest.json b/homeassistant/components/transmission/manifest.json index 17b3bbbf49b..ad89ae94033 100644 --- a/homeassistant/components/transmission/manifest.json +++ b/homeassistant/components/transmission/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/transmission", "iot_class": "local_polling", "loggers": ["transmissionrpc"], - "requirements": ["transmission-rpc==4.1.5"] + "requirements": ["transmission-rpc==7.0.3"] } diff --git a/homeassistant/components/transmission/sensor.py b/homeassistant/components/transmission/sensor.py index c3ba418f885..d52a98a430e 100644 --- a/homeassistant/components/transmission/sensor.py +++ b/homeassistant/components/transmission/sensor.py @@ -206,7 +206,7 @@ def _torrents_info( torrents = SUPPORTED_ORDER_MODES[order](torrents) for torrent in torrents[:limit]: info = infos[torrent.name] = { - "added_date": torrent.date_added, + "added_date": torrent.added_date, "percent_done": f"{torrent.percent_done * 100:.2f}", "status": torrent.status, "id": torrent.id, diff --git a/requirements_all.txt b/requirements_all.txt index 09501cf8471..022dc2dcc80 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2614,7 +2614,7 @@ tp-connected==0.0.4 tplink-omada-client==1.3.2 # homeassistant.components.transmission -transmission-rpc==4.1.5 +transmission-rpc==7.0.3 # homeassistant.components.twinkly ttls==1.5.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 936fe51a00d..acc4755f67f 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1935,7 +1935,7 @@ total-connect-client==2023.2 tplink-omada-client==1.3.2 # homeassistant.components.transmission -transmission-rpc==4.1.5 +transmission-rpc==7.0.3 # homeassistant.components.twinkly ttls==1.5.1