diff --git a/homeassistant/components/transmission/const.py b/homeassistant/components/transmission/const.py index 517ef0a853a..0e29bbbff5f 100644 --- a/homeassistant/components/transmission/const.py +++ b/homeassistant/components/transmission/const.py @@ -10,9 +10,9 @@ ORDER_WORST_RATIO_FIRST = "worst_ratio_first" SUPPORTED_ORDER_MODES = { ORDER_NEWEST_FIRST: lambda torrents: sorted( - torrents, key=lambda t: t.addedDate, reverse=True + torrents, key=lambda t: t.date_added, reverse=True ), - ORDER_OLDEST_FIRST: lambda torrents: sorted(torrents, key=lambda t: t.addedDate), + ORDER_OLDEST_FIRST: lambda torrents: sorted(torrents, key=lambda t: t.date_added), 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/manifest.json b/homeassistant/components/transmission/manifest.json index 53441057a5c..17b3bbbf49b 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==3.4.0"] + "requirements": ["transmission-rpc==4.1.5"] } diff --git a/homeassistant/components/transmission/sensor.py b/homeassistant/components/transmission/sensor.py index 2c7bf24cdfd..184d05faeb0 100644 --- a/homeassistant/components/transmission/sensor.py +++ b/homeassistant/components/transmission/sensor.py @@ -117,9 +117,9 @@ class TransmissionSpeedSensor(TransmissionSensor): """Get the latest data from Transmission and updates the state.""" if data := self._tm_client.api.data: b_spd = ( - float(data.downloadSpeed) + float(data.download_speed) if self._sub_type == "download" - else float(data.uploadSpeed) + else float(data.upload_speed) ) self._state = b_spd @@ -134,8 +134,8 @@ class TransmissionStatusSensor(TransmissionSensor): def update(self) -> None: """Get the latest data from Transmission and updates the state.""" if data := self._tm_client.api.data: - upload = data.uploadSpeed - download = data.downloadSpeed + upload = data.upload_speed + download = data.download_speed if upload > 0 and download > 0: self._state = STATE_UP_DOWN elif upload > 0 and download == 0: @@ -199,8 +199,8 @@ def _torrents_info(torrents, order, limit, statuses=None): torrents = SUPPORTED_ORDER_MODES[order](torrents) for torrent in torrents[:limit]: info = infos[torrent.name] = { - "added_date": torrent.addedDate, - "percent_done": f"{torrent.percentDone * 100:.2f}", + "added_date": torrent.date_added, + "percent_done": f"{torrent.percent_done * 100:.2f}", "status": torrent.status, "id": torrent.id, } diff --git a/homeassistant/components/transmission/switch.py b/homeassistant/components/transmission/switch.py index ed771d24581..3af3fe57e3c 100644 --- a/homeassistant/components/transmission/switch.py +++ b/homeassistant/components/transmission/switch.py @@ -118,7 +118,7 @@ class TransmissionSwitch(SwitchEntity): if self.type == "on_off": self._data = self._tm_client.api.data if self._data: - active = self._data.activeTorrentCount > 0 + active = self._data.active_torrent_count > 0 elif self.type == "turtle_mode": active = self._tm_client.api.get_alt_speed_enabled() diff --git a/requirements_all.txt b/requirements_all.txt index 0cd876ccfb9..22e670a8436 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2521,7 +2521,7 @@ tp-connected==0.0.4 tplink-omada-client==1.1.4 # homeassistant.components.transmission -transmission-rpc==3.4.0 +transmission-rpc==4.1.5 # homeassistant.components.twinkly ttls==1.5.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3b2e98ceae3..bf40b7136ed 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1797,7 +1797,7 @@ total_connect_client==2023.2 tplink-omada-client==1.1.4 # homeassistant.components.transmission -transmission-rpc==3.4.0 +transmission-rpc==4.1.5 # homeassistant.components.twinkly ttls==1.5.1