Fix zeroconf discovery bug

This commit is contained in:
Santiago Lo Coco 2024-11-04 00:03:46 +01:00
parent 0c8411d53e
commit e78338f168
2 changed files with 4 additions and 6 deletions

View File

@ -1,5 +1,5 @@
DATABASE=sqlite:///endpoints.db
API_HOST=windows.local
API_HOST=RoomF7203.local
SERVICE_NAME=RoomF7203
SERVICE_TYPE=_http._tcp.local.
SERVICE_IP=192.168.137.1

View File

@ -1,6 +1,6 @@
from zeroconf import ServiceInfo, Zeroconf
from config import API_HOST, SERVICE_IP, SERVICE_NAME, SERVICE_PORT, SERVICE_TYPE
from config import SERVICE_IP, SERVICE_NAME, SERVICE_PORT, SERVICE_TYPE
zeroconf = Zeroconf()
@ -9,10 +9,8 @@ info = ServiceInfo(
name=f"{SERVICE_NAME}.{SERVICE_TYPE}",
addresses=[SERVICE_IP],
port=int(SERVICE_PORT),
server=API_HOST,
properties={
"path": "/api/endpoints",
},
server=f"{SERVICE_NAME}.local.",
properties={"path": "/api/endpoints"},
)