diff --git a/mobileraker.py b/mobileraker.py index b6df68d..88f2677 100644 --- a/mobileraker.py +++ b/mobileraker.py @@ -81,7 +81,7 @@ def __init__( async def connect(self) -> None: self.info("Trying to connect to: %s api key %s" % (self.moonraker_server, - '' if self.moonraker_api_key == 'False' else self.moonraker_api_key[ + '' if self.moonraker_api_key else self.moonraker_api_key[ :6] + '##########################')) async for websocket in websockets.connect(self.moonraker_server, extra_headers=None if self.moonraker_api_key == 'False' else [ @@ -401,13 +401,13 @@ def __init__(self, configfile): for printer in printer_sections: self.printers[printer[8:]] = { "moonraker_uri": self.config.get(printer, "moonraker_uri", fallback="ws://127.0.0.1:7125/websocket"), - "moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback=False) + "moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback='False') } if len(self.printers) <= 0: self.printers['_Default'] = { "moonraker_uri": "ws://127.0.0.1:7125/websocket", - "moonraker_api_key": False + "moonraker_api_key": 'False' } logging.info("Read %i printer config sections" % len(self.printers))