moonraker: Add method to retreive host info
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
28844cb41d
commit
ab35346f24
|
@ -89,8 +89,10 @@ class Server:
|
||||||
self._load_plugins(config)
|
self._load_plugins(config)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
hostname, hostport = self.get_host_info()
|
||||||
logging.info(
|
logging.info(
|
||||||
f"Starting Moonraker on ({self.host}, {self.port})")
|
f"Starting Moonraker on ({self.host}, {hostport}), "
|
||||||
|
f"Hostname: {hostname}")
|
||||||
self.moonraker_app.listen(self.host, self.port)
|
self.moonraker_app.listen(self.host, self.port)
|
||||||
self.server_running = True
|
self.server_running = True
|
||||||
self.ioloop.spawn_callback(self._connect_klippy)
|
self.ioloop.spawn_callback(self._connect_klippy)
|
||||||
|
@ -156,6 +158,10 @@ class Server:
|
||||||
return
|
return
|
||||||
self.remote_methods[method_name] = cb
|
self.remote_methods[method_name] = cb
|
||||||
|
|
||||||
|
def get_host_info(self):
|
||||||
|
hostname = socket.gethostname()
|
||||||
|
return hostname, self.port
|
||||||
|
|
||||||
# ***** Klippy Connection *****
|
# ***** Klippy Connection *****
|
||||||
async def _connect_klippy(self):
|
async def _connect_klippy(self):
|
||||||
if not self.server_running:
|
if not self.server_running:
|
||||||
|
|
Loading…
Reference in New Issue