mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Add strict typing for transmission (#101904)
This commit is contained in:
@ -1,4 +1,10 @@
|
||||
"""Constants for the Transmission Bittorent Client component."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
|
||||
from transmission_rpc import Torrent
|
||||
|
||||
DOMAIN = "transmission"
|
||||
|
||||
SWITCH_TYPES = {"on_off": "Switch", "turtle_mode": "Turtle mode"}
|
||||
@ -8,7 +14,7 @@ ORDER_OLDEST_FIRST = "oldest_first"
|
||||
ORDER_BEST_RATIO_FIRST = "best_ratio_first"
|
||||
ORDER_WORST_RATIO_FIRST = "worst_ratio_first"
|
||||
|
||||
SUPPORTED_ORDER_MODES = {
|
||||
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
|
||||
),
|
||||
|
Reference in New Issue
Block a user