Files
bmspy/bmspy/utilities.py
T
2026-05-02 17:40:31 +02:00

20 lines
432 B
Python
Executable File

#!/usr/bin/env python3
#
# Daemon: listens on a Unix socket and serves JBD BMS data to clients
#
import datetime
import pprint
def debugger(data, pretty: bool = False):
if pretty:
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(
{
"time": datetime.datetime.now(),
"data": data,
}
)
msg = f"{str(datetime.datetime.now())} {data}"
print(msg)