MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / getConnectionOptions

Method getConnectionOptions

src/astroprint/printer/__init__.py:162–174  ·  view source on GitHub ↗

Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer.

(self)

Source from the content-addressed store, hash-verified

160 self._fileManager.rampdown()
161
162 def getConnectionOptions(self):
163 """
164 Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer.
165 """
166 s = settings()
167
168 return {
169 "ports": self.serialList(),
170 "baudrates": self.baudrateList(),
171 "portPreference": s.get(["serial", "port"]),
172 "baudratePreference": s.getInt(["serial", "baudrate"]),
173 "autoconnect": s.getBoolean(["serial", "autoconnect"])
174 }
175
176 def registerCallback(self, callback):
177 self._callbacks.append(callback)

Callers 9

connectMethod · 0.95
getSettingsFunction · 0.45
getConnectionMethod · 0.45
connectionCommandMethod · 0.45
connectionStateFunction · 0.45
connectionCommandFunction · 0.45
connection_settingsFunction · 0.45
handlePrinterSettingsFunction · 0.45

Calls 6

serialListMethod · 0.95
baudrateListMethod · 0.95
settingsFunction · 0.90
getIntMethod · 0.80
getBooleanMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected