webcam: fix default host fallback
Fallback to the loopback if unable to determine the local ip address. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0188b81d4a
commit
6e253b0d42
|
@ -63,8 +63,7 @@ class WebcamManager:
|
|||
machine: Machine = self.server.lookup_component("machine")
|
||||
pubnet = await machine.get_public_network()
|
||||
ip: Optional[str] = pubnet.get("address")
|
||||
default_host = f"http://{pubnet['hostname']}"
|
||||
if ip is not None:
|
||||
if ip:
|
||||
default_host = f"http://{ip}"
|
||||
WebCam.set_default_host(default_host)
|
||||
db: MoonrakerDatabase = self.server.lookup_component("database")
|
||||
|
|
Loading…
Reference in New Issue