moonraker: Add method to retreive host info

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-10-13 07:50:18 -04:00
parent 28844cb41d
commit ab35346f24
1 changed files with 7 additions and 1 deletions

View File

@ -89,8 +89,10 @@ class Server:
self._load_plugins(config)
def start(self):
hostname, hostport = self.get_host_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.server_running = True
self.ioloop.spawn_callback(self._connect_klippy)
@ -156,6 +158,10 @@ class Server:
return
self.remote_methods[method_name] = cb
def get_host_info(self):
hostname = socket.gethostname()
return hostname, self.port
# ***** Klippy Connection *****
async def _connect_klippy(self):
if not self.server_running: