mirror of
https://github.com/blw1138/Zordon.git
synced 2026-02-05 13:46:10 +00:00
Misc minor fixes
This commit is contained in:
@@ -210,3 +210,18 @@ def num_to_alphanumeric(num):
|
||||
result += characters[remainder]
|
||||
|
||||
return result[::-1] # Reverse the result to get the correct alphanumeric string
|
||||
|
||||
|
||||
def iso_datestring_to_formatted_datestring(iso_date_string):
|
||||
from dateutil import parser
|
||||
import pytz
|
||||
|
||||
# Parse the ISO date string into a datetime object and convert timezones
|
||||
date = parser.isoparse(iso_date_string).astimezone(pytz.UTC)
|
||||
local_timezone = datetime.now().astimezone().tzinfo
|
||||
date_local = date.astimezone(local_timezone)
|
||||
|
||||
# Format the date to the desired readable yet sortable format with 12-hour time
|
||||
formatted_date = date_local.strftime('%Y-%m-%d %I:%M %p')
|
||||
|
||||
return formatted_date
|
||||
|
||||
@@ -32,9 +32,11 @@ class ZeroconfServer:
|
||||
def start(cls, listen_only=False):
|
||||
if not cls.service_type:
|
||||
raise RuntimeError("The 'configure' method must be run before starting the zeroconf server")
|
||||
logger.debug("Starting zeroconf service")
|
||||
if not listen_only:
|
||||
elif not listen_only:
|
||||
logger.debug(f"Starting zeroconf service")
|
||||
cls._register_service()
|
||||
else:
|
||||
logger.debug(f"Starting zeroconf service - Listen only mode")
|
||||
cls._browse_services()
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user