Skip to content

Commit

Permalink
Switch connection_manager.CONNECTION_STATE to Enum
Browse files Browse the repository at this point in the history
Since the earliest version of Python we support is now Python 3.6, we
can use an enum.Enum for CONNECTION_STATE, rather than a dict. This
should result in no behaviour changes.
  • Loading branch information
s-t-e-v-e-n-k committed Nov 25, 2024
1 parent fe8c16c commit 60bed53
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jellyfin_apiclient_python/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import socket
from datetime import datetime
from enum import Enum
from operator import itemgetter

import urllib3
Expand All @@ -18,12 +19,11 @@
#################################################################################################

LOG = logging.getLogger('JELLYFIN.' + __name__)
CONNECTION_STATE = {
'Unavailable': 0,
'ServerSelection': 1,
'ServerSignIn': 2,
'SignedIn': 3
}
class CONNECTION_STATE(Enum):
Unavailable = 0
ServerSelection = 1
ServerSignIn = 2
SignedIn = 3

#################################################################################################

Expand Down

0 comments on commit 60bed53

Please sign in to comment.