Skip to content

Commit

Permalink
Minor fix for no config
Browse files Browse the repository at this point in the history
  • Loading branch information
Clon1998 committed Jul 7, 2022
1 parent ea7eecc commit 89cb89b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mobileraker.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(

async def connect(self) -> None:
self.info("Trying to connect to: %s api key %s" % (self.moonraker_server,
'<NO API KEY>' if self.moonraker_api_key == 'False' else self.moonraker_api_key[
'<NO 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 [
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 89cb89b

Please sign in to comment.